What's the Best Local LLM to Run on Mac Mini M4 with 24-32GB RAM?
When I first got my Mac Mini M4 with 24GB of RAM, excited to run local LLMs, I fired up Ollama and tried pulling Llama 3.1 70B. It downloaded for 30 minutes, then crashed with an out-of-memory error. My enthusiasm quickly turned to frustration.
Turns out, choosing the right model for your memory constraints isn’t straightforward. And the model landscape moves fast: since the first version of this guide, Gemma 3, gpt-oss-20b, and Qwen3/Qwen3-Coder have become the open-weight models I’d actually recommend on a 24GB or 32GB Mac Mini M4. This is the August 2026 update.
One note on data before we start: memory figures below are approximate Q4_K_M file sizes from the Ollama library (public data), and speed expectations are theoretical estimates derived from Apple’s published memory-bandwidth spec — not from lab benchmarks. Where I talk about my own experience, I say so explicitly.
The Memory Math Problem
The first thing I had to understand: your “24GB” isn’t really 24GB available for models.
Total RAM: 24 GBmacOS overhead: ~4-6 GBRunning apps: ~2-4 GBContext window: ~2-4 GB (depends on usage)━━━━━━━━━━━━━━━━━━━━━━━━━━━Available for model: ~8-14 GBOn a 32GB machine you get roughly 18-22GB for the model — enough for 27-32B models at 4-bit, but only if you close memory-hungry apps first.
This is why the 70B model failed spectacularly, and why even 12-14B models need 4-bit quantization to fit comfortably.
Quick Picks: 24GB vs 32GB
If you only read one section, read this one. These are my picks as of August 2026, based on what’s currently on Ollama and what fits comfortably at 4-bit quantization. Rankings shift as new models drop — verify sizes on the Ollama library page before pulling.
In one line: 24GB → start with gemma3:12b; 32GB → start with qwen3:32b (or gemma3:27b if you want more headroom).
24GB Mac Mini M4
| Category | Model | Approx. RAM (Q4_K_M) | Why |
|---|---|---|---|
| Best General | gemma3:12b | ~8 GB | Best quality-per-GB for chat and writing |
| Best Coding | qwen2.5-coder:7b | ~4.7 GB | Strong code with room for context |
| Best Reasoning | gpt-oss:20b | ~14 GB | 20B model with a dedicated reasoning mode |
| Fastest | qwen3:4b | ~2.5-3 GB | Instant-feeling responses |
| Largest Practical Model | gpt-oss:20b | ~14 GB | Biggest model that fits; close other apps |
32GB Mac Mini M4
| Category | Model | Approx. RAM (Q4_K_M) | Why |
|---|---|---|---|
| Best General | qwen3:32b | ~19-20 GB | Strongest all-rounder that fits; close other apps |
| Best Coding | qwen3-coder:30b-a3b | ~19 GB | MoE: near 32B-class quality, potentially faster decode |
| Best Reasoning | deepseek-r1:32b | ~19-20 GB | Long chain-of-thought for hard problems |
| Fastest | qwen3:4b | ~2.5-3 GB | Speed depends on model size, not RAM |
| Largest Practical Model | qwen3:32b | ~19-20 GB | About the practical ceiling on 32GB |
What Actually Fits: 24GB RAM Edition
Gemma 3 12B (Q4_K_M) - Best General Default
ollama pull gemma3:12bAt ~8GB this is the best quality-per-GB general model for 24GB right now. It’s noticeably better at instruction-following and writing than 8B-class models, and it leaves room for a decent context window. Good for: chat, drafting, analysis, everyday work. (If you prefer Qwen’s style, qwen3:14b at ~9GB is a comparable alternative.)
Qwen2.5-Coder 7B (Q4_K_M) - Best Coding
ollama pull qwen2.5-coder:7b~4.7GB. Qwen2.5-Coder is a dependable pick for code on a 24GB machine: completion, debugging, refactoring, and explanation, with plenty of headroom for long file context.
gpt-oss-20b (Q4_K_M) - Best Reasoning / Largest Practical
ollama pull gpt-oss:20b~14GB — the biggest model I’d run on 24GB, and only with other apps closed and a modest context window. OpenAI’s open-weight 20B has a built-in reasoning mode, which makes it a strong choice here for logic, math, and multi-step tasks. Expect slower generation than the 8-12B models; keep the context window moderate.
Llama 3.1 8B (Q4_K_M) - Still a Reliable Fallback
ollama pull llama3.1:8b~5GB. Older than the models above, but it’s the one I’ve run as a daily driver since day one, and it remains a dependable, fast general-purpose model. If a newer model doesn’t behave the way you need, this is a safe fallback.
Qwen3 4B (Q4_K_M) - Fastest
ollama pull qwen3:4b~2.5-3GB. Use it for quick queries while other apps are open, or as a companion model that never threatens your memory budget. Fastest of the group.
What Fits: 32GB RAM Edition
Note: gpt-oss:120b is impressive but needs ~67GB+ even at Q4 — out of reach for a 32GB Mac.
Qwen3 32B (Q4_K_M) - Best General / Largest Practical
ollama pull qwen3:32b~19-20GB. On 32GB this is the strongest all-rounder that fits: general chat, writing, and analysis, with an optional “thinking” mode. It’s tight — close your browser before loading it and keep context moderate. This is the model that replaces the old “Mistral Small 24B, pushing the limit” scenario from the earlier version.
Qwen3-Coder 30B-A3B (Q4_K_M) - Best Coding
ollama pull qwen3-coder:30b-a3b~19GB. A Mixture-of-Experts model: ~30B total parameters but only ~3B active per token, so it may decode faster than a dense 30B while keeping coding quality near 32B-class. Best coding pick on 32GB.
Gemma 3 27B (Q4_K_M) - General With Headroom
ollama pull gemma3:27b~16-17GB. Slightly lower ceiling than Qwen3 32B but leaves more RAM free — useful if you want a strong general model plus a bigger context window or other apps open at the same time.
DeepSeek-R1 32B (Q4_K_M) - Reasoning Specialist
ollama pull deepseek-r1:32b~19-20GB. The R1 distill line is built for long chain-of-thought reasoning. If your work is heavy math, logic, or deep analysis, this is the reasoning pick for 32GB.
Estimated Generation Speed
These are theoretical estimates based on the base Mac Mini M4’s ~120 GB/s memory bandwidth — not measured benchmarks. The earlier version of this article presented speeds as if they were my own measurements — I can’t stand behind those numbers, and neither should you. Here’s what I can give you with an actual basis:
- Model sizes: approximate Q4_K_M file sizes from the Ollama library (in-memory use is a bit higher once context is added). Always confirm with
ollama show <model>. - Speed expectations: derived from the base Mac Mini M4’s ~120 GB/s unified-memory bandwidth (Apple’s public spec; the M4 Pro is roughly 2x that). Decode speed can’t meaningfully exceed bandwidth ÷ model-size-in-GB, and real-world throughput is usually lower once context (KV cache) and thermals are factored in.
| Model | Q4_K_M size | Approx. speed ceiling ||-----------------------|-------------|-----------------------|| qwen3:4b | ~2.7 GB | ~40-45 t/s || llama3.1:8b | ~4.9 GB | ~20-25 t/s || qwen2.5-coder:7b | ~4.7 GB | ~20-25 t/s || gemma3:12b | ~8 GB | ~15 t/s || gpt-oss:20b | ~14 GB | ~8-9 t/s || gemma3:27b | ~16.5 GB | ~7 t/s || qwen3:32b | ~19.5 GB | ~6 t/s || qwen3-coder:30b-a3b | ~19 GB | potentially faster (MoE, ~3B active) |Real-world generation is typically below these ceilings. If you see blog posts claiming 50-80 t/s on a base M4 for an 8B model, treat them with suspicion.
On Apple Silicon, always confirm GPU/Metal acceleration is active — CPU-only inference is dramatically slower. Ollama uses Metal automatically; watch Activity Monitor’s GPU column while generating.
Installation Options
Option 1: Ollama (Recommended)
# Installcurl -fsSL https://ollama.ai/install.sh | sh
# Pull a model and run it (Metal GPU is automatic)ollama pull gemma3:12bollama run gemma3:12bThat’s the whole setup. Ollama handles GPU acceleration and quantization tags for you.
Option 2: LM Studio
Prefer a GUI? Download from lmstudio.ai, search for the model name, pick a Q4_K_M file, and hit “Chat”. It shows live memory usage, which is handy for tuning context length.
OpenClaw + Ollama
Point OpenClaw at your local server with export OLLAMA_HOST="http://localhost:11434" and it uses whatever model you have running. Nothing else to configure.
Common Mistakes I Made
Mistake 1: Choosing the Largest Model That “Fits”
I initially thought “24GB RAM, so I can use a 20GB model!” Wrong.
WRONG:Model size: 19 GB (qwen3:32b on a 24GB Mac)System + apps: -8 GBAvailable: -3 GB (negative!)Result: CRASH / swap thrash
RIGHT:Model size: 8 GB (gemma3:12b)System + apps: -8 GBContext: -4 GBResult: ~4 GB headroom, smoothLeave at least 30-40% of RAM free for context and system overhead.
Mistake 2: Ignoring Quantization
I once downloaded an FP16 version of a model and it used 2x the memory for a barely noticeable quality gain.
# FP16 (full precision) - usually not worth it on a Macollama pull gemma3:12b-fp16 # ~24 GB, won't fit a 24GB Mac
# Q4_K_M (4-bit) - do thisollama pull gemma3:12b # ~8 GBQ4_K_M gives you most of the quality for a fraction of the memory. Q5_K_M is slightly better but costs more RAM; for 24-32GB Macs, Q4_K_M is a good default.
Mistake 3: Not Verifying Metal Acceleration
I ran models for a week before realizing GPU acceleration wasn’t active:
# Generate some text, then in another terminal:sudo powermetrics --samplers gpu_power -i 1000If GPU power stays near zero while generating, acceleration isn’t working — check that your Ollama/LM Studio build is the Apple Silicon (arm64) version.
Mistake 4: Wrong Model for the Task
WRONG: Use a general 8B model for complex code refactoringRIGHT: Use Qwen2.5-Coder or Qwen3-Coder for code tasks
WRONG: Use a code model for creative writingRIGHT: Use Gemma 3 or Qwen3 for general tasksSpecialized models beat general ones in their domain, even at similar sizes.
My Recommended Setup
Here’s what I’d install today on 24GB:
general: gemma3:12b # Best all-roundercoding: qwen2.5-coder:7b # Code completion and reviewreasoning: gpt-oss:20b # Hard problems, loaded on demandfast: qwen3:4b # Quick queries, runs alongside appsHaving multiple models installed only costs disk space, not memory — load the one you need for the task.
Final Setup Checklist
# 1. Check available memoryvm_stat | head -5
# 2. Verify Metal GPU supportsystem_profiler SPDisplaysDataType | grep "Metal"
# 3. Install Ollamacurl -fsSL https://ollama.ai/install.sh | sh
# 4. Pull your first modelollama pull gemma3:12b
# 5. Test it worksollama run gemma3:12b "Hello, are you running on Metal?"
# 6. Monitor resources while running (in another terminal)top -l 1 | grep -E "PhysMem|GPU"Key Takeaways
- 24GB RAM: Best all-rounder is Gemma 3 12B; code is Qwen2.5-Coder 7B; reach for gpt-oss-20b when you need reasoning
- 32GB RAM: Qwen3 32B, Qwen3-Coder 30B-A3B, or DeepSeek-R1 32B — close other apps first
- Q4_K_M quantization is a good default for the size/quality tradeoff
- Leave 30-40% RAM free for context and system
- Match model to task: code models for code, general for general, reasoning models for hard problems
- Metal acceleration is critical: verify it’s working
- Verify sizes yourself:
ollama show <model>beats trusting any blog table, including this one
Local LLMs on Mac Mini M4 are genuinely useful. They’re not replacing frontier cloud models for every task, but for day-to-day work, privacy-sensitive projects, and high-volume usage, they’re fantastic. Start with Gemma 3 12B (or Qwen3 4B if you want to feel speed first), confirm it meets your needs, and expand from there.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments