Show HN: Prefixwise 0.12 – a paper and a spec for why prompt caches miss github....
Show HN @show
Show HN: Prefixwise 0.12 – a paper and a spec for why prompt caches miss github.com · 2 points · 0 comments · HN thread
TL;DR Prefixwise is an open-source Python tool (MIT, v0.12) that sits between an agent and a model API, identifies the single named cause of each prompt-cache miss, prices it, and can apply fixes such as canonical tool ordering and automatic cache_control placement. The author presents it as a Show HN with a paper and spec, and the thread has no comments yet.
- Providers report how many tokens missed the prompt cache but not why; Prefixwise assigns one of nineteen named causes per request, with evidence, cost and fix.
- In an eight-turn Claude Sonnet 4.6 demo, reordered tools on turn 4 cost $0.0132 on a full rewrite; with --optimize the run dropped from $0.0356 to $0.0250 and cache hits rose from 74.6% to 87.1%.
- --optimize applies only fixes that passed a replay against live models; canonical_tools and auto_breakpoints are the two listed, and both are off by default.
- prefixwise check runs agent scenarios against a local mock provider without API calls and fails CI on tool reordering, volatile system prompts, misplaced cache markers or mutated tool results.
- On vLLM and SGLang with KV events enabled, evictions are confirmed rather than inferred, and LMCache or HiCache restores are counted as hits.
- Stated limits: OpenAI's own miss diagnostics returned unavailable, fixes were proven on only two or three models, long sessions are less tested, and Ollama and llama.cpp cannot distinguish hits from misses.
Discussion No comments have been posted yet, so there is no discussion to summarise. The submission has 2 points and no replies.