Replies: 1 comment 1 reply
|
This is an issue with your ollama configuration. You can either: Use OLLAMA_CONTEXT_LENGTH (in the systemd service config file) to increase the default context length for ollama OR Make a Modelfile for your intended model and set The endpoint still isn't going to send the correct context length to pi (in my experience at least) so you''ll also need to also either create a ~/.pi/agent/models.json file or using pi's new dynamic provider registration. https://pi.dev/docs/latest/models I use the Modelfile method with dynamic registration. store the modelfiles with this format: ~/models/qwen3.6:35b-128k/Modelfile . Then I just had my agent use the dynamic registration to make an extension that uses the endpoint and the models folder to set the appropriate context lengths at startup |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When using local Ollama models in Pi Coding, the UI correctly displays the model's advertised context length (for example, Qwen 3.6 shows 262,144 tokens), but the actual runtime context appears to remain at Ollama's default value of 4096 tokens.
This can be misleading because users may believe they are working with the full context window while generation is actually truncated much earlier.
Reproduction
Model:
Pi Coding displays:
However during generation:
shows:
Ollama logs also show:
indicating that the request hit the runtime context limit.
Expected Behavior
One of the following:
num_ctxto the model's supported context length (or a configurable value).Why This Matters
Large-context models such as Qwen 3.6 advertise 262K context windows. Users reasonably expect Pi Coding to take advantage of this capability when running locally through Ollama.
Currently, conversations may be truncated around 4096 tokens without any obvious indication that the runtime context differs from the model's advertised capacity.
All reactions