[GH-ISSUE #993] [Issue]: b9222 llama.cpp build ignores --ctx-size — all models clamped to 4096 regardless of flags #482

Closed
opened 2026-10-20 17:29:19 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @halleh1318 on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/993

Originally assigned to: @cha1latte on GitHub.

Title: b9222 llama.cpp build ignores --ctx-size — all models clamped to 4096 regardless of flags
Build: b9222-win-x64-cuda (bundled with Marinara Engine)
GPU: NVIDIA GeForce RTX 2070 SUPER (8GB VRAM)
CPU: AMD Ryzen 5 3600X
Date: 19 May 2026
Summary:
The sidecar runtime's llama-server.exe consistently clamps every model to n_ctx=4096, completely ignoring --ctx-size 8192 and all rope scaling flags. This causes OpenAI API error 400: request exceeds the available context size (4096 tokens) on any agent request over 4k tokens — which is basically all tracker agent batches.
Models tested (all exhibit identical behavior):

  1. gemma-4-E2B-it-Q8_0.gguf → slots initialized at n_ctx = 4096
  2. gemma-4-E2B-it-Q4_K_M.gguf → same clamp
  3. Llama-3.2-3B-Instruct-Q8_0.gguf → same clamp
    Relevant server log for every model:
W llama_context: n_ctx_seq (4096) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
I slot load_model: id 0 | task -1 | new slot, n_ctx = 4096
I slot load_model: id 1 | task -1 | new slot, n_ctx = 4096

Attempted fixes (none worked):

  • --ctx-size 8192 in launch command — ignored
  • --rope-scaling yarn appended to launch — ignored
  • --rope-scaling linear — ignored
  • Switched between three different model quants from different families (Gemma, Llama) — all clamped identically
  • Marinara config contextSize set to 8192 on both connection and sidecar config — confirmed correct
  • Full server restart between every change — confirmed
    Expected behavior:
    --ctx-size 8192 should result in slots with n_ctx = 8192, allowing agent requests up to ~8k tokens without rejection.
    Actual behavior:
    All slots hard-clamped to n_ctx = 4096. Any request exceeding 4096 tokens is immediately rejected with error 400.
    Impact:
    Tracker agents (World State, Character Tracker, Persona Stats, Quest, etc.) cannot function with the local sidecar model. This forces users to either burn main model tokens on tracker work or abandon local inference entirely. Currently a blocker for the "use local model for all tracker agents" feature.
Originally created by @halleh1318 on GitHub (May 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/993 Originally assigned to: @cha1latte on GitHub. **Title:** b9222 llama.cpp build ignores `--ctx-size` — all models clamped to 4096 regardless of flags **Build:** `b9222-win-x64-cuda` (bundled with Marinara Engine) **GPU:** NVIDIA GeForce RTX 2070 SUPER (8GB VRAM) **CPU:** AMD Ryzen 5 3600X **Date:** 19 May 2026 **Summary:** The sidecar runtime's llama-server.exe consistently clamps every model to `n_ctx=4096`, completely ignoring `--ctx-size 8192` and all rope scaling flags. This causes `OpenAI API error 400: request exceeds the available context size (4096 tokens)` on any agent request over 4k tokens — which is basically all tracker agent batches. **Models tested (all exhibit identical behavior):** 1. `gemma-4-E2B-it-Q8_0.gguf` → slots initialized at `n_ctx = 4096` 2. `gemma-4-E2B-it-Q4_K_M.gguf` → same clamp 3. `Llama-3.2-3B-Instruct-Q8_0.gguf` → same clamp **Relevant server log for every model:** ``` W llama_context: n_ctx_seq (4096) < n_ctx_train (131072) -- the full capacity of the model will not be utilized I slot load_model: id 0 | task -1 | new slot, n_ctx = 4096 I slot load_model: id 1 | task -1 | new slot, n_ctx = 4096 ``` **Attempted fixes (none worked):** - `--ctx-size 8192` in launch command — ignored - `--rope-scaling yarn` appended to launch — ignored - `--rope-scaling linear` — ignored - Switched between three different model quants from different families (Gemma, Llama) — all clamped identically - Marinara config `contextSize` set to 8192 on both connection and sidecar config — confirmed correct - Full server restart between every change — confirmed **Expected behavior:** `--ctx-size 8192` should result in slots with `n_ctx = 8192`, allowing agent requests up to ~8k tokens without rejection. **Actual behavior:** All slots hard-clamped to `n_ctx = 4096`. Any request exceeding 4096 tokens is immediately rejected with error 400. **Impact:** Tracker agents (World State, Character Tracker, Persona Stats, Quest, etc.) cannot function with the local sidecar model. This forces users to either burn main model tokens on tracker work or abandon local inference entirely. Currently a blocker for the "use local model for all tracker agents" feature.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#482
No description provided.