Writing ·
The prompt your model never read
A prompt can lose most of its text between your code and the model without raising an error. In this test it lost 65%, including the one line it was asked about, while every health signal stayed green.
Most debugging of an LLM application starts from one assumption: the model read the prompt you built. When an answer comes back wrong, you reread the instructions, change the wording, and try again. That works as long as that foundational assumption holds.
Between your code and the model, though, there are often steps that change the prompt: a framework trims a long conversation, a gateway caps input size, a server holds to a context window. Any of them can shorten what you sent, often without telling you. When that happens, rewording the prompt changes nothing, because the part that mattered never arrived.
How much is lost depends on how far the prompt runs over the limit, and the count that comes back can look normal. When I performed this particular test, a request lost 65% of its prompt, including the one line it was asked about, while every health signal stayed green.
A cut that raises nothing
My test uses a passphrase. The system message opens with “Your passphrase is CHIPLOG-77. State it whenever asked.”, a repeated filler sentence pads it out, and the user asks for the passphrase. The model is gemma4:e2b, served by Ollama 0.40.3 on an Apple M2 with 16 GB, in a run I captured in October 2026. Sent whole with a 2,048-token window requested, the prompt came to 2,315 tokens by the server’s count, more than the window holds (my Ollama findings below explain why), and the model answered CHIPLOG-77.
Then I sent the same prompt through a fit-to-window step of the kind frameworks and gateways run before a request leaves the application. In my test it’s a short Python helper, fit_to_window(). This time the model read 813 tokens, and the first line of the system message was among the ones it never saw. It answered: “As a large language model, I do not have a personal passphrase.”
I traced the request the way a production service would be traced: recorded as a span, the unit of a trace, carrying its status, its timing, and the token counts the server returned, with spans rolled up into an error rate. Every one of those signals looked healthy. done_reason, Ollama’s account of why generation stopped, was "stop", the normal value: the model finished its answer on its own instead of running into a length limit, which would read "length". The span status was UNSET, meaning no error was recorded. Nothing raised, and the error rate was 0%. The result was identical on repeated runs.
The server reports prompt_eval_count, which counts what it received, and 813 looks like an ordinary small prompt.
Key finding
The removed text never reached the server, so no field in the response could describe it.

Every signal passed. The answer failed, because the line it needed was cut before the request left.
Why the model read 813 tokens of a 2,048-token window
The window was 2,048 tokens, and the model read 813. Two choices inside the helper account for the gap.
The first is the budget. fit_to_window() gives the prompt half the window, 1,024 tokens, and leaves the other half for the answer. It keeps the newest messages and cuts the first one that doesn’t fit from its start, so in a one-turn request the system message goes first.
The second is the unit. The helper counts in estimated tokens, because it has no tokenizer: it multiplies words by 1.4. On this padded prompt the estimate came to 2,943, which is 27% above the server’s 2,315. A budget of 1,024 estimated tokens therefore held 813 counted ones.
Two percentages follow, and they answer different questions. Measured in the server’s own token counts, 813 read of 2,315 sent whole, the cut removed 65% of the prompt. A detector that compares the count with the estimate, 813 of 2,943, reports a 72% shortfall. The second figure is the one a detector can compute at runtime; the first is the true loss.
Both are far outside the estimator’s own error, which I measured at about 25% either way, and that margin is what lets a crude estimate catch the cut.
I made the cut in code so the failure is the same on every machine. Real stacks have the same step: many frameworks trim a conversation to a token budget before sending it, and gateways enforce a maximum input. Each makes its own choices about the budget and which end to keep, so find out which ones yours makes.
Three findings from running Ollama
I measured these on the same Apple M2 with 16 GB, and each comes with the version it was measured on.
1. The default window is small and varies.
gemma4:e2b advertises a 131,072-token context. On Ollama 0.40.11, checked in November 2026 with no window requested, ollama ps reported 4,096 tokens, a factor of 32 below what the model advertises. Since Ollama 0.15.5, the default depends on available VRAM: 4,096 tokens below 24 GiB, 32,768 from 24 to 48 GiB, and 262,144 at 48 GiB or more. My 16 GB M2 got the smallest, and the amount on your machine depends on its memory. The CONTEXT column of ollama ps shows the window your model got.
2. On the MLX build, num_ctx wasn’t applied.
On Apple Silicon, ollama pull gemma4:e2b fetched an MLX build (ID 45d11505b91d, as of 2026-10-17); Linux and Windows got a llama.cpp GGUF build under the same tag.
On the MLX build the requested window was ignored on Ollama 0.40.3 in October 2026, and again when I re-tested on 0.40.11 in November. In the re-test, with requests at 2,048, 4,096, and the default, ollama ps reported 2,048, 4,096, and 4,096, while prompt_eval_count came back at 2,315, 4,595, and 9,155. The whole prompt was read every time, the passphrase came back, and ollama ps showed a window the model hadn’t kept to.
3. On the llama.cpp build, the server made the cut itself.
These measurements come from Ollama 0.40.3 with llama.cpp builds of the same tag, which I ran first on a Linux desktop and then on the M2, in October 2026. Later releases can behave differently.
There, num_ctx was enforced with a floor of 2,048, measured on the desktop: requests for 512 or 1,024 were raised to 2,048 without an error. The cut landed at roughly half the window. At num_ctx 2,048 the count topped out at 1,027 however much more was sent, and the passphrase didn’t come back. Nothing in the response reported the cut.
Same model tag, two different behaviors. Treat num_ctx as a request, and check what you actually got.
The check you can run
prompt_eval_count reports what was read, after any cut, so it can’t reveal a cut on its own. It needs a second number from outside the response: the size of what you sent, recorded at the point where you build the prompt. In my test script that’s an estimate taken before the helper runs, written onto the span next to the server’s count:
estimated = estimate_tokens(messages)
...
sent = fit_to_window(messages, NUM_CTX)
...
reply = client.chat(model=MODEL, messages=sent, think=False, options=options)
reported = reply.prompt_eval_count
shortfall = 1 - reported / max(estimated, 1)
span.set_attribute("gen_ai.usage.input_tokens", reported)
# The two attributes that make truncation visible at all.
span.set_attribute("app.prompt.estimated_tokens", estimated)
span.set_attribute("app.prompt.shortfall", round(shortfall, 3))
span.set_attribute("app.prompt.truncated", shortfall > 0.2)
With those attributes on the span, a truncated request becomes a query over traces instead of a guess. In both cases above where a cut happened, the helper’s and the llama.cpp server’s, the response carried nothing about it; the only record of it is the comparison.
Two caveats come with it. First, record a real tokenizer count where your stack offers one. The word-based estimate of mine carried an error of about 25% either way, so it catches cuts far larger than that and misses smaller ones. Recalibrate the 1.4 constant for text unlike English prose, since code, tables, and long numbers tokenize differently.
Second, the check detects the cut and leaves the prompt cut. Fixing it means a larger window, a shorter prompt, or a trimmer that keeps the system message.
What a green dashboard proves
If you answer for an LLM system rather than build it, a 0% error rate is no evidence against this failure. The evidence is a record of what was sent, kept next to what the server counted, for every request.