[GH-ISSUE #7806] Context length not being updated #30752

Closed
opened 2026-04-22 10:39:15 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @landoncrabtree on GitHub (Nov 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7806

What is the issue?

ollama show llama3.2

  Model
    architecture        llama
    parameters          3.2B
    context length      131072
    embedding length    3072
    quantization        Q4_K_M

  Parameters
    stop    "<|start_header_id|>"
    stop    "<|end_header_id|>"
    stop    "<|eot_id|>"

  License
    LLAMA 3.2 COMMUNITY LICENSE AGREEMENT
    Llama 3.2 Version Release Date: September 25, 2024

So from here, we can see context length 131072. However,

ollama run llama3.2 "Create study flashcards from this lecture transcription:\n\n $(cat samples/out.wav.txt )"

time=2024-11-22T21:35:01.163-06:00 level=WARN source=runner.go:122 msg="input exceeds context length" prompt=25109 limit=2048

Looks like the context length is being limited to 2048?

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

ollama version is 0.4.2

Originally created by @landoncrabtree on GitHub (Nov 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7806 ### What is the issue? ```bash ollama show llama3.2 Model architecture llama parameters 3.2B context length 131072 embedding length 3072 quantization Q4_K_M Parameters stop "<|start_header_id|>" stop "<|end_header_id|>" stop "<|eot_id|>" License LLAMA 3.2 COMMUNITY LICENSE AGREEMENT Llama 3.2 Version Release Date: September 25, 2024 ``` So from here, we can see `context length 131072`. However, ``` ollama run llama3.2 "Create study flashcards from this lecture transcription:\n\n $(cat samples/out.wav.txt )" time=2024-11-22T21:35:01.163-06:00 level=WARN source=runner.go:122 msg="input exceeds context length" prompt=25109 limit=2048 ``` Looks like the context length is being limited to 2048? ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version ollama version is 0.4.2
GiteaMirror added the bug label 2026-04-22 10:39:15 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 23, 2024):

The context window is not dynamic (yet), you need to set it if you want more than the default of 2048. https://github.com/ollama/ollama/issues/5965#issuecomment-2252354726

<!-- gh-comment-id:2495435519 --> @rick-github commented on GitHub (Nov 23, 2024): The context window is not dynamic ([yet](https://github.com/ollama/ollama/issues/1005)), you need to set it if you want more than the default of 2048. https://github.com/ollama/ollama/issues/5965#issuecomment-2252354726
Author
Owner

@landoncrabtree commented on GitHub (Nov 23, 2024):

The context window is not dynamic (yet), you need to set it if you want more than the default of 2048. #5965 (comment)

Thanks for this! Got it resolved via creating a modified model with the updated parameter. It'd be cool if parameters could be passed in the CLI, ie ollama run --parameter num_ctx=120000 ... but this was simple enough too!

<!-- gh-comment-id:2495546656 --> @landoncrabtree commented on GitHub (Nov 23, 2024): > The context window is not dynamic ([yet](https://github.com/ollama/ollama/issues/1005)), you need to set it if you want more than the default of 2048. [#5965 (comment)](https://github.com/ollama/ollama/issues/5965#issuecomment-2252354726) Thanks for this! Got it resolved via creating a modified model with the updated parameter. It'd be cool if parameters could be passed in the CLI, ie `ollama run --parameter num_ctx=120000 ...` but this was simple enough too!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#30752