[GH-ISSUE #6698] Custom OLLAMA_MODELS Environment Variable Not Respected #4215

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

Originally created by @sascharo on GitHub (Sep 8, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6698

What is the issue?

Despite setting the environment variable OLLAMA_MODELS to a custom path, Ollama continues to download models to the default location (C:\Users\%username%\.ollama\models). The environment variable is set correctly and confirmed via echo env:OLLAMA_MODELS, but the expected behavior of downloading models to the custom path is not happening.

OS

Windows

GPU

Nvidia

CPU

AMD

Ollama version

0.3.9

Originally created by @sascharo on GitHub (Sep 8, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6698 ### What is the issue? Despite setting the environment variable `OLLAMA_MODELS` to a custom path, Ollama continues to download models to the default location (`C:\Users\%username%\.ollama\models`). The environment variable is set correctly and confirmed via echo `env:OLLAMA_MODELS`, but the expected behavior of downloading models to the custom path is not happening. ### OS Windows ### GPU Nvidia ### CPU AMD ### Ollama version 0.3.9
GiteaMirror added the bug label 2026-04-12 15:09:07 -05:00
Author
Owner

@rick-github commented on GitHub (Sep 8, 2024):

Server logs may help in debugging.

<!-- gh-comment-id:2336613260 --> @rick-github commented on GitHub (Sep 8, 2024): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may help in debugging.
Author
Owner

@SamuelHafner commented on GitHub (Sep 8, 2024):

Did you set the OLLAMA_MODELS ENV before your ollama serve like:

OLLAMA_MODELS=~/Documents/ollama_models/ ollama serve

this works for me but I work on linux

<!-- gh-comment-id:2336628305 --> @SamuelHafner commented on GitHub (Sep 8, 2024): Did you set the `OLLAMA_MODELS` ENV before your ollama serve like: ```bash OLLAMA_MODELS=~/Documents/ollama_models/ ollama serve ``` this works for me but I work on linux
Author
Owner

@sascharo commented on GitHub (Sep 8, 2024):

For some reason, it's working in a new terminal now.

<!-- gh-comment-id:2336686546 --> @sascharo commented on GitHub (Sep 8, 2024): For some reason, it's working in a new terminal now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4215