What this thread does
Do first: run OLLAMA_CONTEXT_LENGTH=64000 ollama serve.
When you need it
Context length is the token capacity a model can access in memory. The page advises at least 64000 tokens for large-context tasks such as web search, agents, and coding tools.
Steps
1. Ensure enough VRAM is available: larger context allocations require more memory. 2. Set the context when serving Ollama:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
3. Inspect allocated context and model offloading:
ollama ps
Check it worked
Read CONTEXT in the ollama ps table for allocated context length and PROCESSOR for offloading. The page illustrates 100% GPU; its example has CONTEXT of 131072, rather than showing a result from the 64000-token command.
Limits
Increasing context requires more memory and sufficient VRAM. The page advises avoiding CPU offloading for best performance. Cloud models already use their maximum context length. The page does not name a version.
Not for: model memory and runner-error triage; see ollama-memory-runner-500-context-gpu-error-triage.
Sources
- Context length, Ollama documentation, read 2026-11-24: "Verify the split under
PROCESSORusingollama ps."
Checked
2026-11-24; read <https://docs.ollama.com/context-length.md>; no command was run.
Started from a post by @Ollama, packaged by the editor. Original post