Top 5 Open-Source Coding Models to Run on Your Mac (2026)
Top 5 Open-Source Coding Models to Run on Your Mac (2026)
Apple Silicon Macs are the best local-AI hardware most developers already own. Unified memory means a 32GB M-series machine can hold what would require a 24GB NVIDIA GPU, and the Metal and MLX backends in Ollama, LM Studio, and llama.cpp make setup a single command. The question is no longer "can I run a model locally?" — it is "which model?" This guide ranks the five coding models that make sense on a Mac in 2026, with real pull tags, download sizes, and context windows. All figures are verified against the Ollama library as of August 2026.
How to Read the Rankings
Coding quality on open models is measured by two signals: SWE-bench Verified (can the model resolve a real GitHub issue end to end) and Aider polyglot (can it produce correct diffs across languages). HumanEval is saturated and no longer discriminates. On Macs, the second dimension is memory: unified RAM is shared between weights, KV cache, and your browser, so quality-per-gigabyte decides what fits.
1. qwen3-coder:30b — The Default Pick
| Spec | Value |
|---|---|
| Architecture | 30B MoE, 3.3B active per token |
| Download (Q4_K_M) | 19GB |
| Context | 256K native (1M via extrapolation) |
| License | Apache 2.0 |
| Runs on | 24-32GB GPU or 32GB Mac |
The best quality-per-gigabyte on a Mac. Because only 3.3B parameters activate per token, it has the speed profile of a small model with the quality of a much larger one — on an M3 Max (64GB) under LM Studio, expect comfortably above 20 tokens/sec on code generation. It was trained with long-horizon reinforcement learning on SWE-bench-style agentic tasks, so it shines in the loop coding agents actually run: read a file, search related code, edit across files, run tests. The model card publishes no numeric SWE-bench score; treat unverifiable numbers skeptically, but the agentic behavior is real.
ollama pull qwen3-coder:30b
ollama run qwen3-coder:30b "Find and fix the null pointer in src/auth.ts"
Skip it if: you need a hard, published benchmark number, or you only have 16GB.
2. devstral:24b — The Benchmarked Agent Model
| Spec | Value |
|---|---|
| Architecture | 24B dense |
| Download (Q4_K_M) | 14GB |
| Context | 128K |
| License | Apache 2.0 |
| SWE-bench Verified | 46.8% |
The only local coder with a hard agentic number on its card: 46.8% SWE-bench Verified, ahead of GPT-4.1-mini (23.6%) and Claude 3.5 Haiku (40.6%). Devstral was co-designed with All Hands AI for agent scaffolds, so it slots into OpenHands, Cline, and Aider cleanly. It is also the lightest of the top three on disk at 14GB, which leaves more unified memory headroom for context. The tradeoff: a 24B dense model is slower per token than the 3.3B-active qwen3-coder MoE at the same RAM.
ollama pull devstral:24b
ollama run devstral:24b "Implement the failing test in tests/test_parser.py"
Skip it if: you want the fastest interactive speed, or you need the largest possible context.
3. gpt-oss:20b — The 16GB Laptop Special
| Spec | Value |
|---|---|
| Architecture | 20B MoE, MXFP4 quantized |
| Download | 14GB |
| Context | 128K |
| License | Apache 2.0 |
| Runs on | 16GB of RAM |
OpenAI's open-weights MoE family. The 20B ships natively at MXFP4 (4.25 bits per parameter on the MoE weights), which is why 14GB of download runs on a 16GB machine — no discrete GPU required. On a 16GB MacBook Air, this is the best general-purpose model that fits. For dedicated coding on the same hardware, qwen2.5-coder:14b (9GB, 32K context) is the alternative: it trades context for a stronger code-specific prior.
ollama pull gpt-oss:20b
ollama run gpt-oss:20b "Explain this stack trace and propose a fix"
Skip it if: you have 24GB+ and want the code-specific training of qwen3-coder or devstral.
4. qwen3.6:27b — The Newest Agentic Coder
| Spec | Value |
|---|---|
| Architecture | 27B |
| Download (Q4_K_M) | 17GB |
| Context | 256K |
| License | Apache 2.0 |
| Input | Text + image |
The newest coding family in the Ollama library (added mid-2026), published as an agentic-coding upgrade over the Qwen3 generation. It ships coding-specific quant tags — qwen3.6:27b-coding-nvfp4 at 20GB and qwen3.6:27b-coding-mxfp8 at 31GB — plus MTP tags that Ollama 0.32.6 uses for automatic speculative decoding on Apple GPUs. A 35B tag (24GB) targets 32GB Macs. No numeric SWE-bench score is published on the Ollama card, so this is a quality-by-reputation pick rather than a benchmarked one.
ollama pull qwen3.6:27b
ollama run qwen3.6:27b "Refactor this legacy class to async/await"
Skip it if: you need a measured benchmark, or prefer the MoE speed profile of qwen3-coder:30b.
5. llama3.3:70b — The Ecosystem Workhorse
| Spec | Value |
|---|---|
| Architecture | 70B dense |
| Download (Q4_K_M) | 43GB |
| Context | 128K |
| License | Llama 3.3 Community License |
| Runs on | 64GB+ Mac |
Not a code specialist — on agentic SWE-bench tasks it trails the dedicated coders above — but it is the most widely supported open model in existence. Every runtime supports it, every agent scaffold has been tested against it, and there are quants for nearly every hardware profile. If you want one model that "just works" across RAG, chat, and general coding while you experiment, this is the safe default on a 64GB machine. Expect roughly 5-8 tokens/sec on a 64GB M-series at Q4.
ollama pull llama3.3:70b
Skip it if: your workload is primarily code, or you have less than 64GB.
What About the Others?
- glm-4.7-flash (19GB, 198K context): the newest 30B-class coder in the library; a solid qwen3-coder alternative if you want a dense profile in that class.
- qwen2.5-coder:32b (20GB, 32K context): the prior-generation reference coder; still leads open-source models on multi-language code repair (73.7 Aider repair, 75.2 MdEval) but the 32K context cap shows its age.
- deepseek-r1:32b (20GB, 128K): the reasoning pick for debugging and math-heavy work, but reasoning models emit a thinking trace that adds latency — wrong tool for autocomplete.
- codestral:22b (13GB, 32K): the fill-in-the-middle autocomplete specialist, but ships under the Mistral Non-Production License, so it is a research tool, not a production one.
Picking by Mac Memory
| Mac RAM | Best coding model | Best general model |
|---|---|---|
| 16GB | gpt-oss:20b or qwen2.5-coder:14b | gpt-oss:20b |
| 24GB | qwen3.6:27b / qwen3-coder:30b | gemma4:26b / deepseek-r1:32b |
| 32GB | qwen3-coder:30b / qwen3.6:35b | deepseek-r1:32b |
| 48GB | qwen2.5-coder:32b (q8_0) | llama3.3:70b |
| 64GB+ | qwen3-coder:30b (q8_0) | llama3.3:70b |
Remember: the download size is the floor. Unified memory also pays for the KV cache — a 70B model at 32K context adds ~14GB on top of weights. If your Mac is also running a browser, an IDE, and Docker, budget 8-16GB of headroom.
Implementation Checklist
- Match the model to Mac RAM including KV cache headroom, not just download size
- Prefer qwen3-coder:30b for interactive agentic coding on 32GB+
- Choose devstral:24b when you need a published SWE-bench number
- Use gpt-oss:20b on 16GB machines without a discrete GPU
- Enable the MLX/MTP speculative decoding path in Ollama 0.32.6+ on Apple Silicon
- For code, prefer q8_0 over Q4_K_M when memory allows
- Cap
num_ctxto what the task needs so the KV cache does not steal your model's budget
MatterAI builds frontier AI infrastructure for engineering teams — from inference-optimized models to autonomous coding agents and agentic code reviews.
Explore what we're building:
- Orbital IDE — Autonomous AI coding agent with background agents and deep codebase memory
- AI Code Reviews — Agentic pre-commit reviews across GitHub, GitLab, and Bitbucket
- Axon Models — Frontier-grade reasoning models at 70% lower inference cost
Share this Guide:
More Guides
Local LLMs in Your IDE: Connecting Ollama to Coding Agents and Autocomplete
Wire local models into VS Code, JetBrains, Cline, Continue, and Aider via the OpenAI-compatible API. Covers model routing, context budgets, tool calling with small models, and when a local model is the right choice for the job.
15 min readBuilding a Self-Hosted AI Stack: Ollama, Open WebUI, and Local RAG
Stand up a fully self-hosted AI stack on a single machine: Ollama for inference, Open WebUI as the chat interface, local embeddings for RAG, and a reverse proxy for secure access. No cloud dependency, no data leaving your network.
17 min readRunning LLMs Locally: GGUF, Quantization, and Memory Planning
Learn the GGUF format, the quantization ladder from Q2 to FP16, and the exact memory math for running models on Apple Silicon and NVIDIA GPUs. Includes Ollama and llama.cpp tuning for KV cache and context.
15 min readOllama vs vLLM vs llama.cpp: Choosing the Right Local LLM Runtime
Compare the three dominant local LLM runtimes on architecture, throughput, hardware, and deployment context. Includes benchmark data, a decision framework, and a migration path from Ollama to vLLM.
16 min readModel Context Protocol (MCP): Building MCP Servers from Scratch
Build production-grade MCP servers with the TypeScript and Python SDKs. Covers the MCP architecture, stdio and HTTP transports, tools, resources, prompts, and the security model every AI application needs.
16 min readContinue Reading
Local LLMs in Your IDE: Connecting Ollama to Coding Agents and Autocomplete
Wire local models into VS Code, JetBrains, Cline, Continue, and Aider via the OpenAI-compatible API. Covers model routing, context budgets, tool calling with small models, and when a local model is the right choice for the job.
15 min readBuilding a Self-Hosted AI Stack: Ollama, Open WebUI, and Local RAG
Stand up a fully self-hosted AI stack on a single machine: Ollama for inference, Open WebUI as the chat interface, local embeddings for RAG, and a reverse proxy for secure access. No cloud dependency, no data leaving your network.
17 min readRunning LLMs Locally: GGUF, Quantization, and Memory Planning
Learn the GGUF format, the quantization ladder from Q2 to FP16, and the exact memory math for running models on Apple Silicon and NVIDIA GPUs. Includes Ollama and llama.cpp tuning for KV cache and context.
15 min readShip Faster. Ship Safer.
Join thousands of engineering teams using MatterAI to autonomously build, review, and deploy code with enterprise-grade precision.
