mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 00:55:21 -04:00
Where does ollama-python saves the pulled model? #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Lopa07 on GitHub (Jul 1, 2024).
Where does ollama-python saves the pulled model using
ollama.pull('llava')? I tried to set the environment variableOLLAMA_MODELSsimilar to Ollama-cli. But it is not using the path provided inOLLAMA_MODELS.@anthonywu commented on GitHub (Jul 31, 2024):
common mistake is not have
export OLLAMA_MODELS=<value>ed the variable when you set it, I'd double check that.The model dir on macOS is
~/.ollama/models, should be similar on Linux systems, and should be%USERPROFILE%on Windows (I don't dev on Windows, cannot confirm for you)On Mac, the model files are stored in chunks in
~/.ollama/models/blobsbut they aresha256--prefixed directory names that are not readable. To match which one matches your model you need to first check the manifest which looks like this for today'sllama3:note the
layersitems wheremediaTypeisapplication/vnd.ollama.image.model, the digest issha256:6a0746a1ec1aef3e7ec53868f220ff6e389f6f8ef87a01d77c96807de94ca2aa. You convert that:to-and you get theblobs/subdirectory name.To piece this altogether, if you have
jq(or similar json parser installed), you can confirm this is a big model file previously downloaded:this matches the reported model size:
replace
llama3/latestwith your model's name and tag to get the same outcomeif you successfully set
OLLAMA_MODELSto some other path, and don't want to re-download the files, I think you can just manuallymvthe directory to your new preferred pathhope this helps