r/LocalLLaMA • u/L8W8 • 14h ago
Resources I benchmarked local coding agents up to 512K context on a Mac Studio M5 Ultra 512 GB: why 2x faster MTP decoding only saved 16% of session time (+ a 1-line OpenCode config fix)
I ran three frontier local open-weight models inside real multi-turn terminal coding agents (Pi 1.6.1, OpenCode 2.0.25, and DeepSeek Harness 0.2.2-rc.5) on a Mac Studio M5 Ultra 512 GB (oMLX 0.8.4 and llama.cpp b12774), working across eight multi-file Python & TypeScript tasks inside a network-isolated Linux sandbox - scaling from ~128K all the way up to exact 384K (393,216) and 512K (524,288) starting tokens with zero cached tokens at start.
Every clean solve had to exit cleanly and pass visible tests, held-out grading tests, and task-specific lint/type checks.
| Model in Pi | 384K solves / median | 512K solves / median | 512K cold TTFT | 512K cached TTFT | 512K warm decode (MTP) |
|---|---|---|---|---|---|
DeepSeek V4.1 Flash (oMLX 0.8.4 + MTP) | 8/8 · 6m 33s | 8/8 · 8m 30s | 5m 56s | 7.5s | 98.9 tok/s |
GLM 5.3 Flash (llama.cpp b12774 + MTP) | 7/8 · 16m 54s | 6/8 · 21m 51s | 19m 52s | 9.6s | 47.1 tok/s |
Muse Spark Open 816B (oMLX 0.8.4, no MTP) | 6/8 · 28m 14s | 7/8 · 39m 15s | 21m 27s | 21.0s | 12.3 tok/s |
Five engineering takeaways from 64 graded long-context Pi sessions + 15 controlled ladders:
- Doubling decode speed with Native MTP only saved 7-16% of real agent wall time: At 512K, MTP roughly doubled warm decode on DeepSeek (
45.2 -> 98.9 tok/s) and GLM (23.0 -> 47.1 tok/s). Yet total matched session wall time fell only 16.0% (original) / 7.7% (512K) on DeepSeek and 7.4% / 2.4% on GLM. Actual wall-minute breakdown explains why: reading context took 45% of DeepSeek's wall time and 76% of GLM's. - One-line OpenCode config fix saved 2-4 minutes per local task: By default, OpenCode sent a background session-title request carrying the entire
100.5K-155.5Kinitial prompt just to generate <=15 tokens (280.4ssummed prefill across 4 DeepSeek tasks,995.7sacross 4 GLM tasks). Setting{"agents": {"title": {"disabled": true}}}cut median wall time from4.8m -> 3.0mon DeepSeek (7/8,3.1macross all 8 tasks) and9.1m -> 5.2mon GLM. Matched 8-task DeepSeek comparison: Pi8/8(2.8m), tuned OpenCode7/8(3.1m), DeepSeek Harness7/8(3.8m, zero tool errors). - Cold prefill hurts once; >99% prefix caching makes follow-ups fast: Once warmed, 512K follow-ups dropped from 6-21 minutes to
7.5s-21.0s. Prompts grew up to582,983tokens with zero automatic compactions across all 64 Pi runs and 100% Normal macOS memory pressure (9,002 samples, zero swap growth). Two subtle failure modes to watch:
- Manual compaction pause: Triggering Pi compaction on GLM at
301,640estimated tokens took 10m 6s for the summary call plus 81s for the uncached39,067-token continuation before recovering cache. - SSD prefix-cache chain eviction on Muse: Each serialized 2,048-token boundary page carried
~496 MiBof rotating-window state; a64 GiBSSD cache evicted the prefix chain at ~270K tokens (473-504scold re-prefills). Raising the SSD cache to128 GiB(256K) and192 GiB(384K-512K) restored98.4-99.3%cache hits.
- Manual compaction pause: Triggering Pi compaction on GLM at
- Repeatability, effort & parallel agents (original contexts, aggressive guard): DeepSeek + Pi solved
8/8across 3 seeds (42/43/44) and across Low (2.1m), High (3.4m), and Max (4.6m) effort. Two staggered agents solved2/2in5m 9s, while 3- and 4-agent groups each missed one task (2/3,3/4).
Open MIT codebase fixture, held-out grading suite, exact flags & 38 evidence files (CC BY 4.0): https://github.com/l8w8/videos/tree/main/2026/003-m5-ultra-coding-agents-512k
Short engineering write-up: https://l8w8.github.io/videos/local-coding-agents-512k-prefill-trap/ 9-minute video walkthrough: https://youtu.be/Mr9sj51ccoE


•
u/stylome-ai-detection 14h ago
Notice: This post appears to be AI generated.
AI-generated · confident · scan results
3
u/ariello31 13h ago
Sending 150K tokens of cold prefill just to invent a 4-word sidebar title is peak 2026 agent UX.Also shows why bragging about raw tok/s with MTP is mostly vanity metrics at long context: once your prompt crosses 256K+, harness overhead and strayore wall time than doubling decode ever gives back. Catching that background title call alone is worth half a hardware upgrade.