Skip to content

Kingy / AI Fix Finder

← All fixes

llama.cpp rejects a prompt that exceeds its allocated context

A 518-token prompt failed in a 512-token allocation. A 2,048-token allocation preserved the entire source and restored the three tested facts.

kingy tested

What happened

Symptom

HTTP 400: request (518 tokens) exceeds the available context size (512 tokens), try increasing it.

Conditions

Qualified October 15, 2026 on llama.cpp 0.6.0 build 11429 (d81235049384534c167caea52b85a694f6103d14), Qwen3-4B Q4_K_M.

macOS 26.3 build 25D125, Apple M4 Pro / Mac16,7, 24 GiB unified memory; CPU-only inference.

Separate-agent rerun from a fresh extraction and fresh server processes on the same physical Mac.

Correction

For this frozen task, change --ctx-size 512 to --ctx-size 2048. Preserve the entire prompt and allow for its output-token reserve; do not silently truncate or summarize the source.

Result

Both executors recorded 0/3 baseline passes, 3/3 corrected passes and 0/1 reverted passes. All corrected responses used the unchanged 518-token prompt, returned all three exact facts and reported zero cached tokens.

What did not work

Every baseline and reverted request produced the same identified HTTP 400 context-overflow error.

  1. Retain the complete source document and the original overflow response. Count the rendered chat-template tokens, not only the visible document text.
  2. In this test the rendered input is 518 tokens and the output reserve is 128, for a combined 646 tokens. The corrected tested allocation is 2,048.
  3. Change only --ctx-size 512 to --ctx-size 2048, keeping the original prompt bytes and model settings.
  4. Check the start, middle and end values: ALPHA-17, BRAVO-42 and CHARLIE-93. Reject missing, extra or incorrect fields.
  5. Download the exact runner and retained receipts. Use its offline audit to inspect evidence without a model run.
Sources & limits

Repair 002: full qualification report and limits

Download repair 002 evidence ZIP (114,231 bytes; SHA-256 b57cd227a27d4fb92d9ae88de7f4a9591c3a3bb0dac4a6eae148395597e9e57a)

Record checked 2026-10-15.

Same-host separate-agent reproduction, not independent human testing or a second-machine result.

These fixed synthetic tasks and repeated settings do not establish a general reliability rate, other-model behavior or minimum hardware requirements.

Original failures, failed correction proposals, prompts, outputs, settings and checksums remain in the evidence package. Model weights and runtime executables are not included.

Qualification ran October 15, 2026. Publication does not make this a test of later software or model revisions.

A 2,048-token context is a tested allocation for this small task, not a universal recommendation or a measured minimum. Larger allocations require sufficient memory.

This still happens?

Send the smallest example that reproduces it. Use a public, non-sensitive example; leave out account details, keys and private files.

Help improve this tool

Did this help you finish?

About AI Fix Finder. Your feedback goes to Kingy’s private review queue.

Your experience with AI Fix Finder
What happened?