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

bench/speed: five prompts and a script that prints each answer's writing speed; MODELS.md measures with it

1picassoai2d5474921ef5
diff --git a/bench/speed/prompts.json b/bench/speed/prompts.json
new file mode 100644
index 0000000..f61de3e
--- /dev/null
+++ b/bench/speed/prompts.json
@@ -0,0 +1,7 @@
+[
+ {"id": "intervals", "prompt": "Write a Python function that merges overlapping intervals, with a short explanation."},
+ {"id": "debounce", "prompt": "Write a JavaScript function debounce(fn, ms) and explain in two sentences how it works."},
+ {"id": "lru", "prompt": "Write a TypeScript class LRUCache<K, V> with get, set and delete in O(1), with a short explanation."},
+ {"id": "sql", "prompt": "Write a SQL query that returns each customer's most recent order, and explain the approach briefly."},
+ {"id": "rust", "prompt": "Write a Rust function that reverses a singly linked list, with a short explanation."}
+]
diff --git a/bench/speed/run.py b/bench/speed/run.py
new file mode 100644
index 0000000..ee903d2
--- /dev/null
+++ b/bench/speed/run.py
@@ -0,0 +1,55 @@
+"""Speed check: five coding prompts through the running Coachwhip, each as a fresh conversation,
+and the writing speed of each answer.
+
+Start Coachwhip with --temperature 0 --chat 8090 first, then: python3 bench/speed/run.py
+Standard library only. Writing speed = answer tokens / seconds from the first to the last token,
+the same thing the chat page shows under each answer.
+"""
+import json, os, time, urllib.request
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+URL = os.environ.get("COACHWHIP_URL", "http://127.0.0.1:8090/v1/chat/completions")
+MAX_TOKENS = 300
+
+
+def stream(prompt):
+ body = json.dumps({"model": "m", "stream": True, "max_tokens": MAX_TOKENS,
+ "messages": [{"role": "user", "content": prompt}]}).encode()
+ req = urllib.request.Request(URL, body, {"Content-Type": "application/json"})
+ sent = time.time()
+ first = last = None
+ tokens = 0
+ with urllib.request.urlopen(req, timeout=900) as r:
+ for line in r:
+ line = line.decode("utf-8", "replace").strip()
+ if not line.startswith("data: ") or line == "data: [DONE]":
+ continue
+ event = json.loads(line[6:])
+ if "usage" in event and event["usage"]:
+ tokens = event["usage"].get("completion_tokens", tokens)
+ delta = event["choices"][0]["delta"].get("content")
+ if delta:
+ now = time.time()
+ first = first or now
+ last = now
+ return sent, first, last, tokens
+
+
+def main():
+ prompts = json.load(open(os.path.join(HERE, "prompts.json")))
+ speeds = []
+ print(f"{'prompt':12s} {'tokens':>6s} {'first word':>10s} {'writing':>9s}")
+ for p in prompts:
+ sent, first, last, tokens = stream(p["prompt"])
+ if not first or tokens < 2 or last == first:
+ print(f"{p['id']:12s} no answer")
+ continue
+ tps = (tokens - 1) / (last - first)
+ speeds.append(tps)
+ print(f"{p['id']:12s} {tokens:6d} {first - sent:9.1f}s {tps:7.2f} tok/s")
+ if speeds:
+ print(f"writing: mean {sum(speeds) / len(speeds):.2f} tok/s, min {min(speeds):.2f}, max {max(speeds):.2f}, over {len(speeds)} prompts")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/docs/MODELS.md b/docs/MODELS.md
index f09a1d8..779893d 100644
--- a/docs/MODELS.md
+++ b/docs/MODELS.md
@@ -5,8 +5,8 @@ What each model file does on a 16 GB Mac, measured the same way every time. Thes
## How we measure
- **Machine:** Mac mini M4, 16 GB, macOS 26.
-- **Engine:** Coachwhip 0.2.0, temperature 0.
-- **Speed:** one answer to *"Write a Python function that merges overlapping intervals, with a short explanation."*, capped at 300 tokens. "Writing" is tokens written per second once the answer has started, as Coachwhip counts it: the same figure the chat shows under each answer.
+- **Engine:** Coachwhip 0.3.0 with its default settings (`--prefetch 10 --ahead 4`), temperature 0.
+- **Speed:** the five coding prompts in [`bench/speed/prompts.json`](../bench/speed/prompts.json), each a fresh conversation capped at 300 tokens, run by [`bench/speed/run.py`](../bench/speed/run.py). "Writing" is answer tokens per second from the first token to the last, the same thing the chat shows under each answer; the table gives the mean over the five prompts, with the slowest and fastest in brackets.
- **Quality:** 8 small coding tasks in [`bench/quality/tasks.json`](../bench/quality/tasks.json). Each answer's code is run against tests the model never sees ([`bench/quality/tests.py`](../bench/quality/tests.py)); a task passes only if every test does. Quality depends on the model file, not on Coachwhip's settings: the bank and the prefetch change how fast an answer comes, never what it says.
## Qwen3-Coder-Next (80B)
@@ -31,7 +31,8 @@ Qwen3-Coder-30B-A3B and Qwen3-Next-80B-A3B-Instruct run on Coachwhip (see the RE
```sh
~/coachwhip/target/release/coachwhip --model /path/to/model.gguf --tokenizer /path/to/tokenizer.json \
--bank 56 --temperature 0 --chat 8090
+python3 bench/speed/run.py
python3 bench/quality/run.py
```
-`run.py` asks the 8 tasks through Coachwhip's API, runs each answer against the tests, and prints pass or fail per task. It needs only Python 3. The chat's speed line gives the writing speed for any prompt you like.
+`bench/speed/run.py` streams the five prompts and prints each answer's writing speed and the mean. `bench/quality/run.py` asks the 8 tasks, runs each answer against the tests, and prints pass or fail per task. Both need only Python 3.