Support user-provided HuggingFace cache
Feature request description
Ramalama should support HuggingFace cache as set by the user.
Suggest potential solution
Check for HF_HOME. or let a user pass it as an additional parameter.
Have you considered any alternatives?
No response
Additional context
No response
Interested in opening a PR to add this?
A friendly reminder that this issue had no activity for 30 days.
This should be as simple as adding HF_HOME as the first entry here: https://github.com/containers/ramalama/blob/499b2bc7e28797eef2689f7ab829c4f529fa6a55/ramalama/transports/huggingface.py#L204
Please open a PR to make this change.
A friendly reminder that this issue had no activity for 30 days.
@kush-gupt is this one fixed?
Unfortunately not yet, that method is actually unused within the new model store.
I believe the best path towards this feature would be a hf cache model object within the store to differentiate between directly pulled and "imported"/pointed to ones that are managed by hf
@rhatdan @engelmi if this type of path would be preferred, I have a draft (that would need to be rebased) over here: https://github.com/kush-gupt/ramalama/pull/18
@olliewalsh PTAL
@kush-gupt I think this is closely related to https://github.com/containers/ramalama/issues/2098 - be it local files from the ollama or hf cache or something else. I agree that having a hf cache object to distinguish between downloaded and locally available models. One issue pointed out in #2098 is ownership vs disk space of the model. If Ramalama only links to the files in the hf cache directory, then ramalama doesn't "fully manage" it and has to do additional sanity checks. If Ramalama copies these files, we are in full control, but require unnecessary disk space. AFAIK we currently have support for the later with the LocalModelFile, which you pass to the model store for performing the copy. I think we should aim for the former for the hf/ollama cache and improve on the sanity checks and cleanup. This means also when pulling a model, we first check the configured cache directories.