Skip to content

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.5.3: the resident 35B line merged with main (the 0.5.2 docs); version 0.5.3, release notes, models page row, README front, install.sh pinned to v0.5.3

1picassoai2797337650fd
diff --cc Cargo.toml
index f9b2c78,73ee1ba..00680d0
--- a/Cargo.toml
+++ b/Cargo.toml
@@@ -3,7 -3,7 +3,7 @@@ members = ["crates/engine", "crates/ser
resolver = "2"
[workspace.package]
- version = "0.5.1"
-version = "0.5.2"
++version = "0.5.3"
edition = "2021"
license = "Apache-2.0"
publish = false
diff --cc README.md
index 4ecc31b,e885a82..52af9c7
--- a/README.md
+++ b/README.md
@@@ -7,74 -7,66 +7,69 @@@
# Coachwhip
- **Run mixture-of-experts models that are bigger than your memory, on your own Mac.**
-## **Qwen3.6-35B on a 16 GB Mac. 15 tok/s. Fully offline.**
++## **Qwen3.6-35B on a 16 GB Mac. 38 tok/s. Fully offline.**
- Coachwhip is one Rust binary. It takes a model file in GGUF format, keeps the part of the model every word needs on the GPU, and streams the rest from the SSD as each word asks for it. A 120-billion-parameter model runs on a 16 GB Mac. Which models, how fast, and how to set each one up: [docs/MODELS.md](docs/MODELS.md).
-**Install: under a minute. Model: 14.2 GB, about five minutes on a fast line. Then it runs.**
++**Install: under a minute. Model: 11.5 GB, a few minutes on a fast line. Then it runs, with every expert on the GPU.**
- <p align="center"><img src="docs/coachwhip-demo.gif" alt="A 122-billion-parameter model writing TypeScript in the Coachwhip chat on a 16 GB Mac mini, in real time" width="720"></p>
-Apple silicon, 16 GB, macOS 15 or later, 35 GB of free disk.
++Apple silicon, 16 GB, macOS 15 or later, 15 GB of free disk.
- ## Why we built it
-
- Two reasons, and both had to hold at once.
-
- **The code stays on the machine.** A coding assistant reads your code. If that assistant runs on someone else's server, your code goes there with every question. Coachwhip runs the model on your Mac, listens only to programs on your Mac, and sends nothing anywhere. Unplug the network and it works the same.
-
- **It had to be fast enough to use.** A model big enough to be worth asking does not fit in a laptop's memory, and the usual answer, a smaller model, is a worse assistant. Coachwhip's answer is to stop loading the whole model. A mixture-of-experts model is made of many small experts, and a router picks only a few of them for each word. Coachwhip reads exactly those, keeps the ones it has used lately on the GPU, and guesses the next layer's picks while the GPU is busy on this one. The big model stays big; only its working set is in memory.
-
- ## Install
-
- One line in Terminal:
+ **1. Install**
```sh
curl -fsSL https://raw.githubusercontent.com/1picassoai/coachwhip/main/install.sh | bash
```
- It checks your Mac and downloads the ready-built Coachwhip into `~/coachwhip`, in under a minute. Nothing to compile, no Rust. Run it again at any time to update to the latest release.
-**2. Download the model** (14.2 GB, ready-squeezed)
++**2. Download the model** (11.5 GB, unsloth's UD-IQ2_M file, used as it is)
- To build from source instead, run it with `COACHWHIP_FROM_SOURCE=1` in front of `bash`: it installs Apple's command line tools and Rust if they are missing, and the build takes about 10 minutes.
+ ```sh
+ mkdir -p ~/coachwhip/models && cd ~/coachwhip/models
-curl -L -O https://huggingface.co/vinnj/coachwhip-models/resolve/main/Qwen3.6-35B-A3B.Q2X.gguf
++curl -L -O https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF/resolve/main/Qwen3.6-35B-A3B-UD-IQ2_M.gguf
+ curl -L -O https://huggingface.co/Qwen/Qwen3.6-35B-A3B/resolve/main/tokenizer.json
+ ```
- **What you need:** a Mac with Apple silicon (M4 or later recommended; M1 to M3 run it slower), 16 GB of memory, macOS 26 (tested), and disk for the model file. Coachwhip itself is 15 MB. Each model's disk and memory needs are on the [models page](docs/MODELS.md).
+ **3. Run** (the chat opens in your browser)
- ## Bring a model
+ ```sh
-~/coachwhip/coachwhip.sh ~/coachwhip/models/Qwen3.6-35B-A3B.Q2X.gguf ~/coachwhip/models/tokenizer.json 68 8090 --parallel --flash-reads --stand-ins
++~/coachwhip/coachwhip.sh ~/coachwhip/models/Qwen3.6-35B-A3B-UD-IQ2_M.gguf ~/coachwhip/models/tokenizer.json 44 8090 --max-tokens 16000
+ ```
- Coachwhip is the engine; the model is yours. Download a supported model's GGUF file and its `tokenizer.json` from the publisher's page, then start Coachwhip with both. Some models are squeezed once on your Mac before first use; the models page has the steps and the exact start line for each one.
++The file fits, so Coachwhip keeps all 256 experts of all 40 layers in GPU memory and reads nothing from the SSD while it runs.
+
- ## Use
+ **Next**
- **Chat in your browser:**
-- Your tools: OpenAI API on `http://127.0.0.1:8090/v1`, any key, model `Qwen3.6-35B-A3B.Q2X`. Aider: `aider --openai-api-base http://127.0.0.1:8090/v1 --openai-api-key anything --model openai/Qwen3.6-35B-A3B.Q2X --map-tokens 0`
++- Your tools: OpenAI API on `http://127.0.0.1:8090/v1`, any key, model `Qwen3.6-35B-A3B-UD-IQ2_M`. Aider: `aider --openai-api-base http://127.0.0.1:8090/v1 --openai-api-key anything --model openai/Qwen3.6-35B-A3B-UD-IQ2_M --map-tokens 0`
++- Each request's `temperature`, `top_p`, `top_k` and `min_p` are honoured; without them the model gets Qwen's own 0.7 / 0.8 / 20 / 0.
+ - Bigger models: the 80B coder and gpt-oss-120b, on the [models page](docs/MODELS.md).
-- Numbers and how they were measured: [release notes](docs/releases/0.5.2.md).
++- Numbers and how they were measured: [release notes](docs/releases/0.5.3.md).
- ```sh
- ~/coachwhip/coachwhip.sh /path/to/model.gguf /path/to/tokenizer.json 56
- ```
-Measured on a Mac mini M4 with 16 GB; your Mac moves the number. Model sha256 `8b919b5eb649f74a9c1d528a4c00aef3a633017032b94848b04b1f2fb312b9ad`, squeezed once from [unsloth's UD-Q4_K_M](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF) with the tool in the install.
++Measured on a Mac mini M4 with 16 GB: writing 38 tok/s, reading about 300 tok/s on a 1,500-token prompt; your Mac and your prompt move the numbers. The squeezed `Q2X` file from 0.5.2 still runs the streaming way at its own numbers.
- The last number is the bank, the expert slots kept on the GPU per layer (44 if you leave it out; each model's number is on the models page). The chat opens in your browser. Type, press Send, and the answer streams as it is written. Follow-up questions read only your new words; press **New chat** to start again. Stop Coachwhip with Ctrl+C.
+ ---
- **Thinking.** A model that thinks before it answers shows its thinking in a box above the answer. A model with an optional thinking mode shows a **let it think first** box on the page. Either way Coachwhip only puts the model's own template text at the start of its turn; each word comes at the same speed, and thinking makes the reply longer, not slower per word. In the terminal it is `--think`; through the API it is always off, so coding tools get the answer.
+ ## Why we built it
- **From your coding tools:** while Coachwhip runs, it also speaks the OpenAI chat API, so any tool that takes an OpenAI base URL can use the model.
+ Two reasons, and both had to hold at once.
- | Setting | Value |
- |---|---|
- | Base URL | `http://127.0.0.1:8090/v1` |
- | API key | anything; it is ignored |
- | Model | the model's file name, as listed at `/v1/models` |
+ **The code stays on the machine.** A coding assistant reads your code. If that assistant runs on someone else's server, your code goes there with every question. Coachwhip runs the model on your Mac, listens only to programs on your Mac, and sends nothing anywhere. Unplug the network and it works the same.
- A conversation holds up to 16K tokens: the history, the question and the answer together. That limit is sized to fit a 16 GB Mac; the models themselves support longer.
+ **It had to be fast enough to use.** A model big enough to be worth asking does not fit in a laptop's memory, and the usual answer, a smaller model, is a worse assistant. Coachwhip's answer is to stop loading the whole model. A mixture-of-experts model is made of many small experts, and a router picks only a few of them for each word. Coachwhip reads exactly those, keeps the ones it has used lately on the GPU, and guesses the next layer's picks while the GPU is busy on this one. The big model stays big; only its working set is in memory.
- Only programs on this Mac can reach it. Follow-ups that resend the whole conversation read only the new part. The chat page and your tools share one model, one request at a time; when a tool has used it, the page's next question starts a new chat.
+ ## Use
- Tested with the official `openai` Python client and with [Aider](https://aider.chat), the coding agent for the terminal:
+ **Chat in your browser:**
```sh
- aider --openai-api-base http://127.0.0.1:8090/v1 --openai-api-key anything \
- --model openai/<model file name> --map-tokens 0 src/queue.ts
+ ~/coachwhip/coachwhip.sh /path/to/model.gguf /path/to/tokenizer.json 56
```
- <p align="center"><img src="docs/coachwhip-aider.png" alt="Aider using an 80-billion-parameter coder through Coachwhip on a 16 GB Mac: it finds a sort-order bug and rewrites the file" width="720"></p>
+ The last number is the bank: expert slots kept on the GPU per layer. Each model's number is on the [models page](docs/MODELS.md). Ctrl+C stops it.
- <p align="center"><sub>Aider on a Windows laptop, reaching the Mac through an SSH tunnel, so the requests arrive as a local program.</sub></p>
+ - A thinking model shows its thinking in a box above the answer. Through the API thinking is off, so coding tools get the answer.
+ - A conversation holds up to 16K tokens, sized for a 16 GB Mac.
+ - Only programs on this Mac can reach it. The chat page and your tools share one model, one request at a time.
+ - Tested with the official `openai` Python client and with [Aider](https://aider.chat). `--map-tokens 0` turns off Aider's repository map, which adds about a thousand tokens to every request.
- `--map-tokens 0` turns off Aider's repository map, which adds up to about a thousand tokens to each request by default; with it on, each request takes longer to read.
+ <p align="center"><img src="docs/coachwhip-aider.png" alt="Aider using an 80B coder through Coachwhip on a 16 GB Mac: it finds a sort-order bug and rewrites the file" width="720"></p>
**One answer in the terminal:**
diff --cc docs/MODELS.md
index e39fe4a,a758892..9b07875
--- a/docs/MODELS.md
+++ b/docs/MODELS.md
@@@ -190,8 -200,6 +200,8 @@@ Measured 6 Oct 2026: one person, one ru
- Tokenizer: [tokenizer.json](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) from the model's own page.
- **On 0.4.0:** not re-measured. Its code path is unchanged, but nobody has run it on the release build.
- **On 0.5.1, every expert on the GPU.** With unsloth's [UD-IQ2_M file](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF) (11.5 GB) all 256 experts of all 40 layers stay in GPU memory and nothing streams from the SSD. Measured 15 Oct 2026 on the same Mac: **writing 38 tok/s** (300 tokens after a 1,500-token prompt, four runs between 37.9 and 38.3); **reading about 300 tok/s** on that prompt (289 to 304); single prompts of 7,500, 9,300 and 16,800 tokens read at 242, 227 and 202 tok/s on one running engine. Chosen by itself when the file fits with 1 GB to spare; the start line is the same as any model, and no bank number is needed. Quality on a four-agent CrewAI coding job (8 behaviour checks, temperature 0.7): 5, 3 and 5 of 8 over three runs. The Q4 file above still runs the streaming way.
++**On 0.5.3, every expert on the GPU.** With unsloth's [UD-IQ2_M file](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF) (11.5 GB) all 256 experts of all 40 layers stay in GPU memory and nothing streams from the SSD. Measured 15 Oct 2026 on the same Mac: **writing 38 tok/s** (300 tokens after a 1,500-token prompt, four runs between 37.9 and 38.3); **reading about 300 tok/s** on that prompt (289 to 304); single prompts of 7,500, 9,300 and 16,800 tokens read at 242, 227 and 202 tok/s on one running engine. Chosen by itself when the file fits with 1 GB to spare; the start line is the same as any model, and no bank number is needed. Quality on a four-agent CrewAI coding job (8 behaviour checks, temperature 0.7): 5, 3 and 5 of 8 over three runs. The Q4 file above still runs the streaming way.
+
## Qwen3-Coder-30B-A3B
The smaller download (architecture `qwen3moe`), 18.6 GB at Q4_K_M. Bank 44 on 16 GB. Its experts are bigger than the 80B's, so it holds about 11 GB while hot and leaves about 3 GB for everything else.
diff --cc docs/releases/0.5.3.md
index 0000000,0000000..63186a1
new file mode 100644
--- /dev/null
+++ b/docs/releases/0.5.3.md
@@@ -1,0 -1,0 +1,23 @@@
++# Coachwhip 0.5.3
++
++Mac mini M4, 16 GB, measured; your Mac and your prompt will move the numbers.
++
++## Qwen3.6-35B-A3B with every expert on the GPU
++
++- **A 35B that fits.** With unsloth's [UD-IQ2_M file](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF) (11.5 GB), Coachwhip keeps all 256 experts of all 40 layers in GPU memory; nothing streams from the SSD while it runs. **Writing about 38 tok/s; reading a 1,500-token prompt about 300 tok/s.** The 22 GB Q4 file still runs the streaming way, at the 0.3.0 numbers.
++- **Chosen by itself.** When a Qwen3.5/3.6 MoE file fits in GPU memory with 1 GB to spare, the resident mode is used; otherwise the streaming path as before. The start line is the same; no bank number is needed for a file that fits.
++- **Long prompts and chats.** The conversation space is fixed at 8,192 tokens and rolls when full (the first 256 words and the newest are kept) instead of refusing. Single prompts of 7,500, 9,300 and 16,800 tokens were read on one running engine at 242, 227 and 202 tok/s.
++- **The API uses your sampling.** Each request's `temperature`, `top_p`, `top_k`, `min_p` and `repeat_penalty` are honoured; a request that sends none gets Qwen's own 0.7 / 0.8 / 20 / 0, with no repeat penalty. Up to 0.5.2 the API used the engine's defaults whatever the request said; that is fixed. Temperature 0 gives the same text on every run.
++- **Quality, measured once.** A four-agent CrewAI job (analyst, architect, developer, tester) writing an event-sourced order service in TypeScript, judged by 8 behaviour checks at temperature 0.7: 5, 3 and 5 of 8 over three runs. Read what it writes, and run it.
++
++## Structure
++
++- `crates/engine/src/arena.rs`: the engine's own GPU scratch for its kernels, allocated once and reused, so a prompt piece costs one layer's memory rather than one per layer.
++- `crates/engine/src/attn_kernel.rs`: the linear-attention piece kernel does the conv, the activation and the norms once per piece in parallel passes; the sequential walk only updates each head's memory. The text is byte-identical to the word-by-word path.
++- `crates/server/src/chat.rs`: the sampler chain (top-k on the GPU, then top-p, min-p, temperature) and the rolling conversation space.
++
++## Not tested
++
++- Prompts above 17K tokens on this build.
++- Macs other than an M4 with 16 GB on macOS 26.
++- gpt-oss-120b and the 80B and 122B were not re-measured on this build; their streaming path is unchanged.
diff --cc install.sh
index 9672037,7773b92..8b55bb3
--- a/install.sh
+++ b/install.sh
@@@ -13,7 -13,7 +13,7 @@@ set -euo pipefai
main() {
DIR="${COACHWHIP_DIR:-$HOME/coachwhip}"
REPO="${COACHWHIP_REPO:-https://github.com/1picassoai/coachwhip}"
- VERSION="${COACHWHIP_VERSION:-v0.5.1}"
-VERSION="${COACHWHIP_VERSION:-v0.5.2}"
++VERSION="${COACHWHIP_VERSION:-v0.5.3}"
ASSET="coachwhip-$VERSION-macos-arm64.tar.gz"
DIST="${COACHWHIP_DIST:-$REPO/releases/download/$VERSION}"