kapitsa: hand-written Metal inference engine hits 140 tok/s on Qwen3.8-27B for local OpenAI/Anthropic APIs

DotaMate · reddit · 2026-10-24

kapitsa is an open-source, from-scratch C++20/Metal inference engine for Apple Silicon (no MLX, no llama.cpp) that serves both OpenAI- and Anthropic-compatible local APIs. Its kflash speculative decoding verifies a best-first tree of draft candidates in one 8-row pass—bit-identical to plain decoding—reaching 140 tok/s on Qwen3.8-27B 4bit (M5 Max), 81 on M5 Pro, 63 on M4 Pro, well above Ollama/MLX/llama.cpp in like-for-like tests. Concurrent requests share the verify pass (+23% throughput at 3x), prefix caching extends to SSD with --disk-cache, and every default change must pass a logit-equivalence check. Install via brew; 32GB for the 27B, 16GB falls back to 9b.

Original post →

More from Infra

Infra channel →