[PR #15086] envconfig: add OLLAMA_HOME environment variable #15012

Open
opened 2026-04-13 01:08:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15086
Author: @JohnMolotov
Created: 3/27/2026
Status: 🔄 Open

Base: mainHead: env-ollama-home


📝 Commits (1)

  • cf7f9e9 envconfig: add OLLAMA_HOME environment variable

📊 Changes

11 files changed (+50 additions, -87 deletions)

View changed files

📝 app/cmd/app/app_darwin.go (+2 -1)
📝 app/server/server_unix.go (+3 -1)
📝 app/store/cloud_config.go (+1 -5)
📝 app/store/store.go (+4 -11)
📝 app/updater/updater_darwin.go (+2 -5)
📝 auth/auth.go (+3 -12)
📝 cmd/cmd.go (+3 -8)
📝 cmd/config/config.go (+3 -10)
📝 envconfig/config.go (+23 -15)
📝 readline/history.go (+2 -6)
📝 server/internal/client/ollama/registry.go (+4 -13)

📄 Description

Adds an OLLAMA_HOME environment variable to configure the Ollama home directory. This allows users to relocate all Ollama data (models, config, logs, keys, history, etc.) to a custom location.

It does this using a Home() function in envconfig that checks the OLLAMA_HOME env var, with the default being the previously hardcoded value of ~/.ollama. All code that previously hardcoded this value has been updated to use envconfig.Home()

In future it may make sense to set this and OLLAMA_MODELS to default to respecting the XDG standard, however as that would mean either moving the directories or breaking compatibility I have not included it in this pull request.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15086 **Author:** [@JohnMolotov](https://github.com/JohnMolotov) **Created:** 3/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `env-ollama-home` --- ### 📝 Commits (1) - [`cf7f9e9`](https://github.com/ollama/ollama/commit/cf7f9e92a56862f2808c9aaae806ba33877a4a8d) envconfig: add OLLAMA_HOME environment variable ### 📊 Changes **11 files changed** (+50 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `app/cmd/app/app_darwin.go` (+2 -1) 📝 `app/server/server_unix.go` (+3 -1) 📝 `app/store/cloud_config.go` (+1 -5) 📝 `app/store/store.go` (+4 -11) 📝 `app/updater/updater_darwin.go` (+2 -5) 📝 `auth/auth.go` (+3 -12) 📝 `cmd/cmd.go` (+3 -8) 📝 `cmd/config/config.go` (+3 -10) 📝 `envconfig/config.go` (+23 -15) 📝 `readline/history.go` (+2 -6) 📝 `server/internal/client/ollama/registry.go` (+4 -13) </details> ### 📄 Description Adds an `OLLAMA_HOME` environment variable to configure the Ollama home directory. This allows users to relocate all Ollama data (models, config, logs, keys, history, etc.) to a custom location. It does this using a `Home()` function in envconfig that checks the `OLLAMA_HOME` env var, with the default being the previously hardcoded value of `~/.ollama`. All code that previously hardcoded this value has been updated to use `envconfig.Home()` In future it may make sense to set this and OLLAMA_MODELS to default to respecting the XDG standard, however as that would mean either moving the directories or breaking compatibility I have not included it in this pull request. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 01:08:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#15012