Home / Blog / Running a local LLM on a Mac mini

Running a local LLM on a Mac mini

What I found running open-weight Qwen models on a Mac mini for Swift coding, how they compare with Claude Opus, and what a Mac Studio would change.

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

  1. Mac mini, M5 Pro, 64GB
  2. MacBook Pro, M4 Pro, 48GB (only for the two-Mac tests)
  3. MLX to run the models, served with an Anthropic-style API so Claude Code can talk to it
  4. Qwen open-weight models, mostly 4-bit

How I tested

  1. 10 Swift tasks - parsing, money totals, CSV, version compare, a concurrency one, etc.
  2. Every answer is compiled in Swift 6 language mode with strict concurrency
  3. Hidden tests grade each answer, so the score is out of 10
  4. 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.

#ModelFormat / runtimeHow I ran itSpeedSwift score /10Notes
1Claude Opus 5.5Cloud APIOne answer110-121 tok/s10, 9, 10 then 10, 10, 1010 tasks in about 2 minutes. Costs tokens
2Claude Opus 5Cloud APIOne answer66 tok/s10 then 10Same score, half the speed
3Claude Opus 4.5Cloud APIOne answer67-72 tok/s10 (1 run)Same score again, about 5x slower than Opus 5.5
4Qwen3.6-35B-A3BOptiQ 4-bit, MLX (optiq server)My pipeline67-80 tok/s9, 8, 7 then 6, 6, 8, 8About 1.5 hours for 10 tasks
5Qwen3.5-122B-A10B4-bit, MLXOne answer, split across both Macs37 tok/s7 (1 run)Best local single answer. Doesn’t fit on one 64GB Mac
6Qwen3.6-35B-A3B4-bit, Ollama’s MLX engineMy pipeline84-94 tok/s8, 7, 6About 20% faster than OptiQ but lower scores. Removed
7Qwen3.6-35B-A3BPlain 4-bit, MLXMy pipelineabout 88 tok/s6, 8, 6Faster than OptiQ, scores lower
8Qwen3.6-35B-A3BOptiQ 4-bit, MLXMy pipeline, thinking off for the fixes, two servers-7 (1 run)28 minutes, but it broke working code and ran out of memory
9Qwen3.6-35B-A3BOptiQ 4-bit, MLXMy pipeline, tasks split across both Macs77-80 and 68 tok/s6 (1 run)Only 1.3x faster. The MacBook half was the slow one
10Qwen3.6-35B-A3BOptiQ 4-bit, MLX (optiq server)One answer, code mode67-80 tok/s5, 3, 1 then 5Fine for Python and edits, not Swift
11Qwen3.6-35B-A3BOptiQ 4-bit, MLX (optiq server)One answer, fast mode (no thinking)67-80 tok/s3, 3, 4 then 3A few seconds per task. Mechanical edits only
12Qwen3.6-35B-A3BOptiQ 4-bit, MLX (optiq server + MTP)Speed test68 tok/s-Speculative decoding gave +2%. Not worth it
13Qwen3.6-35B-A3BOptiQ 4-bit, mlx-lm direct, greedyOne answer77-80 tok/s4 then 3Gets stuck repeating itself without the right sampling
14Qwen3.8-27B4-bit, MLXOne answer18 tok/s5Dense, so slow. Gets stuck in reasoning loops
15Qwen3.8-27BGGUF Q4_K_XL + MTP, llama.cppSpeed test24.6 tok/snot tested on SwiftMy first setup. A third of the MoE’s speed. Removed
16Qwen3.8-27B4-bit, MLXSplit across both Macs (pipeline parallel)12.4 tok/s-Slower than one Mac
17Qwen3.8-27B8-bit, MLXSpeed test10 tok/s-Too slow to bother
18Qwen3.8-27B4-bit, MLXSplit 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.

ModelDurationQueryIntervalsRomanCSVSemverLuhnWrapInvoiceCoalescerAll 10
Claude Opus 5.511 s8 s9 s11 s12 s18 s6 s10 s20 s19 s2.3 min
Claude Opus 539 s16 s22 s16 s22 s53 s7 s24 s61 s32 s4.9 min
Claude Opus 4.537 s36 s44 s58 s41 s199 s28 s46 s50 s108 s10.8 min
Qwen3.6-35B OptiQ, my pipeline9.4 min8.7 min8.9 min9.5 min8.7 min12.1 min3.8 min9.0 min13.1 min10.4 min97 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:

  1. Qwen3.5-122B split evenly across both Macs - the MacBook ran out of memory.
  2. Magnitude - the model never finished loading.
  3. Qwen3.8-Flash-Next - 177GB, far too big.
  4. 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

  1. On its own, the local model is weak at Swift - 4 out of 10.
  2. The pipeline makes the biggest difference. Same model, 4 goes to 6-9.
  3. 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.
  4. 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.
  5. 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.
  6. Splitting a model that already fits on one Mac across two Macs made it slower, not faster.
  7. 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.
  8. 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.
  9. 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 64GBMac Studio M5 Max 128GB
GPU cores164040
Memory bandwidth307GB/s614GB/s614GB/s
Overnight model67-80 tok/sabout 100-120 tok/s (est.)about 100-120 tok/s (est.)
122B modelneeds 2 Macs, 37 tok/sdoesn’t fitabout 58-66 tok/s (community)

64GB Studio

  1. 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.
  2. 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.
  3. Same 64GB means the same models fit. The scores wouldn’t change.

128GB Studio

  1. 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.
  2. 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.
  3. If I had a 128GB Studio, the 122B would move up to number 4 in my list, above my current daily model.

Summary

  1. Code that has to be right: Opus.
  2. Routine work that can run unattended: Haiku with model routing to Haiku/Sonnet/Opus
  3. 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

← All posts

Get new posts by email