The 80B Qwen3-Coder-Next on a 16 GB Mac, about 13 tok/s, fully offline. A mixture-of-experts inference engine for Apple silicon.
Rust
0.4.0: the 122B after a local squeeze; two modes; README, models page and release notes
Picassoai12a82c6b8e7c
diff --git a/README.md b/README.mdindex 7daece4..dbff8c4 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@**Run mixture-of-experts models that are bigger than your memory.**-An 80B model, running comfortably on a 16 GB Mac. Coachwhip never needs the whole model in memory, because a mixture-of-experts model never needs the whole model for one word.+An 80B model, running comfortably on a 16 GB Mac; a 122B model too, after a five-minute squeeze. Coachwhip never needs the whole model in memory, because a mixture-of-experts model never needs the whole model for one word.One Rust binary. Everything on the GPU. Nothing leaves your machine.@@ -61,6 +61,7 @@ Coachwhip is an engine for MoE models, in GGUF format.| [Qwen3-Coder-Next](https://huggingface.co/Qwen/Qwen3-Coder-Next) (80B) | qwen3next | Tested. See below for the file to use. || [Qwen3-Next-80B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Next-80B-A3B-Instruct) | qwen3next | Tested. || [Qwen3.6-35B-A3B](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) | qwen35moe | Tested. Thinks when asked to. |+| [Qwen3.5-122B-A10B](https://huggingface.co/Qwen/Qwen3.5-122B-A10B) | qwen35moe | Tested, after `prepare` (see The 122B). || Qwen3-30B-A3B, other Qwen3 MoE | qwen3moe | Supported. || Qwen3.5 MoE, Qwen3.6-14B-A3B (community) | qwen35moe | Supported. The 14B fits in 16 GB on its own; Coachwhip does not make it faster. || Mixtral, Qwen2-MoE, OLMoE, DeepSeek, gpt-oss, GLM | | Coming next. |@@ -73,12 +74,12 @@ Try other MoE models and tell us what happens. If a model's architecture is not## What you need-| | 30B | 80B |-|---|---|---|-| Mac | Apple silicon (M1 or later). Tested on a Mac mini M4. | the same |-| Memory | 16 GB | 16 GB; 24 GB has room to spare |-| Disk | 19 GB for the model, 3 GB for the build | 39 GB (Q3_K_M) or 49 GB (Q4_K_M) for the model, 3 GB for the build |-| macOS | Tested on macOS 26 | the same |+| | 30B | 80B | 122B |+|---|---|---|---|+| Mac | Apple silicon, M4 or later recommended; M1 to M3 run it slower. Tested on a Mac mini M4. | the same | the same |+| Memory | 16 GB | 16 GB; 24 GB has room to spare | 16 GB |+| Disk | 19 GB for the model, 3 GB for the build | 39 GB (Q3_K_M) or 49 GB (Q4_K_M) for the model, 3 GB for the build | 59 GB for the download plus 46 GB for the squeezed file, 3 GB for the build |+| macOS | Tested on macOS 26 | the same | the same |## Install@@ -110,6 +111,31 @@ The Q3_K_M file writes faster than Q4_K_M on a 16 GB Mac, and the two scored the| Qwen3-Coder-Next (80B), the 4-bit file | [MaziyarPanahi Q4_K_M](https://huggingface.co/MaziyarPanahi/Qwen3-Coder-Next-GGUF) | [tokenizer.json](https://huggingface.co/Qwen/Qwen3-Coder-Next) | 56 || Qwen3-Coder-30B-A3B, a smaller download | [unsloth Q4_K_M](https://huggingface.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF) | [tokenizer.json](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct) | 44 |+## The 122B++Qwen3.5-122B-A10B is the biggest model Coachwhip runs on 16 GB, and it needs one extra step: its experts are too big to stream fast as they come, so Coachwhip squeezes the file once, on your Mac.++1. Download the publisher's [Q3_K_M GGUF](https://huggingface.co/mradermacher/Qwen3.5-122B-A10B-GGUF) (59 GB) and the model's [tokenizer.json](https://huggingface.co/Qwen/Qwen3.5-122B-A10B).+2. Squeeze it. About five minutes on an M4; it writes a second file beside the first and leaves the download untouched:++```sh+~/coachwhip/target/release/coachwhip-prepare ~/Downloads/Qwen3.5-122B-A10B.Q3_K_M.gguf ~/Downloads/Qwen3.5-122B-A10B.Q2X.gguf+```++ The squeeze takes each expert's gate and up matrices to Q2_K on the GPU and its down matrix to Q3_K; everything else in the file is copied as it is. Nothing is downloaded from us, and you can delete the original afterwards if you want the disk back.++3. Start it in one of two modes, bank 32:++```sh+# exact: the model's own 8 experts per word+~/coachwhip/coachwhip.sh ~/Downloads/Qwen3.5-122B-A10B.Q2X.gguf ~/Downloads/tokenizer.json 32++# fast: the router's top 4 experts per word, and the GPU runs ahead of the CPU+~/coachwhip/coachwhip.sh ~/Downloads/Qwen3.5-122B-A10B.Q2X.gguf ~/Downloads/tokenizer.json 32 8090 --experts 4 --parallel+```++**Fast mode changes the answers.** The model was trained to use 8 experts for every word; asking for 4 makes it write about twice as fast, and its answers can differ from what the full model would say. It is a choice, never the default. Both modes' speed and quality on our checks are in [docs/MODELS.md](docs/MODELS.md).+## Use**Chat in your browser:**diff --git a/docs/MODELS.md b/docs/MODELS.mdindex 8f5ec09..faa6931 100644--- a/docs/MODELS.md+++ b/docs/MODELS.md@@ -38,6 +38,21 @@ Measured 6 Oct 2026: one person, one run per bank, on the same Mac with a backgr- **Quality:** all eight tasks passed, including the duration parser that both 80B files got wrong. Eight tasks is a small sample.- Tokenizer: [tokenizer.json](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) from the model's own page.+## Qwen3.5-122B-A10B++The biggest model Coachwhip runs on 16 GB (architecture `qwen35moe`): 48 layers, 256 experts of which 8 are used per word. It runs from a **squeezed file** that `coachwhip-prepare` makes on your Mac from the publisher's Q3_K_M (59 GB): each expert's gate and up matrices to Q2_K on the GPU, its down matrix to Q3_K, the rest untouched; 45 GB written in 5 min 7 s on an M4. See the README, The 122B.++| Mode | `--bank` on 16 GB | Writing | Quality |+|---|---|---|---|+| exact, the model's own 8 experts | 32 | **2.7 tok/s** sampled over 300 words, one run; 2.9 greedy over 120 | _tester's run before the tag_ |+| fast, `--experts 4 --parallel` | 32 | **4.9 tok/s**, one short run (120 tokens) | _tester's run before the tag_ |++Measured 8 Oct 2026 by the builder, single runs on one prompt each, Mac mini M4 with a background load of about 1.5: a first measurement, not a settled range. The tester's five-prompt run and the 8-task quality check replace these figures before the release is tagged; if they are missing here, the release was not signed.++- **Why the squeeze:** at the file's own 4.9 MB per expert, 8 experts a word, the SSD cannot feed a 16 GB Mac faster than about 2 tok/s. At 3.4 MB per expert the same bank holds more and each read lands sooner.+- **Why fast mode changes answers:** the model was trained to combine 8 experts per word; asking for 4 drops the four lightest. On the 8 coding tasks it passed 8 of 8 on 7 Oct 2026 (a different file, same recipe); the tester's run on this file is the figure that counts.+- Tokenizer: [tokenizer.json](https://huggingface.co/Qwen/Qwen3.5-122B-A10B) from the model's own page.+## Not measured yetQwen3-Coder-30B-A3B and Qwen3-Next-80B-A3B-Instruct run on Coachwhip (see the README) but have not been through these checks yet.diff --git a/docs/releases/0.4.0.md b/docs/releases/0.4.0.mdnew file mode 100644index 0000000..19d4b67--- /dev/null+++ b/docs/releases/0.4.0.md@@ -0,0 +1,35 @@+# Coachwhip 0.4.0++Mac mini M4, 16 GB, measured; your Mac and your prompt will move the numbers. Method and every figure's conditions: [docs/MODELS.md](../MODELS.md).++## New model++- **Qwen3.5-122B-A10B** (`qwen35moe`), the biggest model Coachwhip runs on 16 GB, after a five-minute squeeze on your own Mac: `coachwhip-prepare` takes the publisher's Q3_K_M file and writes a second file beside it with each expert's gate and up matrices at Q2_K (done on the GPU) and its down matrix at Q3_K; everything else is copied as it is. 45 GB written in 5 minutes on an M4. Nothing is downloaded from us.+- **Two modes.** Exact mode uses the model's own 8 experts per word. Fast mode, `--experts 4 --parallel`, asks the router for its top 4 and lets the GPU run ahead of the CPU: about twice the speed, and the answers can differ from the full model's. Fast mode is a choice, never the default; the README says so where the command is.+- Numbers on the squeezed file at bank 32, in [docs/MODELS.md](../MODELS.md): the tester's run.++## Faster++- **The parallel path, `--parallel`.** The GPU waits on a shared event for a layer's experts instead of the CPU re-queuing each layer; the CPU never waits for the GPU inside a word. Off by default; answers identical with it on or off on the 80B and the 35B.+- **`--experts N`** asks the router for N experts per word instead of the model's own number. Fewer experts means fewer bytes per word and faster writing; the answers change, so the quality check is beside the speed on the models page.++## Fixed++- The expert banks are no longer built while a prompt is being read. On a long first prompt that could push the GPU out of memory.++## Structure++- New crate `crates/prepare`: the squeeze, streaming, so the whole model never sits in memory.+- `crates/engine/src/requant.rs`: Metal kernels that squeeze a Q3_K, Q4_K or Q5_K expert to Q2_K on the GPU, one thread per 256-weight block; the prepare step uses them.+- Vendored `candle-metal-kernels` with the Q2_K matvec fix (the upstream kernel read 4 rows per group where the shader covered 8) and the shared-event wait the parallel path needs.+- Lab switches behind `COACHWHIP_*` environment variables are off and inert; they are not part of the product.++## Not tested++- Macs other than an M4 with 16 GB; M1 to M3 will be slower.+- The 122B's sampled answers beyond 300 words.+- `prepare` on a Mac without a Metal GPU falls back to the CPU and takes about 12 minutes; not timed on this release.++## Risk++- Fast mode is a different model in practice: 4 experts where the model expects 8. The README and the chat label it; the quality numbers on the models page are the measure of what it costs.