The best open-source coding models in 2026
Open models have caught up fast. Here are the strongest ones for coding, what hardware each needs, and the licence terms that matter.
"Open-source" coding models are, strictly, open-weight models: anyone can download and run them, usually under a licence that allows commercial use. In 2026 the best of them are genuinely capable coders, and several run on an ordinary laptop or desktop. Here's what to look at.
Benchmark scores below are reported by each model's developer, not independently verified. Sizes are Ollama's download sizes for its default versions, checked in November 2026.
Models you can run on a laptop or desktop
| Model | Size | Download | Licence | Notes |
|---|---|---|---|---|
| Qwen3.8-27B (Alibaba) | 27B | ~18 GB | Apache 2.0 | Strong all-round coder; long context |
| Devstral Small 2 (Mistral) | 24B | ~15 GB | Apache 2.0 | Built for coding agents; 68% on SWE-bench Verified (reported) |
| Gemma 4 (Google) | E2B to 31B (five sizes) | ~5 to 20 GB | Apache 2.0 | Sizes for every machine, from small laptops up |
| gpt-oss-20b (OpenAI) | 21B (3.6B active) | ~14 GB | Apache 2.0 | Quick for its size; tight on 16 GB, comfortable on 24 to 32 GB |
| Qwen3-Coder-Next (Alibaba) | 80B (3B active) | ~52 GB | Apache 2.0 | Coding specialist; 96 to 128 GB is comfortable |
Qwen3.8-27B
Alibaba's 27-billion-parameter model is one of the strongest open models in this size range, with a context window of over 260,000 tokens. Alibaba reports 61.7 on SWE-bench Pro and 90.3 on LiveCodeBench v6. At around 18 GB, it suits a Mac or PC with 32 GB of memory.
Devstral Small 2
Mistral's 24B model is designed for agentic coding, the kind of multi-step work tools like Claude Code do. Mistral reports 68% on SWE-bench Verified, and says it can run on a single GPU.
Gemma 4
Google's Gemma 4 comes in five sizes, from tiny models for small laptops to a 31B model that Google reports at 80.0 on LiveCodeBench v6. The middle sizes (12B and the 26B mixture-of-experts model) are a good balance of quality and speed.
gpt-oss-20b
OpenAI's open-weight model uses a mixture-of-experts design, so only 3.6B of its 21B parameters are active per token, making it quick for its size. OpenAI says it runs within 16 GB of memory, but at about 14 GB to download it's tight on a 16 GB Mac; 24 to 32 GB is more comfortable. Its larger sibling, gpt-oss-120b, fits on a single 80 GB GPU.
Qwen3-Coder-Next
A coding specialist with 80B parameters but only 3B active at a time, so it's fast once loaded. Alibaba reports 70.6 on SWE-bench Verified. The catch is size: about 52 GB. A 64 GB Mac is the bare minimum and needs a short context and a raised GPU memory limit; 96 to 128 GB is comfortable.
Models that need servers
The very largest open models now rival top proprietary ones on coding benchmarks, but they need far more memory than a laptop has, typically servers or the largest workstations. Examples include DeepSeek-V4-Flash (284B parameters, MIT licence), GLM-5.3 (753B, custom licence), Kimi K3 (2.8 trillion parameters, custom licence) and Mistral's Devstral 2 (123B, which Mistral says needs at least four H100-class GPUs). Some are offered through hosted services, including Ollama's cloud, but at that point your code is going to a server again.
Check the licence
Most of the models above use Apache 2.0, which allows commercial use. Not all open models do: Mistral's older Codestral-22B is licensed for non-production use only, and several large models use custom licences with conditions. Read the licence for the exact model and version you use.
How to choose
- 16 GB of memory: a smaller Gemma 4 (E4B or 12B).
- 32 GB: Qwen3.8-27B, Devstral Small 2, Gemma 4 31B or gpt-oss-20b, with a modest context length.
- 96 to 128 GB: Qwen3-Coder-Next (64 GB at a squeeze).
See what computer you need to run local AI and how to run one.
Using open models in Nexus
Nexus, a native Mac app for building with AI, lets you download open models inside the app and run them on its built-in MLX engine, or use models you already have in Ollama. You can switch to Claude Code by Anthropic or the Codex app by OpenAI for the hardest tasks in the same chat. Nexus will be a one-time purchase of $199 USD with no Nexus subscription. Connecting third-party AI services such as Claude Code or Codex is optional and at your own expense (see Nexus pricing). It's for Apple silicon Macs (macOS 12 or later; local models and the Codex app need 14 or later, Claude Code 13 or later) and is coming soon.
Frequently asked questions
What is the best open-source coding model I can run on a laptop?
For laptops with 32 GB of memory, Qwen3.8-27B, Devstral Small 2 (24B), Gemma 4 31B and gpt-oss-20b are strong choices, with downloads of about 14 to 20 GB. Smaller Gemma 4 sizes suit 16 GB machines.
Are open-source coding models free for commercial use?
Many are. Qwen3.8, Gemma 4, Devstral Small 2 and gpt-oss use Apache 2.0. Some are not: Mistral's Codestral-22B licence limits it to non-production use, and several large models use custom licences. Always read the licence of the exact model.