[GH-ISSUE #15013] ollama launch claude - wrong model context window #9646

Closed
opened 2026-04-12 22:32:17 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @marcinkubica on GitHub (Mar 22, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15013

What is the issue?

Claude is not recognising model's context window

❯ ollama ps
NAME            ID              SIZE      PROCESSOR    CONTEXT    UNTIL
qwen3.5:0.8b    f3817196d142    2.8 GB    100% GPU     32768      4 minutes from now
 /context
  ⎿  Context Usage
     ⛀ ⛁ ⛁ ⛀ ⛀   qwen3.5:0.8b · 24k/200k tokens (12%)
     ⛀ ⛁ ⛁ ⛁ ⛁
     ⛶ ⛶ ⛶ ⛶ ⛶   Estimated usage by category
     ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 3.1k tokens (1.6%)
     ⛶ ⛝ ⛝ ⛝ ⛝   ⛁ System tools: 15.5k tokens (7.8%)
                 ⛁ MCP tools: 4.5k tokens (2.3%)
                 ⛁ Custom agents: 64 tokens (0.0%)
                 ⛁ Skills: 393 tokens (0.2%)
                 ⛁ Messages: 32.5k tokens (16.3%)
                 ⛶ Free space: 111k (55.4%)
                 ⛝ Autocompact buffer: 33k tokens (16.5%)

to reproduce

ollama launch claude --model qwen3.5:0.8b

and play for a bit to fill up the context window

Relevant log output

GIN] 2026/03/22 - 18:17:30 | 200 | 24.644508083s |       127.0.0.1 | POST     "/v1/messages?beta=true"
time=2026-03-22T18:17:43.929Z level=WARN source=runner.go:187 msg="truncating input prompt" limit=32768 prompt=55247 keep=4 new=32768

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

ollama version is 0.18.2

Originally created by @marcinkubica on GitHub (Mar 22, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15013 ### What is the issue? Claude is not recognising model's context window ``` ❯ ollama ps NAME ID SIZE PROCESSOR CONTEXT UNTIL qwen3.5:0.8b f3817196d142 2.8 GB 100% GPU 32768 4 minutes from now ``` ``` /context ⎿ Context Usage ⛀ ⛁ ⛁ ⛀ ⛀ qwen3.5:0.8b · 24k/200k tokens (12%) ⛀ ⛁ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ Estimated usage by category ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 3.1k tokens (1.6%) ⛶ ⛝ ⛝ ⛝ ⛝ ⛁ System tools: 15.5k tokens (7.8%) ⛁ MCP tools: 4.5k tokens (2.3%) ⛁ Custom agents: 64 tokens (0.0%) ⛁ Skills: 393 tokens (0.2%) ⛁ Messages: 32.5k tokens (16.3%) ⛶ Free space: 111k (55.4%) ⛝ Autocompact buffer: 33k tokens (16.5%) ``` to reproduce ``` ollama launch claude --model qwen3.5:0.8b ``` and play for a bit to fill up the context window ### Relevant log output ```shell GIN] 2026/03/22 - 18:17:30 | 200 | 24.644508083s | 127.0.0.1 | POST "/v1/messages?beta=true" time=2026-03-22T18:17:43.929Z level=WARN source=runner.go:187 msg="truncating input prompt" limit=32768 prompt=55247 keep=4 new=32768 ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version ollama version is 0.18.2
GiteaMirror added the bug label 2026-04-12 22:32:17 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 22, 2026):

Set OLLAMA_CONTEXT_LENGTH in the server environment.

<!-- gh-comment-id:4106799526 --> @rick-github commented on GitHub (Mar 22, 2026): Set [`OLLAMA_CONTEXT_LENGTH`](https://github.com/ollama/ollama/blob/main/docs/faq.mdx#how-can-i-specify-the-context-window-size) in the [server environment](https://github.com/ollama/ollama/blob/main/docs/faq.mdx#how-do-i-configure-ollama-server).
Author
Owner

@marcinkubica commented on GitHub (Mar 22, 2026):

@rick-github why not handle this automatically via ollama launch ?

Can Claude even take different context windows, or you mean user has to bump context window to 200k via mentioned env var?

<!-- gh-comment-id:4106802469 --> @marcinkubica commented on GitHub (Mar 22, 2026): @rick-github why not handle this automatically via `ollama launch` ? Can Claude even take different context windows, or you mean user has to bump context window to 200k via mentioned env var?
Author
Owner

@rick-github commented on GitHub (Mar 22, 2026):

The Anthropic API that Claude Code uses does not support setting the context size.

<!-- gh-comment-id:4106811705 --> @rick-github commented on GitHub (Mar 22, 2026): The Anthropic API that Claude Code uses does not support setting the context size.
Author
Owner

@marcinkubica commented on GitHub (Mar 22, 2026):

cheers @rick-github

<!-- gh-comment-id:4106827319 --> @marcinkubica commented on GitHub (Mar 22, 2026): cheers @rick-github
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9646