llama.cpp model: contextWindow getting reset (to 128000) in models-store.json
Author: sa-mendezCreated Sep 26, 2026Updated Sep 28, 2026
Labelsbug
What happened?
Using pi with a model running locally on llama.cpp. I have the ctx-size in presets.ini set to 65536. When loading the model into pi, it sometimes has a contextWindow in models-store.json of 128000, not 65536.
Steps to reproduce
Launch llama-server: No models are currently loaded within it.
Check value in model-store.json:
❯ grep -A40 '"id": "qwen3.8-ud_q4_k_xl-64k-reasonlow-fit"' ~/.pi/agent/models-store.json | grep -m1 contextWindow
"contextWindow": 128000,- In another window launch pi. The model in the grep is my default model and it shows 128k context in pi
- Send a hi message within pi. Quit pi
- Launch pi again and quit (this causes the proper context value to be written 65536)
- Check value in model-store.json:
❯ grep -A40 '"id": "qwen3.8-ud_q4_k_xl-64k-reasonlow-fit"' ~/.pi/agent/models-store.json | grep -m1 contextWindow
"contextWindow": 65536,- Restart llama-server
- Launch pi again and quit (i think just launching pi rewrites the context here, note the model was not loaded).
- Check value in model-store.json:
❯ grep -A40 '"id": "qwen3.8-ud_q4_k_xl-64k-reasonlow-fit"' ~/.pi/agent/models-store.json | grep -m1 contextWindow "contextWindow": 128000,
Expected behavior
I do not expect the value to be overwritten to 128000, and it should remain at 65536.
Version
0.87.1
Source: earendil-works/pi