Give the local fallback a 128k window instead of 32k

The 26B models baked PARAMETER num_ctx 32768, and models.json mirrored
that as contextWindow, so pi capped every local session at 33k and
compacted there. The weights support 262144.

Measured with per-request num_ctx on yveltal (q4_0 KV, 31 GB RAM):
  12B  32k  -> 8.38 GB            , 413 tok/s prefill, 17-21 tok/s gen
  12B 128k  -> 8.96 GB, 100% VRAM , 337-356 tok/s    , 20 tok/s
  26B  32k  -> 15.12 GB, 80% VRAM , 413 tok/s
  26B 128k  -> 16.16 GB,  0% VRAM , a 14k-token prompt did not finish in 25 min
  26B 256k  -> 17.62 GB            , 1.5 tok/s gen

So widening the 26B pushes it off the GPUs entirely, while the 12B keeps
100% VRAM and full speed at 128k. Widening the window is therefore a
routing change, not a bigger-number change:

- new gemma4-12b-qat-128k (text) and the existing 12B vision model now run at
  131072 and are the long-context local path; it answered a needle test
  placed 14k tokens deep, through pi.
- pi-auto-models fallback moves from the 26B to gemma4-12b-qat-128k.
- the 26B text/vision stay at 32k (quality tier) with -128k variants left
  available in models.json but out of the cycle, since they run on CPU.
This commit is contained in:
Ziad Arafat committed 2026-11-25 14:55:24 -07:00
1 parent 76744c9596
commit 93e8119eb7
4 files changed
+42 -4

No files matched your search

+10 -1
View File
@@ -17,6 +17,15 @@
"text"
]
},
{
"id": "gemma4-12b-qat-128k",
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
"text"
]
},
{
"id": "gemma4-12b-qat-uncensored-64k",
"name": "Gemma 4 12B QAT Uncensored 64k",
@@ -41,7 +50,7 @@
},
{
"id": "gemma4-12b-qat-vision",
"contextWindow": 32768,
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
+2 -2
View File
@@ -6,7 +6,7 @@
},
"fallback": {
"provider": "ollama",
"model": "gemma4-26b-a4b-qat:latest",
"model": "gemma4-12b-qat-128k",
"thinking": "low"
}
}
}
+29 -1
View File
@@ -14,6 +14,15 @@
"text"
]
},
{
"id": "gemma4-12b-qat-128k",
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
"text"
]
},
{
"id": "gemma4-12b-qat-uncensored-64k:latest",
"contextWindow": 65536,
@@ -65,7 +74,26 @@
},
{
"id": "gemma4-12b-qat-vision:latest",
"contextWindow": 32768,
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
"text",
"image"
]
},
{
"id": "gemma4-26b-a4b-qat-128k",
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
"text"
]
},
{
"id": "gemma4-26b-a4b-qat-vision-128k",
"contextWindow": 131072,
"maxTokens": 8192,
"reasoning": true,
"input": [
+1
View File
@@ -21,6 +21,7 @@
"cohere/command-a-plus-05-2026",
"cohere/north-mini-code-1.0",
"ollama/gemma4-12b-qat-vision:latest",
"ollama/gemma4-12b-qat-128k",
"ollama/gemma4-26b-a4b-qat:latest",
"ollama/gemma4-12b-qat-uncensored-64k:latest"
]