Running a local coding agent: Qwen3.8-27B + DFlash2 with KV cache reuse on Apple Silicon

fuzhongkai · reddit · 2026-11-11

A full walkthrough of wiring Pi Coding Agent to TensorSharp as a local inference backend: Qwen3.8-27B GGUF with a DFlash2 speculative drafter (7 draft tokens/step), 65,536 context, q80 KV cache on Apple Silicon Metal. Key trick: reusing the prompt KV cache across tool rounds instead of re-prefilling the whole conversation each time. Includes build commands, config overlay, and Pi models.json setup; documented on an M5 Pro with 48GB unified memory.

Related event: Pi Coding Agent Runs Fully Locally via TensorSharp and Qwen3.8-27B(3 posts)→

Original post →

More from coding & agent

coding & agent channel →