feat(ollama): allow configurable context size via ZEROCLAW_OLLAMA_NUM_CTX#3518
Open
faustoheikkinen wants to merge 8 commits intozeroclaw-labs:masterfrom
Open
feat(ollama): allow configurable context size via ZEROCLAW_OLLAMA_NUM_CTX#3518faustoheikkinen wants to merge 8 commits intozeroclaw-labs:masterfrom
faustoheikkinen wants to merge 8 commits intozeroclaw-labs:masterfrom
Conversation
…e URL Supports container deployments where Ollama runs on a Docker network host (e.g. http://ollama:11434) without requiring config.toml changes. Includes regression test ensuring the environment override works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
Add support for configuring the Ollama context window via environment variable.
Environment variable:
ZEROCLAW_OLLAMA_NUM_CTX
If set, the value is forwarded to the Ollama
/api/chatrequest asoptions.num_ctx.Motivation
Ollama defaults to a 4096 context window when
num_ctxis not provided.This prevents full utilization of larger models on systems with sufficient VRAM.
This change allows deployments to configure larger contexts (e.g. 32k) without modifying source code.
Example
docker-compose:
environment:
ZEROCLAW_OLLAMA_NUM_CTX=32768
Result
Requests sent to Ollama include:
options:
num_ctx: 32768