[PR #4154] [MERGED] Centralize server config handling #11402

Closed
opened 2026-04-12 23:29:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4154
Author: @dhiltgen
Created: 5/4/2024
Status: Merged
Merged: 5/6/2024
Merged by: @dhiltgen

Base: mainHead: central_config


📝 Commits (1)

  • f56aa20 Centralize server config handling

📊 Changes

12 files changed (+235 additions, -162 deletions)

View changed files

📝 app/lifecycle/logging.go (+3 -1)
📝 app/lifecycle/updater_windows.go (+1 -4)
📝 gpu/assets.go (+5 -40)
📝 gpu/gpu.go (+2 -1)
📝 llm/memory.go (+3 -11)
📝 llm/server.go (+5 -12)
server/envconfig/config.go (+174 -0)
server/envconfig/config_test.go (+20 -0)
📝 server/images.go (+3 -2)
📝 server/routes.go (+5 -21)
📝 server/sched.go (+10 -43)
📝 server/sched_test.go (+4 -27)

📄 Description

This moves all the env var reading into one central module and logs the loaded config once at startup which should help in troubleshooting user server logs

Example server output

% ollama serve 2>&1 | head -1
2024/05/05 14:56:27 routes.go:989: INFO server config env="map[OLLAMA_DEBUG:false OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:1 OLLAMA_MAX_VRAM:0 OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:*] OLLAMA_RUNNERS_DIR: OLLAMA_TMPDIR:]"

🔄 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/4154 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 5/4/2024 **Status:** ✅ Merged **Merged:** 5/6/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `central_config` --- ### 📝 Commits (1) - [`f56aa20`](https://github.com/ollama/ollama/commit/f56aa20014efeb383af5380d3de35475d1f08c36) Centralize server config handling ### 📊 Changes **12 files changed** (+235 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `app/lifecycle/logging.go` (+3 -1) 📝 `app/lifecycle/updater_windows.go` (+1 -4) 📝 `gpu/assets.go` (+5 -40) 📝 `gpu/gpu.go` (+2 -1) 📝 `llm/memory.go` (+3 -11) 📝 `llm/server.go` (+5 -12) ➕ `server/envconfig/config.go` (+174 -0) ➕ `server/envconfig/config_test.go` (+20 -0) 📝 `server/images.go` (+3 -2) 📝 `server/routes.go` (+5 -21) 📝 `server/sched.go` (+10 -43) 📝 `server/sched_test.go` (+4 -27) </details> ### 📄 Description This moves all the env var reading into one central module and logs the loaded config once at startup which should help in troubleshooting user server logs Example server output ``` % ollama serve 2>&1 | head -1 2024/05/05 14:56:27 routes.go:989: INFO server config env="map[OLLAMA_DEBUG:false OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:1 OLLAMA_MAX_VRAM:0 OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:*] OLLAMA_RUNNERS_DIR: OLLAMA_TMPDIR:]" ``` --- <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-12 23:29:28 -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#11402