[GH-ISSUE #7333] OLLAMA_MODELS env var is ignored #4660

Closed
opened 2026-04-12 15:34:47 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @aliok on GitHub (Oct 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7333

What is the issue?

When I want to download models to a specific directory using OLLAMA_MODELS env var, I see it is ignored.

https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-set-them-to-a-different-location says this:

If a different directory needs to be used, set the environment variable OLLAMA_MODELS to the chosen directory.

However, I don't see the model files in the specified directory:

➜  mkdir -p /tmp/foo/models

➜  ls -lah /tmp/foo/models
total 0
drwxr-xr-x 2 aliok 64 Oct 23 19:10 ./
drwxr-xr-x 3 aliok 96 Oct 23 19:10 ../

➜  export OLLAMA_MODELS="/tmp/foo/models/"

➜  ollama pull gemma2:2b
pulling manifest
pulling 7462734796d6... 100% ▕1.6 GB
pulling e0a42594d802... 100% ▕ 358 B
pulling 097a36493f71... 100% ▕8.4 KB
pulling 2490e7468436... 100% ▕  65 B
pulling e18ad7af7efb... 100% ▕ 487 B
verifying sha256 digest
writing manifest
success

➜ ls -lah /tmp/foo/models
total 0
drwxr-xr-x 2 aliok  64 Oct 23 19:10 ./
drwxr-xr-x 4 aliok 128 Oct 23 19:13 ../

pull command doesn't list this env var anyway:

➜  ollama pull --help
Pull a model from a registry

Usage:
  ollama pull MODEL [flags]

Flags:
  -h, --help       help for pull
      --insecure   Use an insecure registry

Environment Variables:
      OLLAMA_HOST                IP Address for the ollama server (default 127.0.0.1:11434)

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.3.14

Originally created by @aliok on GitHub (Oct 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7333 ### What is the issue? When I want to download models to a specific directory using `OLLAMA_MODELS` env var, I see it is ignored. https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-set-them-to-a-different-location says this: ``` If a different directory needs to be used, set the environment variable OLLAMA_MODELS to the chosen directory. ``` However, I don't see the model files in the specified directory: ``` ➜ mkdir -p /tmp/foo/models ➜ ls -lah /tmp/foo/models total 0 drwxr-xr-x 2 aliok 64 Oct 23 19:10 ./ drwxr-xr-x 3 aliok 96 Oct 23 19:10 ../ ➜ export OLLAMA_MODELS="/tmp/foo/models/" ➜ ollama pull gemma2:2b pulling manifest pulling 7462734796d6... 100% ▕1.6 GB pulling e0a42594d802... 100% ▕ 358 B pulling 097a36493f71... 100% ▕8.4 KB pulling 2490e7468436... 100% ▕ 65 B pulling e18ad7af7efb... 100% ▕ 487 B verifying sha256 digest writing manifest success ➜ ls -lah /tmp/foo/models total 0 drwxr-xr-x 2 aliok 64 Oct 23 19:10 ./ drwxr-xr-x 4 aliok 128 Oct 23 19:13 ../ ``` `pull` command doesn't list this env var anyway: ``` ➜ ollama pull --help Pull a model from a registry Usage: ollama pull MODEL [flags] Flags: -h, --help help for pull --insecure Use an insecure registry Environment Variables: OLLAMA_HOST IP Address for the ollama server (default 127.0.0.1:11434) ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.3.14
GiteaMirror added the bug label 2026-04-12 15:34:47 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 23, 2024):

Set the variable in the environment of the server.

<!-- gh-comment-id:2432805745 --> @rick-github commented on GitHub (Oct 23, 2024): Set the variable in the [environment of the server](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server).
Author
Owner

@pdevine commented on GitHub (Oct 23, 2024):

@aliok as @rick-github mentioned, you need to pass the environment variable to ollama serve. I'll go ahead and close the issue.

<!-- gh-comment-id:2432913578 --> @pdevine commented on GitHub (Oct 23, 2024): @aliok as @rick-github mentioned, you need to pass the environment variable to `ollama serve`. I'll go ahead and close the issue.
Author
Owner

@aliok commented on GitHub (Oct 23, 2024):

Thanks folks. I now realized there's a daemon :)

<!-- gh-comment-id:2433026100 --> @aliok commented on GitHub (Oct 23, 2024): Thanks folks. I now realized there's a daemon :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4660