Prefixwise
Prefixwise names why each LLM request missed the prompt cache. It sits between the agent and the model (a proxy, a one-flag vLLM middleware, or an SDK wrapper), fingerprints each request block by block, and compares it with the previous turn of the same conversation; each miss gets one of 17 causes, the first block that changed, and the cost. On vLLM and SGLang it also reads the engine's KV-cache events so an eviction is confirmed rather than guessed, and it stores hashes and token counts, never prompt text.
What it addresses
Prompt caching is where most of an agent's token bill is won or lost, and providers only tell you how many tokens were cached, never why the rest weren't; if one byte near the top of the resent conversation changes, everything after it is billed at full price again, and the common causes (a tool list built from a set, a date in the system prompt, a missing cache_control marker) are invisible.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
Prefixwise
Prefixwise names why each LLM request missed the prompt cache. It sits between the agent and the model (a proxy, a one-flag vLLM middleware, or an SDK wrapper), fingerprints each request block by block, and compares it with the previous turn of the same conversation; each miss gets one of 17 causes, the first block that changed, and the cost. On vLLM and SGLang it also reads the engine's KV-cache events so an eviction is confirmed rather than guessed, and it stores hashes and token counts, never prompt text.
Problem: Prompt caching is where most of an agent's token bill is won or lost, and providers only tell you how many tokens were cached, never why the rest weren't; if one byte near the top of the resent conversation changes, everything after it is billed at full price again, and the common causes (a tool list built from a set, a date in the system prompt, a missing cache_control marker) are invisible.
Audience: People running agents in production
Posted by @tchavali · Original source ↗
Story title · @tchavali · · Source ↗
Show HN: Prefixwise – names why each LLM request missed the prompt cache
Submitted URL · @tchavali · · Source ↗
https://github.com/tejachavali/prefixwise
Source text · @tchavali · · Source ↗
How it works: it sits between the agent and the model (a proxy, a one-flag vLLM middleware, or an SDK wrapper), fingerprints each request block by block, and compares it with the previous turn of the same conversation. Each miss gets one of 17 causes, the first block that changed, and the cost. It stores hashes and token counts, never prompt text.
Source text · @tchavali · · Source ↗
I built Prefixwise because prompt caching is where most of an agent's token bill is won or lost, and the providers only tell you how many tokens were cached, never why the rest weren't.
Source text · @tchavali · · Source ↗
If one byte near the top changes (tools serialized in another order, a timestamp in the system prompt, an earlier message rewritten), everything after it is billed at full price again. In my own runs the common causes were boring and invisible: a tool list built from a set, a date in the system prompt, a missing cache_control marker.
Source text · @tchavali · · Source ↗
I'd most like to hear from people running agents in production: what cache problems do you hit that this wouldn't catch?
Source text · @tchavali · · Source ↗
On vLLM and SGLang it also reads the engine's KV-cache events, so an eviction is confirmed rather than guessed.