Line-by-line audit of 5 open-source AI apps finds prompt-caching leaks in all of them

florijanl · reddit · 2026-12-06

The author spent ten days reading the LLM code of five popular open-source AI apps line by line, hunting for tokens paid for twice — all five had a prompt-caching problem, four the same one. OpenAI and Gemini cache repeated prompt prefixes automatically, but Claude requires explicit cachecontrol (or cachePoint on Bedrock); without it, bills silently run 2-3x.

Findings: GPT Researcher (two near-identical prompts never hit cache), browser-use (no caching via OpenRouter/Bedrock, fixed in PR #6546), mem0 (same 8,400-token prompt re-billed on every save, issue #8071), nanobot (fixed, PR #6904), Atomic Chat (issue #463).

Six recurring leaks: caching works on only one route; timestamps/request IDs at the top of system prompts break every hit; unbounded chat history; frontier models doing easy classification; no output caps (output costs 5x input); per-item loops instead of batch jobs.

The author also released a free MIT-licensed Agent Skill that audits your project's LLM costs and ranks fixes by dollars saved. Example fix: restoring 85% cache hits on a Claude Sonnet 5.5 coding agent cuts the monthly bill from $120 to $39. Disclosure: the author runs lesspertoken.com and earns referral rewards from one gateway.

Original post →

More from coding & agent

coding & agent channel →