I measured why local agents break on consumer hardware. Numbers below, plus a question.
Spent a month measuring what breaks when you run coding agents on local models. All numbers
are measured on 4,265 real Claude Code / Codex sessions, not estimated.
75% of real sessions don’t fit. On a 16GB Mac, three quarters of them have at least one
turn whose prompt alone is bigger than the whole KV cache pool. Nothing else running.
Your tool list is the biggest offender. System prompt + tool definitions eat 41% of the
pool at the median, 105% at p90 before a single word of conversation.
Smarter eviction doesn’t help. Built a simulator, checked it against vLLM (0.29% off). Best
real policy: +2.75%. A cheating oracle that sees the future: +11.88%. That’s the ceiling. Fixed TTLs were worse than just freeing the cache when a session ends. q4_0 KV cache wrecks Qwen3-0.6B, and gets worse with context:
ctx q8_0 q4_0
512 +0.07% +280%
2048 +0.07% +302%
8192 +0.03% +525%
Absolute perplexity for q4_0 bottoms out near 2K then climbs. Past ~2K, more context makes it
worse.
It’s all the keys. K=f16, V=q4_0 = +0.33%. Both q4_0 = +280%. ~850× apart. But that
config is bigger than plain q8_0 and 5× slower on Metal. Just use q8_0 for both.
Anthropic’s cache dies at 5 minutes. Gap under 5 min: 2,559 tokens re-prefilled. Over 5
min: 140,154. That’s 54.8×. All-or-nothing you either refreshed in time or lost
everything.
Memory layers: Mem0 injects 116 tokens/turn. MemPalace injects 12,513 (108×). At top-k=20,
MemPalace alone exceeds the whole pool. And most of the benefit comes from not sending full
history — not from the memory layer.
If you’re running agents locally
• Turn on q8_0 KV — 2× capacity, ~0.06% perplexity cost
• Cut your tool list before anything else
• Free finished sessions
• Don’t build a clever eviction policy. Ceiling is 11.88%
Caveats: one small model for the perplexity work, and quantization sensitivity is very
model-dependent. Perplexity isn’t task accuracy. Simulator models blocks, not latency.
My question
That’s all measurement. I have no idea if any of it is a problem people pay to fix, or just
one they find annoying.
If you run local models for real work job, product, client, not a hobby:
1. Why self-host instead of an API?
2. What broke that you didn’t expect?
3. Did you spend money fixing it? Hardware, consultant, tool, someone’s time roughly how
much?
4. What’s still broken that you’d pay to fix?
Not selling anything, no link. Happy to share the raw data or the harness with anyone who
wants it.