
Running a local LLM on a Mac mini
Why
Can a local model on a Mac mini write Swift that actually compiles and passes tests?
Setup
- Mac mini, M5 Pro, 64GB
- MacBook Pro, M4 Pro, 48GB (only for the two-Mac tests)
- MLX to run the models, served with an Anthropic-style API so Claude Code can talk to it
- Qwen open-weight models, mostly 4-bit
How I tested
- 10 Swift tasks - parsing, money totals, CSV, version compare, a concurrency one, etc.
- Every answer is compiled in Swift 6 language mode with strict concurrency
- Hidden tests grade each answer, so the score is out of 10
- Each setup ran more than once where I could, because the scores move around a lot
Results
Every variation I tried, in the order I’d pick them, best first. This is for coding work on the 64GB Mac mini.
| # | Model | Format / runtime | How I ran it | Speed | Swift score /10 | Notes |
|---|---|---|---|---|---|---|
| 1 | Claude Opus 5.5 | Cloud API | One answer | 110-121 tok/s | 10, 9, 10 then 10, 10, 10 | 10 tasks in about 2 minutes. Costs tokens |
| 2 | Claude Opus 5 | Cloud API | One answer | 66 tok/s | 10 then 10 | Same score, half the speed |
| 3 | Claude Opus 4.5 | Cloud API | One answer | 67-72 tok/s | 10 (1 run) | Same score again, about 5x slower than Opus 5.5 |
| 4 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX (optiq server) | My pipeline | 67-80 tok/s | 9, 8, 7 then 6, 6, 8, 8 | About 1.5 hours for 10 tasks |
| 5 | Qwen3.5-122B-A10B | 4-bit, MLX | One answer, split across both Macs | 37 tok/s | 7 (1 run) | Best local single answer. Doesn’t fit on one 64GB Mac |
| 6 | Qwen3.6-35B-A3B | 4-bit, Ollama’s MLX engine | My pipeline | 84-94 tok/s | 8, 7, 6 | About 20% faster than OptiQ but lower scores. Removed |
| 7 | Qwen3.6-35B-A3B | Plain 4-bit, MLX | My pipeline | about 88 tok/s | 6, 8, 6 | Faster than OptiQ, scores lower |
| 8 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX | My pipeline, thinking off for the fixes, two servers | - | 7 (1 run) | 28 minutes, but it broke working code and ran out of memory |
| 9 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX | My pipeline, tasks split across both Macs | 77-80 and 68 tok/s | 6 (1 run) | Only 1.3x faster. The MacBook half was the slow one |
| 10 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX (optiq server) | One answer, code mode | 67-80 tok/s | 5, 3, 1 then 5 | Fine for Python and edits, not Swift |
| 11 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX (optiq server) | One answer, fast mode (no thinking) | 67-80 tok/s | 3, 3, 4 then 3 | A few seconds per task. Mechanical edits only |
| 12 | Qwen3.6-35B-A3B | OptiQ 4-bit, MLX (optiq server + MTP) | Speed test | 68 tok/s | - | Speculative decoding gave +2%. Not worth it |
| 13 | Qwen3.6-35B-A3B | OptiQ 4-bit, mlx-lm direct, greedy | One answer | 77-80 tok/s | 4 then 3 | Gets stuck repeating itself without the right sampling |
| 14 | Qwen3.8-27B | 4-bit, MLX | One answer | 18 tok/s | 5 | Dense, so slow. Gets stuck in reasoning loops |
| 15 | Qwen3.8-27B | GGUF Q4_K_XL + MTP, llama.cpp | Speed test | 24.6 tok/s | not tested on Swift | My first setup. A third of the MoE’s speed. Removed |
| 16 | Qwen3.8-27B | 4-bit, MLX | Split across both Macs (pipeline parallel) | 12.4 tok/s | - | Slower than one Mac |
| 17 | Qwen3.8-27B | 8-bit, MLX | Speed test | 10 tok/s | - | Too slow to bother |
| 18 | Qwen3.8-27B | 4-bit, MLX | Split across both Macs (tensor parallel) | 6.7 tok/s | - | Slowest of the lot |
How long each task takes - top 4
Real times per task. Opus 5.5 and my local pipeline are the middle of 6 runs, Opus 5 and Opus 4.5 are one run each.
| Model | Duration | Query | Intervals | Roman | CSV | Semver | Luhn | Wrap | Invoice | Coalescer | All 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Claude Opus 5.5 | 11 s | 8 s | 9 s | 11 s | 12 s | 18 s | 6 s | 10 s | 20 s | 19 s | 2.3 min |
| Claude Opus 5 | 39 s | 16 s | 22 s | 16 s | 22 s | 53 s | 7 s | 24 s | 61 s | 32 s | 4.9 min |
| Claude Opus 4.5 | 37 s | 36 s | 44 s | 58 s | 41 s | 199 s | 28 s | 46 s | 50 s | 108 s | 10.8 min |
| Qwen3.6-35B OptiQ, my pipeline | 9.4 min | 8.7 min | 8.9 min | 9.5 min | 8.7 min | 12.1 min | 3.8 min | 9.0 min | 13.1 min | 10.4 min | 97 min |
The tasks: parse a duration like “1h30m”, URL-encode a query string, merge overlapping ranges, Roman numerals to numbers, split a CSV line with quotes, compare version numbers, check a card number (Luhn), wrap text to a width, total an invoice with tax, and make callers asking for the same thing at the same time share one request (Swift concurrency).
“My pipeline” means the model writes an answer, the compiler checks it, the model fixes the errors, then it writes and runs its own tests and fixes again. No cloud tokens at all. “Then” means I re-ran it this week.
Tried but never got a score:
- Qwen3.5-122B split evenly across both Macs - the MacBook ran out of memory.
- Magnitude - the model never finished loading.
- Qwen3.8-Flash-Next - 177GB, far too big.
- Downloaded, not tested yet: Qwen3-Coder-Next 4-bit, the Qwen3.6 GGUF for llama.cpp, and the Splash build of Qwen3.6.
What I learned
- On its own, the local model is weak at Swift - 4 out of 10.
- The pipeline makes the biggest difference. Same model, 4 goes to 6-9.
- It’s slow. Opus does all 10 tasks in about 2 minutes. The local pipeline takes about an hour and a half. Fine for things that run overnight, not for sitting and waiting.
- Scores move a lot between runs. I re-ran everything this week and the same setup scored 6, 6, 8 and 8, where before it was 8, 9, 8 and 7. Don’t trust a single run.
- Bigger isn’t automatically better on 64GB. The 122B model only fits by splitting it across both Macs over Thunderbolt, and that runs at about half the speed.
- Splitting a model that already fits on one Mac across two Macs made it slower, not faster.
- The runtime and the quantisation matter as much as the model. The same Qwen3.6-35B was faster as plain 4-bit and in Ollama, but scored lower than the OptiQ build. llama.cpp with the dense 27B ran at a third of the MoE’s speed.
- Sampling settings matter. With greedy decoding (always pick the top token) the model got stuck repeating itself in its reasoning on 9 out of 10 tasks.
- Opus reviewing the local answers gets 10/10 every time, but it uses more tokens than just asking Opus in the first place.
Would a Mac Studio help?
I haven’t tested one yet. These are estimates from my numbers plus community benchmarks online.
| Mac mini (mine) | Mac Studio M5 Max 64GB | Mac Studio M5 Max 128GB | |
|---|---|---|---|
| GPU cores | 16 | 40 | 40 |
| Memory bandwidth | 307GB/s | 614GB/s | 614GB/s |
| Overnight model | 67-80 tok/s | about 100-120 tok/s (est.) | about 100-120 tok/s (est.) |
| 122B model | needs 2 Macs, 37 tok/s | doesn’t fit | about 58-66 tok/s (community) |
64GB Studio
- Writing speed mostly depends on memory bandwidth. The Studio has double, so I’d expect about 1.5x faster - not quite 2x, because this model doesn’t max out the mini’s bandwidth anyway.
- Reading long prompts depends on GPU cores, so about 2.3x faster. That’s what makes agent sessions feel slow, so this is the bigger win.
- Same 64GB means the same models fit. The scores wouldn’t change.
128GB Studio
- The 122B fits on one machine. Community benchmarks on the M5 Max show about 58-66 tok/s (oMLX, oMLX). That’s close to my daily model’s speed now.
- It scored 7 out of 10 from a single answer, and that was cut short - 6 answers hit the output limit while it was still thinking. With my pipeline I’d guess 8 to 10. I wouldn’t count on 10 every time though. No local setup has hit 10 yet.
- If I had a 128GB Studio, the 122B would move up to number 4 in my list, above my current daily model.
Summary
- Code that has to be right: Opus.
- Routine work that can run unattended: Haiku with model routing to Haiku/Sonnet/Opus
- If you’re buying a Mac for this: 64GB makes the same models faster. 128GB lets you run a much better model. It’s a lot of money. Tokens are cheap and cached and seem to be getting cheaper. I’d just use Claude in the cloud.
Total Time
- 1 week of testing, mostly runs going overnight
- 1 night to re-run everything to check the numbers held up