[PR #10725] [CLOSED] envconfig: added support for config.env file at ~/.ollama/config.env #18616

Closed
opened 2026-04-16 06:41:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10725
Author: @davidstevens37
Created: 5/16/2025
Status: Closed

Base: mainHead: feature/env-config-file-support


📝 Commits (1)

  • 3449ca5 envconfig: added support for config.env file in ~/.ollama secondary to ENV variables.

📊 Changes

3 files changed (+163 additions, -3 deletions)

View changed files

📝 docs/faq.md (+6 -1)
📝 envconfig/config.go (+66 -1)
📝 envconfig/config_test.go (+91 -1)

📄 Description

This changes Ollama to support a config.env file located at ~/.ollama/config.env.

The change retains existing behavior. ENV variables will always take precedence; if the env variable is not set, it will attempt to use the value set in confg.env.

PS - this is my first time touching Go. So, if there's some deviation from community standards, patterns, or conventions, apologies in advance. ... and sorry for the spastic extra pushes, after the PR was opened, i saw there was a mismatch in spaces vs tabs. So updated them to ensure it remains consistent.

Fixes #10724


🔄 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/10725 **Author:** [@davidstevens37](https://github.com/davidstevens37) **Created:** 5/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/env-config-file-support` --- ### 📝 Commits (1) - [`3449ca5`](https://github.com/ollama/ollama/commit/3449ca5ce87161a2c67a10ec700ed6653e9d4587) envconfig: added support for config.env file in ~/.ollama secondary to ENV variables. ### 📊 Changes **3 files changed** (+163 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/faq.md` (+6 -1) 📝 `envconfig/config.go` (+66 -1) 📝 `envconfig/config_test.go` (+91 -1) </details> ### 📄 Description This changes Ollama to support a config.env file located at `~/.ollama/config.env`. The change retains existing behavior. ENV variables will always take precedence; if the env variable is not set, it will attempt to use the value set in confg.env. PS - this is my first time touching Go. So, if there's some deviation from community standards, patterns, or conventions, apologies in advance. ... and sorry for the spastic extra pushes, after the PR was opened, i saw there was a mismatch in spaces vs tabs. So updated them to ensure it remains consistent. Fixes #10724 --- <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-16 06:41:01 -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#18616