What I measured running Qwen2.5-Coder 1.5B and 7B at 4 bits with MLX on an 18 GB M3 Pro, and what those numbers don't say
Published: November 9, 2026
Reading time: 9 min
Series: lemon-code in 30 days, part 10 of 13
With 8K tokens of context, the 7-billion-parameter model took 88 seconds to emit its first token on my MacBook. The 1.5-billion one took 24.
I still picked the bigger one for upcoming training. This post covers the benchmark I ran in lemon-model, the local coding-model lab I started in September, explains the choice, and is explicit about what these numbers don't prove.
Two cars. A nimble hatchback that's quick off the line. A van that's slower to start and built for larger loads. For a bakery run, the hatchback may be enough. For moving house, the van makes more sense. The small model is the hatchback; the big one is the van. The real question is what task you're giving it.
pip install mlx-lm
mlx_lm.generate \
--model mlx-community/Qwen2.5-Coder-1.5B-Instruct-4bit \
--prompt "Write a Python function that checks if a string is a palindrome."
That installs mlx-lm, downloads the 4-bit model and generates using the Mac's unified memory. That's where lemon-model started.
The benchmark runs five cases on both models with a fixed seed and five measurements per case in each of two phases: cold and warm. That's 50 measurements per candidate. The warm phase includes one warm-up before its measured runs. Recorded environment: Apple M3 Pro, 18 GiB unified memory, macOS 26.5.2, Python 3.12.12, MLX 0.32.2, mlx-lm 0.31.3.
Warm-phase medians:
| Case | L1 first token | L1 tokens/s | L2 first token | L2 tokens/s |
|---|---|---|---|---|
| short chat | 104 ms | 109.6 | 236 ms | 26.9 |
| 2K context | 4.2 s | 89.7 | 18.0 s | 24.7 |
| 8K context | 23.7 s | 62.6 | 88.2 s | 20.0 |
| fill-in-the-middle | 148 ms | 94.8 | 348 ms | 27.1 |
| agent loop | 121 ms | 104.7 | 248 ms | 26.3 |
Peak MLX allocator usage: 916–2,159 MiB for L1, 4,207–5,757 MiB for L2. That's allocator memory, not total process usage. The final L1 run took 604 s; L2 took 2,156 s. Two earlier L2 attempts failed under tighter time limits, and both failures were kept as immutable reports.
For LoRA adaptation (next post), capacity matters more than latency. L2 has 7B parameters and public same-family evidence. L1 stays as the low-latency fallback.
The report states the limits: this choice rests on inference performance. It doesn't prove training fits in memory, that LoRA will work, that code quality is good, or that any model is production-ready. Neither of these is a lemon-model-trained model.
/Volumes.In lemon-code's router (post 4), the mlx provider only competes if the machine is Apple Silicon, the local server responds, the active profile's model appears in /v1/models and the resource check doesn't block. Readiness before score, applied to the local model.
A local coding model on the Mac is viable, with numbers you can measure and audit. The small one answers fast; the big one carries more. What the benchmark can't tell you is whether either writes good enough code. That question is called evaluation, and it gets its own post.
Wednesday: LoRA and QLoRA with MLX, and what happened when I tried to train the 7B on an 18 GB Mac.
If your team is evaluating local models for code or data that can't leave the company, I help design benchmarks like this at LEMON.DEV.
Free and paid products to turn ideas into a foundation you can actually ship.
13 products availableContinue exploring similar topics
My first attempts to train the 7B on the Mac hit the memory safety cutoff, even with MLX under 14 GB. The pilot that passed used 8 layers, rank 4 and finished in 200 seconds.
An answer with 'if n == 20: return 6765' passes every Fibonacci test. In lemon-model it scores zero. Here's the rest of the system that keeps hype from becoming a release.
448 CLI commits, 152 app commits, 268 model-lab commits, 67 ADR documents across 57 IDs and no promoted model. The series wrap-up, real data only.
A practical checklist to validate security, cost, evals, and observability before you ship your AI app to production.
Production-tested templates trusted by developers. Save weeks of setup on your next project.