[PR #9978] config: allow setting fixed context length #18382

Open
opened 2026-04-16 06:33:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9978
Author: @pppy2012
Created: 3/25/2025
Status: 🔄 Open

Base: mainHead: fixed-context-length


📝 Commits (1)

  • d394153 config: allow setting fixed context length

📊 Changes

5 files changed (+36 additions, -0 deletions)

View changed files

📝 api/types.go (+9 -0)
📝 docs/faq.md (+4 -0)
📝 envconfig/config.go (+3 -0)
📝 envconfig/config_test.go (+16 -0)
📝 server/routes.go (+4 -0)

📄 Description

Add OLLAMA_FIXED_CTX_LENGTH to eliminate the overhead of reloading the same model with different context lengths. This will override the context length obtained from the model or request settings. #9749


🔄 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/9978 **Author:** [@pppy2012](https://github.com/pppy2012) **Created:** 3/25/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fixed-context-length` --- ### 📝 Commits (1) - [`d394153`](https://github.com/ollama/ollama/commit/d39415373f27b0738be1dc14411e69a79ebfec01) config: allow setting fixed context length ### 📊 Changes **5 files changed** (+36 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+9 -0) 📝 `docs/faq.md` (+4 -0) 📝 `envconfig/config.go` (+3 -0) 📝 `envconfig/config_test.go` (+16 -0) 📝 `server/routes.go` (+4 -0) </details> ### 📄 Description Add `OLLAMA_FIXED_CTX_LENGTH` to eliminate the overhead of reloading the same model with different context lengths. This will override the context length obtained from the model or request settings. #9749 --- <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:33:30 -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#18382