From 93e8119eb7a2b58ed3eb9491c59a4b43b5ebdbf8 Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Wed, 25 Nov 2026 14:55:24 -0700 Subject: [PATCH] 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. --- config/free-pi/models.json | 11 ++++++++++- config/pi/auto-model.json | 4 ++-- config/pi/models.json | 30 +++++++++++++++++++++++++++++- config/pi/settings.json | 1 + 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/config/free-pi/models.json b/config/free-pi/models.json index b016d91..dae5c6e 100644 --- a/config/free-pi/models.json +++ b/config/free-pi/models.json @@ -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": [ diff --git a/config/pi/auto-model.json b/config/pi/auto-model.json index 4097d5f..0a18a72 100644 --- a/config/pi/auto-model.json +++ b/config/pi/auto-model.json @@ -6,7 +6,7 @@ }, "fallback": { "provider": "ollama", - "model": "gemma4-26b-a4b-qat:latest", + "model": "gemma4-12b-qat-128k", "thinking": "low" } -} \ No newline at end of file +} diff --git a/config/pi/models.json b/config/pi/models.json index 0dff70e..ff0c1ed 100644 --- a/config/pi/models.json +++ b/config/pi/models.json @@ -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": [ diff --git a/config/pi/settings.json b/config/pi/settings.json index e060c02..11902da 100644 --- a/config/pi/settings.json +++ b/config/pi/settings.json @@ -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" ]