Kapitsa is an inference engine for Apple silicon that runs Qwen and Nemotron models locally, built for coding agents. It starts opencode, Claude Code, Codex or pi on a local model, and serves OpenAI and Anthropic APIs.
Quickstart · CLI · Benchmarks · Models · How KFlash works · Docs
- [2026/10] 🚀 KFlash: tree speculative decoding, up to 3.5× llama.cpp and nearly 2× oMLX. One verify pass checks a whole tree of the drafter's guesses. M4 Pro, decode at T=0.6: 63 vs 18 tok/s on the 27B, 201 vs 102 on the 4B; +6% over the build before it on the 27B, −3% on a long agent turn (how it works, #187).
- [2026/10] 🏆 Kapitsa: the fastest decode in 21 of 24 model and Mac pairs against eight engines, up to 2.3× MLX (4B, M4 Pro, 201 vs 88 tok/s). On the M5 Pro Kapitsa is the 10-21 re-run and the others the 10-19 runs (poster).
- [2026/10] 🤝 KFlash budget: subagents decode together. Three requests at once share one verify pass, up to +23% total throughput on the 27B (#207).
- [2026/10] ⚡ QMT prefill: read the prompt up to 1.5× faster on M5. Metal 4 matrix units for the prompt (Qwen3.5 4B, M5 Pro, a busy GPU, not bit-identical, no output check yet; #205, #215).
- [2026/10] 💾 SSD prefix cache: restart the server, keep the conversation. M4 Pro, 35B: a 16K-token follow-up starts in 0.16 s instead of 17 s, about 100× (#212,
--disk-cache). - [2026/10] 🧠 Prefix reuse: subagents start warm. A new question over the shared system prompt answers in 0.06 s instead of 1.9 s (4K, 4B, M5 Pro, a busy GPU; #198, #202).
- [2026/10] 🧪 Output check: speed has to prove it kept the answers. From now on a default changes only after its logits stay within twice the model's noise floor (how, #208, #210).
- [2026/10] 📊
kapitsa bench compare: see it on your own Mac. The same test against every engine installed here, in one command (#197, #219).
Requirements: a Mac with Apple silicon (M1 or newer) and macOS 14 Sonoma or later.
brew install nace-ai/tap/kapitsa
# or: curl -fsSL https://raw.githubusercontent.com/nace-ai/kapitsa/main/install.sh | bashkapitsa opencode --model 35b # also: claude, codex, piOn a 16-24 GB Mac use --model 9b, or 4b for the quickest replies.
kapitsa serve # chat + OpenAI/Anthropic APIs at http://127.0.0.1:8000
kapitsa claude # Claude Code on Kapitsa
kapitsa doctor # this Mac's GPU and memory, and which models fit it
kapitsa bench # benchmark this Mac, share it with the community
kapitsa bench compare # the same test against the other engines installed here
kapitsa pull 27b # download a model without starting it
kapitsa list # downloaded models and their size
kapitsa rm 27b # delete a downloaded model
kapitsa import model.gguf # use a Qwen GGUF from LM Studio, Ollama or llama.cpp
kapitsa update # update now (it also updates itself)--model picks the model and its precision (35b:6bit). kapitsa <command> --help has the options.
Usage guide
Kapitsa has the fastest decode in 21 of the 24 model and Mac pairs measured against eight engines (on the M5 Pro, Kapitsa was re-run on 10-21 and the other engines are the 10-19 runs, except mlx-serve's 27B).
Each cell reads prefill / decode in tokens per second. Prefill is a 4K-token prompt, decode a 512-token answer. × cannot run that model · — not measured. How these were measured, run dates and flags: docs/benchmarks.md.
Models not on the poster (decode tok/s)
🟩 fastest per model · — not measured
| Model | Kapitsa | oMLX 0.7.1rc1 |
llama.cpp b11669 |
MLX mlx-lm 0.32.2, mlx-vlm 0.7.8 |
|---|---|---|---|---|
| Nemotron Dory1.0 4B NVFP4 |
🟩 64 tok/s loops |
— no support |
6 no spec |
48 no spec |
| Model | Kapitsa | oMLX 0.7.1rc1 |
mlx‑serve 26.10.2 |
Ollama 0.40.6 |
MTPLX 2.12.2 |
LM Studio MLX runtime 1.13.1, llama.cpp runtime 2.60.0 |
llama.cpp b11669 |
MLX mlx-lm 0.32.2, mlx-vlm 0.7.8 |
|---|---|---|---|---|---|---|---|---|
| Nemotron Dory1.0 4B NVFP4 |
🟩 117 tok/s loops |
— no support |
— no support |
— no support |
— no support |
— no support |
9 | 76 |
| Nemotron 3.5 Lightning 30B‑A3B NVFP4 |
🟩 239 tok/s DSpark |
190 | 190 | 153 | 131 | 110 | 159 | 139 |
| Nemotron 3.5 Super‑VL 120B‑A12B NVFP4 |
🟩 85 tok/s LiLiCorr |
52 | — no support |
64 | 44 | 61 | 66 | 46 |
| Model | Kapitsa | oMLX 0.7.1rc1 |
llama.cpp b11669 |
MLX mlx-lm 0.32.2, mlx-vlm 0.7.8 |
|---|---|---|---|---|
| Nemotron Dory1.0 4B NVFP4 |
🟩 40 tok/s no spec |
— no support |
4 no spec |
30 no spec |
| Nemotron 3 Nano 4B FP8 |
🟩 37 tok/s prompt lookup |
— not run |
28 Q4_K_M |
21 BF16 |
| Nemotron Nano 9B v2 NVFP4 |
🟩 25 tok/s prompt lookup |
— not run |
14 Q4_K_M |
18 |
| Model | Kapitsa | oMLX 0.7.1rc1 |
mlx‑serve 26.10.2 |
Ollama 0.40.6 |
MTPLX 2.12.2 |
LM Studio MLX runtime 1.13.1, llama.cpp runtime 2.60.0 |
llama.cpp b11669 |
MLX mlx-lm 0.32.2, mlx-vlm 0.7.8 |
|---|---|---|---|---|---|---|---|---|
| Nemotron Dory1.0 4B NVFP4 |
🟩 70 tok/s loops |
— no support |
— no support |
— no support |
— no support |
— no support |
13 | 53 |
| Nemotron 3.5 Bolt 74B‑A9B 2/4/8-bit mix |
🟩 79 tok/s LiLiCorr |
39 no spec |
— no support |
— no support |
— no support |
— no support |
— no Metal support |
41 |
Every recorded run, with its Mac, model, prefill and decode speed, is in the benchmark table. Measure your Mac: kapitsa bench --submit adds it to the community results. Another engine faster on your Mac? kapitsa bench compare ranks every engine you have installed, and --report writes a Markdown report.
The 11 models, their downloads and decoding
| Model | Download | Decoding |
|---|---|---|
Qwen3.5-4B · 4bdense |
4-bit · 4.6 GB also 6-bit 5.6 · 8-bit 6.7 · bf16 10.6 GB |
KFlash z-lab's DFlash drafter; or MTP |
Qwen3.5-9B · 9bdense |
4-bit · 9.0 GB | KFlash z-lab's DFlash drafter; or MTP |
Qwen3.8-27B · 27bdense |
4-bit · 20.2 GB also 5-bit 23.5 · 6-bit 26.9 · 8-bit 33.6 · bf16 58.8 GB |
KFlash DFlash2 drafter; or MTP |
Qwen3.6-35B-A3B · 35bMoE, 3B active |
4-bit · 22.1 GB also 5-bit 26.4 · 6-bit 30.7 · 8-bit 39.4 · bf16 71.9 GB; 16-24 GB Macs: 16gb, 2-bit experts (unsloth's GGUF) 10.8 GB |
KFlash DFlash2 drafter; or MTP; 16gb: none |
Qwen3.8-Flash-Next 180B-A7B · flash-nextMoE, 7B active; 128 GB Macs |
4-bit · 105.9 GB 4/6/8-bit MLX; its 32 GB n-gram table stays on the SSD |
MTP |
Nemotron Dory1.0 4B · dorylooped dense, 1-4 loops per token; text only |
NVIDIA NVFP4 · 3.2 GB also bf16 8.0 GB |
— |
Nemotron 3 Nano 4B · nano-4bhybrid Mamba-2, dense; text only |
NVIDIA FP8 · 5.3 GB also bf16 8.0 GB |
prompt lookup |
Nemotron Nano 9B v2 · nano-9bhybrid Mamba-2, dense; text only |
NVIDIA NVFP4 · 7.9 GB | prompt lookup |
Nemotron 3.5 Lightning 30B-A3B · lightninghybrid Mamba-2 MoE, 3B active; text only |
NVIDIA NVFP4 · 22.9 GB 4-bit NVFP4 experts, FP8, BF16 |
KFlash NVIDIA's DSpark drafter |
Nemotron 3.5 Bolt 74B-A9B · bolthybrid Mamba-2 MoE, 9B active |
NVIDIA 24 GB · 25.1 GB 2-bit experts, NVFP4, 8-bit |
KFlash NVIDIA's LiLiCorr drafter |
Nemotron 3.5 Super-VL 120B-A12B · superhybrid Mamba-2 MoE, 12B active; 96 GB+ Macs |
NVIDIA NVFP4 · 76.4 GB 4-bit NVFP4 experts, FP8, BF16 |
KFlash NVIDIA's LiLiCorr drafter |
Other precisions: --model 35b:6bit is five times closer to bf16 than the 4-bit default (KL). All but Lightning, Dory, the two Nemotron Nanos and the 35B's 16gb read images. Memory: 16 GB for the 4B and 9B models, 32 GB
for the 27B, 35B, Lightning and Bolt, 96 GB for Super-VL, 128 GB for Flash-Next. On a 16 or 24 GB Mac, 35b takes its 16gb variant: unsloth's 2-bit GGUF, downloaded and imported in one step (how). Details
Kapitsa decodes with KFlash. A draft model such as DFlash2 guesses the next seven tokens, with a few candidates for each one. Engines that run it as published (Splash, oMLX, mlx-serve) check one chain of guesses and stop at the first wrong one. KFlash checks a best-first tree of the drafter's candidates in the same pass, so where the drafter hesitates, its runner-ups are checked too and more tokens survive each pass. The tree's size comes from what a verify row costs on your Mac, measured there, and it changes no output: the big model checks every token. It runs on the published drafters as they are: z-lab's DFlash, DFlash2, and NVIDIA's DSpark and LiLiCorr. How KFlash works
Watch → Custom → Releases on nace-ai/kapitsa puts every new version in your notifications. A drawn illustration of the steps, not a screen recording; the page source is in tools/readme_images.
How KFlash works · Architecture · Contributing · Press kit · Apache 2.0, © 2026 Nace AI · Third-party notices
