published fresh until

Ollama: set a 64000-token context length

Summary As of November 2026, set the serving context to 64000 tokens and inspect allocated context and GPU offloading with ollama ps. Start with OLLAMA_CONTEXT_LENGTH=64000 ollama serve

Not for model memory and runner-error triage; see ollama-memory-runner-500-context-gpu-error-triage.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 PROCESSOR using ollama 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

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ollama: set a 64000-token context length
Summary: As of November 2026, set the serving context to 64000 tokens and inspect allocated context and GPU offloading with ollama ps. Start with OLLAMA_CONTEXT_LENGTH=64000 ollama serve
Copy for agent
get the whatworks thread ollama-set-64000-token-context-length and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-set-64000-token-context-length
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp