ollama修改模型的目录 - xd21303/Notebook GitHub Wiki
- macOS:
~/.ollama/models
- Linux:
/usr/share/ollama/.ollama/models
- Windows:
C:\Users\%username%\.ollama\models
If a different directory needs to be used, set the environment variable OLLAMA_MODELS
to the chosen directory.
Note: on Linux using the standard installer, the
ollama
user needs read and write access to the specified directory. To assign the directory to theollama
user runsudo chown -R ollama:ollama <directory>
.
Refer to the section above for how to set environment variables on your platform.
If Ollama is run as a systemd service, environment variables should be set using systemctl
:
-
Edit the systemd service by calling
systemctl edit ollama.service
. This will open an editor. -
For each environment variable, add a line
Environment
under section[Service]
:[Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
-
Save and exit.
-
Reload
systemd
and restart Ollama:systemctl daemon-reload systemctl restart ollama
参考https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server