Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: list the available local models from the cache #112

Open
synw opened this issue Sep 4, 2024 · 2 comments
Open

Feature: list the available local models from the cache #112

synw opened this issue Sep 4, 2024 · 2 comments

Comments

@synw
Copy link

synw commented Sep 4, 2024

I would like to get a models list from what is in the cache, to implement an "available local models" feature.

I saw that there is a list function in the cache manager but it is not very convenient to get the models names, as this is a list of files and that the file names are not very usable: for example: 2f29f4de9810c95c9c4676f6939af5afc48396b1_Phi-3-mini-4k-instruct-q4-00001-of-00010.gguf.

@ngxson
Copy link
Owner

ngxson commented Sep 4, 2024

There is also cacheEntry.metadata object, which holds the original URL of the model. Is this what you want?

https://github.com/ngxson/wllama/blob/e7fe626/src/cache-manager.ts#L8

Example usage:

const getManageModels = async (): Promise<ManageModel[]> => {

@synw
Copy link
Author

synw commented Sep 5, 2024

Yes thanks for pointing me to this example. I used your function with removing references to external types and list of models and it works well.

Would it be possible to have a generic high level getManageModels function integrated in the library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants