On M4 Mac Mini, the loudest debate in dev groups is rarely “Ollama or MLX” — it is whether 16GB is actually enough. Someone installs qwen2.5:14b, thinks “it runs, good enough,” then swap hits on the third turn and tok/s falls from 11 to 3. Someone bites the bullet on 24GB and sees 7B hit ~50 tok/s — pick the wrong RAM tier and it hurts more than picking the wrong framework.
Macstripe Lab paired three M4 Mac Mini units (16GB / 24GB / 32GB) on Ollama 0.6.2 and MLX, with a memory × use case × framework decision table, swap cliff, and seven-step rollout checklist. Pricing and Apple MSRP as of 2026-07-21. For model-tier detail see 7B vs 14B lab benchmarks; for framework layer see Ollama vs MLX.
1. Conclusion first: memory tier × use case × recommended stack
| Unified memory | Typical use | Recommended model | Runtime | Measured tok/s (median) | Risk |
|---|---|---|---|---|---|
| 16GB | Personal chat, light scripts, local trial | qwen2.5:7b / llama3.1:8b | Ollama | 7B ~29 · 8B ~28.8 | 14B swaps easily; Chrome + IDE together breaks it |
| 24GB | Claude Code Agent, cross-file coding | qwen2.5-coder:14b | Ollama | 14B ~15.1 · 7B ~51.1 | Sweet spot; 14B decode still slower than 7B — normal |
| 32GB | Large ctx + Xcode on same machine, light team node | 14B + num_ctx 32K | Ollama serve | 14B ~16–18 | Costs more than 24GB; personal ROI needs math |
| 48GB+ | Shared inference, 32B exploration | qwen2.5:32b (Q4) | Ollama serve cluster | 32B ~8–12 | See M4 Pro deployment guide |
2. Three traps: why memory beats framework
In the Lab we keep seeing three “thought I picked right, actually ran out of RAM” patterns:
| Trap | Typical symptom | Measured numbers | Fix |
|---|---|---|---|
| Leaderboard tok/s only | Web says 14B “runs 15 tok/s”; yours is 3 | 14B on 16GB: 11.2 → 8.4 → 3.4 tok/s (three-run decay) | Check Swapins; lists often measured on clean 24GB |
| Ignoring background apps | “I only run Ollama” but 30 Chrome tabs + Xcode indexing | 8B clean 28.8 tok/s → with Chrome 20.8 (excluded from median) | Close tabs before benchmarking; budget 4–6GB for OS + IDE |
| Framework vs memory confusion | Switch to MLX to “save RAM” for 14B | Same model Ollama vs MLX memory delta <5% | Framework is a few percent; tier is an order of magnitude |
One indie dev put it well: “16GB, Claude Code + qwen2.5-coder:14b — first two rounds OK, third round TTFT went from 1.9s to 5.8s.” That is not the model getting dumber — it is unified memory entering the swap zone. Theory: Unified memory & LLM inference.
3. Form factor: 16GB / 24GB / 32GB boundaries
Base M4 Mac Mini offers three unified memory tiers; GPU is 10-core, bandwidth ~ 120 GB/s. GB count does not raise L2 bandwidth cap, but decides whether model + KV + foreground apps stay resident without L3 pressure collapse.
3.1 Memory budget formula (estimate)
| Item | 7B Q4 | 14B Q4 | Notes |
|---|---|---|---|
| Quantized weights | ~4.5 GB | ~9 GB | Ollama default Q4_K_M |
| KV cache (num_ctx=2048) | ~0.5 GB | ~1 GB | Scales linearly with ctx |
| macOS + foreground | 4–6 GB | 4–6 GB | Chrome/IDE each 1–3 GB |
| Ollama daemon | ~0.3 GB | ~0.3 GB | Resident HTTP service |
| Total (rough) | ~10 GB | ~15 GB | 16GB + 14B leaves almost no headroom |
3.2 Three tiers: stable / marginal / avoid
| Memory | 7B/8B | 14B | 32B | Notes |
|---|---|---|---|---|
| 16GB | ✅ Stable | ⚠️ Swap-prone | ❌ | Light personal default |
| 24GB | ✅ Very fast | ✅ Sweet spot | ⚠️ Tight | Agent / coding recommended |
| 32GB | ✅ | ✅ Large ctx | ⚠️ Q4 worth trying | CI + LLM same box |
If your main workload is “Claude Code + 14B on this Mac,” 24GB is the best value upgrade — not linear “+8GB = +8 tok/s,” but delaying swap so 14B moves from collapse zone to stable zone. Full methodology: M4 local LLM hub benchmarks.
4. Config: Ollama vs MLX memory footprint (measured)
Many assume MLX is “more native” so it uses less RAM — measurements say otherwise. Same model and quantization: weight and KV footprint are nearly identical; difference is runtime architecture, not GB count.
| Compare | Ollama | MLX | Measured delta |
|---|---|---|---|
| Model weights (Llama 3.1 8B Q4) | ~4.9 GB | ~4.8 GB | Negligible |
| Resident process | ~200–400 MB (daemon) | On-demand load, no daemon | Ollama slightly higher |
| tok/s (16GB clean 8B) | median ~28.8 | ~28–32 | MLX 0–12% faster (offline) |
| tok/s (24GB clean 8B) | median ~51.2 | ~52–55 | Gap narrows |
| Claude Code wiring | ✅ Native :11434 | ❌ Roll your own HTTP | Agents → Ollama |
| After swap triggers | 11.2 → 3.4 tok/s | Same tier, same collapse | RAM tier decides everything |
Need 14B remotely without upgrading your desk machine? Try a week on a Macstripe 24GB cloud node, validate Agent workflow, then decide whether to buy the RAM bump.
5. Lab data: tok/s, TTFT, and swap cliff
Test environment: Mac Mini M4 (Mac14,3), macOS 15.4.1, Ollama 0.6.2, default Q4_K_M. Machine IDs m4-16gb-lab-01, m4-24gb-lab-02. Period 2026-05-28 through 2026-07-18.
5.1 16GB: 7B stable vs 14B collapse
| Model | run 1 | run 2 | run 3 | median | Swapins |
|---|---|---|---|---|---|
| qwen2.5:7b | 28.7 | 31.4 | 26.9 | 29.1 | 0 |
| qwen2.5:14b | 11.2 | 8.4 | 3.4 | — (session aborted) | 8421+ |
14B on 16GB is not “a bit slower” — it is a three-phase collapse: run 1 OK → run 2 swap starts → run 3 memorystatus: WARN → runner OOM killed.
5.2 24GB: 14B enters the sweet spot
| Model | tok/s five runs | median | TTFT | Swapins |
|---|---|---|---|---|
| qwen2.5:7b | 49.2 / 53.8 / 51.1 / 48.6 / 52.4 | 51.1 | ~2.0s | 0 |
| qwen2.5:14b | 14.2 / 16.8 / 15.1 / 17.3 / 14.9 | 15.1 | ~2.7s | 0 |
5.3 Raw log excerpt
--- m4-16gb-lab-01 · qwen2.5:14b ---
run 1: tok/s=11.2 TTFT=2.71s
run 2: tok/s=8.4 Swapins: 1204
run 3: tok/s=3.4 memorystatus: WARN TTFT=5.81s
run 4: ERROR runner killed (oom?) Swapins: 8421
--- m4-24gb-lab-02 · qwen2.5:14b ---
tok/s: 14.2 16.8 15.1 17.3 14.9 median: 15.1
Full log: resources/sample-benchmark-7b-14b-run.log; reproduce script: resources/benchmark-m4-mac-mini-ollama.sh.
6. Channel: buy the RAM bump vs rent cloud Mac
| Path | Who it fits | Pros | Cons |
|---|---|---|---|
| Buy upgrade (16→24GB) | Local Agent several times a week, long offline runs | One-time spend; data stays on device | Apple RAM upgrades are expensive; tied to one desk |
| Cloud Mac by day/month | Try 14B, peak jobs, team node | Live in minutes; pick 24GB/48GB on demand | Needs network; long-term ROI math |
| Hybrid: 16GB local + 24GB cloud | Daily 7B local, heavy tasks in cloud | Flexible cost; peaks without swap | Two environments to maintain |
One iOS + AI stack dev runs hybrid: 16GB local 7B for completions, Claude Code heavy jobs SSH to Macstripe 24GB running 14B — ~$103/month, more predictable than the buy-time RAM delta. Rental benchmark: Same Mac mini M4 rental quotes compared.
7. Upgrade price delta: what extra RAM costs
| Upgrade path | Apple delta (approx.) | Cloud monthly delta (approx.) | When it pays |
|---|---|---|---|
| 16GB → 24GB | +$200 (at purchase) | +~$30–50/mo | 3+ times/week 7B “edits wrong” |
| 24GB → 32GB | +$200 | Varies by provider | Xcode CI + 14B same machine |
| 16GB → 48GB (M4 Pro) | New machine | Macstripe 48GB node | Team share / 32B exploration |
ROI sketch: If 7B quality costs you 2 extra hours/week (at ~$50/h), that is ~$400/month — already above the typical 16→24GB Apple delta. RAM tier is often the cheapest effective upgrade, more than framework swaps or prompt tuning.
8. Checklist and seven-step rollout
Before ordering or imaging, align expectations:
- ☐ Main use is chat (7B enough) or Agent coding (lean 14B)
- ☐ Will you run 20+ Chrome tabs + IDE together
- ☐ Need Claude Code / Cursor local model wiring
- ☐ Runtime: Ollama (Agent) or MLX (benchmark only)
- ☐ Always local or peak jobs in cloud
- ☐ Budget covers 16GB / 24GB / 32GB which tier
- ☐ Team sharing need (→ 24GB+ or cloud node)
- ☐ Accept swap risk (16GB + 14B = high risk)
Seven steps (Ollama path)
- Confirm RAM tier and target model (16GB→7B; 24GB→14B)
- Install Ollama:
brew install ollamaor official pkg - Pull model:
ollama pull qwen2.5-coder:7b(16GB) or:14b(24GB) - Verify Metal:
ollama servelog showsggml_metal_init - Run benchmark:
./resources/benchmark-m4-mac-mini-ollama.sh - Watch memory:
vm_stat+ Activity Monitor pressure gauge - Wire Agent: point Claude Code at
http://127.0.0.1:11434
9. Citable starting prices (as of 2026-07-21)
| Config | Apple MSRP (USD) | Education (approx.) | Macstripe cloud monthly (USD) |
|---|---|---|---|
| M4 Mac Mini 16GB / 256GB | $599 | ~$539 | ~$102.9 |
| M4 Mac Mini 24GB / 256GB | $799 | ~$719 | ~$130–150 (node-dependent) |
| M4 Mac Mini 32GB / 256GB | $999 | ~$899 | Quote / custom |
| M4 Pro 48GB (inference node) | $1,399+ | Config-dependent | See pricing page |
Apple prices from public store listings; education pricing requires eligibility; cloud rates per Macstripe pricing page at time of order.
10. Scenario picks: who should buy which tier
| Audience | Recommended RAM | Model + framework | Alternative |
|---|---|---|---|
| Student / curious | 16GB | 7B + Ollama | Rent cloud by day to try 14B |
| Indie dev + Agent | 24GB | 14B + Ollama | 16GB local + 24GB cloud hybrid |
| iOS dev + local LLM | 32GB | 14B + Xcode same box | Split CI and inference across two machines |
| Small team inference node | 48GB | ollama serve cluster | Macstripe 48GB node |
Not sure 24GB is enough? Rent a cloud Mac for a week and run your real Agent workflow — more reliable than ten benchmark articles. Macstripe SSH/VNC direct, ~5 minutes to live, no long contract — then decide buy vs rent.
FAQ
M4 Mac Mini for local LLMs: 16GB or 24GB?
Daily 7B/8B + light IDE: 16GB. Stable 14B, Claude Code Agent, or many browser tabs: 24GB. Forcing 14B on 16GB measured tok/s from 11.2 down to 3.4.
Which uses more memory — Ollama or MLX?
Same model and quantization: usually under 5% apart. Bottleneck is unified memory tier, not framework name. Agents → Ollama.
Is 32GB worth it over 24GB?
Personal 14B + standard ctx: 24GB is usually enough. 32GB fits Xcode CI + LLM on one machine or larger num_ctx.
How do I know I'm out of memory?
Memory pressure gauge, vm_stat Swapins climbing, tok/s cliff. memorystatus WARN is the pre-swap signal.
Can I rent a cloud Mac for local LLMs without buying hardware?
Yes. Macstripe 16GB/24GB/48GB dedicated M4 nodes — SSH in, install Ollama, good for trying 14B or a team inference node.
Summary
On M4 Mac Mini, RAM tier is a veto vote: 16GB for 7B + Ollama personal trial; 24GB is the 14B Agent sweet spot; 32GB for CI + large context on one machine. Ollama vs MLX memory gap is negligible — pick framework by scenario (Agent → Ollama, benchmarks → MLX).
Still forcing 14B on 16GB? Read 7B vs 14B lab benchmarks for swap data, or try a 24GB cloud Mac for a week of real workflow before you decide.