Skip to content
nace-aiPublic

About

Blazing fast Apple Silicon optimized inference engine built for Qwen and Nemotron. OpenAI + Anthropic API compatible. Built by folks from nace.ai

Resources

Contributing

Security policy

Stars

217 stars

Watchers

12 watching

Forks

Repository files navigation

Kapitsa: a blazing fast Apple Silicon optimized inference engine built for Qwen and Nemotron. Writing speed of Qwen3.6 35B-A3B on a MacBook Pro (2024), M4 Pro, 48 GB, in tokens per second, at 4-bit: Kapitsa with KFlash 161, Splash with DFlash2 135, oMLX with DFlash2 127, Ollama with MTP 89, LM Studio 86, MTPLX with MTP 80, llama.cpp with MTP 69.

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

🔥 What's new

  • [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).

Quickstart

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 | bash
kapitsa opencode --model 35b    # also: claude, codex, pi

On a 16-24 GB Mac use --model 9b, or 4b for the quickest replies.

CLI

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

Benchmarks

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).

Poster of prefill / decode speed for Kapitsa and eight other engines on a MacBook Pro M5 Max, M5 Pro, M4 Pro and M1 Pro; the numbers are in the poster

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

MacBook Pro (16-inch, 2024) · M4 Pro · 48 GB

Nemotron

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

MacBook Pro (16-inch, 2026) · M5 Max · 128 GB

Nemotron

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

MacBook Pro (14-inch, 2021) · M1 Pro · 16 GB

Nemotron

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

MacBook Pro (16-inch, 2026) · M5 Pro · 48 GB

Nemotron

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.

Models

The 11 models, their downloads and decoding
Model Download Decoding
Qwen3.5-4B · 4b
dense
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 · 9b
dense
4-bit · 9.0 GB KFlash
z-lab's DFlash drafter; or MTP
Qwen3.8-27B · 27b
dense
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 · 35b
MoE, 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-next
MoE, 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 · dory
looped dense, 1-4 loops per token; text only
NVIDIA NVFP4 · 3.2 GB
also bf16 8.0 GB
—
Nemotron 3 Nano 4B · nano-4b
hybrid Mamba-2, dense; text only
NVIDIA FP8 · 5.3 GB
also bf16 8.0 GB
prompt lookup
Nemotron Nano 9B v2 · nano-9b
hybrid Mamba-2, dense; text only
NVIDIA NVFP4 · 7.9 GB prompt lookup
Nemotron 3.5 Lightning 30B-A3B · lightning
hybrid 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 · bolt
hybrid 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 · super
hybrid 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

How it works

How Kapitsa works: DFlash2 vs KFlash. DFlash2, the drafter's chain, as Splash, oMLX and mlx-serve run it: the drafter guesses the next 7 tokens, the big model checks them in one pass and keeps them up to the first wrong guess (return a, 2 tokens). KFlash, Kapitsa's: in the same one pass the big model checks a best-first tree of the drafter's top candidates in 8 rows; where the drafter is unsure its runner-ups ride along, and the longest branch the big model agrees with is kept (return a + b, 4 tokens). Same output as plain decoding, tree size measured on each Mac, 8-17% more tokens per pass on short prompts. Below: GPU, hand-written Metal code; Neural Engine, helps read long prompts on the 4B, 27B, Bolt and Super-VL; Memory, keeps conversations ready, up to 4 at once.

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

Get release notices

On the Kapitsa repository page: Watch, then Custom, tick Releases, Apply

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

About

Blazing fast Apple Silicon optimized inference engine built for Qwen and Nemotron. OpenAI + Anthropic API compatible. Built by folks from nace.ai

Resources

Contributing

Security policy

Stars

217 stars

Watchers

12 watching

Forks

Releases

Packages

Contributors

Languages