#10077·pi

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

  1. Launch llama-server: No models are currently loaded within it.

  2. 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,
  1. In another window launch pi. The model in the grep is my default model and it shows 128k context in pi
  2. Send a hi message within pi. Quit pi
  3. Launch pi again and quit (this causes the proper context value to be written 65536)
  4. 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,
  1. Restart llama-server
  2. Launch pi again and quit (i think just launching pi rewrites the context here, note the model was not loaded).
  3. 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