Running the Pi coding agent fully local: TensorSharp + Qwen3.8-27B on a MacBook
fuzhongkai · reddit · 2026-11-11
The TensorSharp author published a reproducible end-to-end setup: a .NET open-source LLM inference engine driving the Pi terminal coding agent, fully local with no hosted API.
Setup
- Agent: Pi 1.5.1 (owns file ops, shell commands, tools, agent loop); TensorSharp only serves inference via an OpenAI-compatible API
- Model: Qwen3.8-27B (UD-IQ3XS GGUF), 12 GB total with the DFlash2 draft model
- Hardware: MacBook Pro M5 Pro 48GB; works on Apple Silicon with ≥32GB unified memory
- Key params: DFlash2 speculative decoding (7 draft tokens/step), q80 KV cache, 65,536 context, 16,384 max output
Lessons learned
- Pi's system prompt and tool definitions alone consume 4K tokens; small context windows vanish fast
- Raise the output limit from 1,024 to 16,384 or thinking models run out mid-task
- Disable the vision projector for text-only use; no API-key auth, so localhost only
Full scripts and configs are open-sourced in examples/pi-coding-agent on GitHub.
Related event: TensorSharp powers Pi coding agent fully on-device(5 posts)→
More from coding & agent
- Agent builder: match the lab's harness for the core loop, own everything else — pvncher · 2026-11-23
- Browser-Based 3D Tracker Uses Pure Math to Track All 12,500+ Live Satellites in Real Time — DynamicWebPaige · 2026-11-23
- Live whiteboarding with agents: dev replaces always-on agents with daily check-ins — max__drake · 2026-11-23
- Dev open-sources 3 local extensions to fix Copilot Chat's context bloat and credit burn — ShunsukeF · 2026-11-23
- Japanese Dev Catalogs the 5 Telltale Signs of 'AI-Smell' UI From Daily Base44 Use — 4310sy · 2026-11-23
- DIY monitoring screen shows DGX Spark temps, load and live agent switching — dee_hw · 2026-11-23