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.
More from coding & agent
- Hermes in 7 Days: a 7-part agent tutorial series launching Day 1 — Teknium · 2026-12-06
- Codex for Reviews and High-Logic Tasks, Gemini Resets Make It Best-Value Subscription — strickvl · 2026-12-06
- dearkarl: a read-only MCP server that feeds Claude only the emails you forward — Fit-Stranger1738 · 2026-12-06
- How to install the Scientific Literature customization in Google Antigravity — JeremyNguyenPhD · 2026-12-06
- Google Antigravity adds Citation Checker and Dataset Curator skills for academic research — JeremyNguyenPhD · 2026-12-06
- Multi-agent blind code review tool using 4 models from different providers, ~$2 per review — Mysterious-Desk-3492 · 2026-12-06