Most "best LLMs for coding" articles are a ranking of hosted proprietary models plus a grudging mention of DeepSeek. This one ranks open-source and hosted models on the same rubric because, for a lot of real-world code, the best answer runs on your own laptop. We compare published HumanEval pass@1 figures, and whether you can use the model without sending your proprietary codebase to a third party.
Short version: Claude 3.5 Sonnet has the highest HumanEval score of the hosted models in Anthropic's comparison table (92.0%, 0-shot). Qwen 2.5 Coder 32B has the highest HumanEval pass@1 of the open-weights models on this list (92.7% in the Qwen2.5-Coder report). For a 16 GB laptop, Qwen 2.5 Coder 14B leads our local coding ranking. Scroll down for the full ranking, or jump to the summary table.
PocketLLM is launching soon. Private, on-device AI, starting on iPhone, with more platforms planned. No account required, no in-app tracking, and chat processing stays on your device. Join the launch list and be first in.
How we compared
HumanEval pass@1 figures in the summary table are the values that each publisher reports for the named model version, except GPT-4o, whose figure is the one in Anthropic's model card addendum. Each row links its source. The figures come from different evaluation runs, and Table 16 of the Qwen2.5-Coder report gives lower values for some models, for example 85.4% for DeepSeek-Coder-V2-Instruct, 67.7% for StarCoder2-15B-Instruct-v0.1 and 40.2% for CodeLlama-13B-Instruct. A head-to-head comparison in the text uses one source that reports both models. The three hosted models keep editorial places; the open-weights models are ordered by the HumanEval pass@1 figure in the summary table, and a tie keeps the earlier order. Everything else is our editorial judgement.
- HumanEval pass@1: The standard benchmark, as published in the source that each table row links. Useful for a rough tier, poor at predicting day-to-day usefulness.
- Context handling: The published context window, which sets the ceiling on how much of a codebase fits in one prompt.
- Privacy: Whether you can run the model without sending code to an external party. This is the one property that is structural rather than a matter of degree.
- License: Whether the weights permit commercial use, taken from the model repository.
The 15 best coding LLMs in 2026
1. Claude 3.5 Sonnet
Anthropic reports 92.0% on HumanEval (0-shot), ahead of GPT-4o (90.2%) and Gemini 1.5 Pro (84.1%) in the same table of its model card addendum. The tradeoff is that it's a hosted proprietary model, and you cannot run it locally or on-device. If your code is confidential, read on.
2. GPT-4o
OpenAI's flagship. Slightly behind Sonnet on HumanEval in Anthropic's comparison table (90.2% vs 92.0%). Same caveat as Sonnet: hosted, proprietary, sends your code to OpenAI.
3. Qwen 2.5 Coder 32B
On this list, it has the highest HumanEval pass@1 of the open-weights models, and it is the highest-ranked model that you can actually run yourself. Apache 2.0 license, 32B parameters (a 20 GB file at Q4 that needs 32 GB of RAM). In Table 16 of the Qwen2.5-Coder technical report, Qwen2.5-Coder-32B-Instruct scores 92.7% HumanEval pass@1, against 89.0% and 92.1% in Qwen's table for the June and October 2024 versions of Claude 3.5 Sonnet (for the June version, Anthropic's own model card addendum reports 92.0%). If you have a Mac Studio or a gaming PC, this is the local coding model.
4. DeepSeek Coder V2 236B
The full 236B mixture-of-experts model. DeepSeek reports 90.2% HumanEval pass@1 for DeepSeek-Coder-V2-Instruct in its paper. You probably can't run it — it needs a multi-GPU workstation. We list it because the smaller Lite variant (#8) inherits most of its smarts and is much more practical.
5. Gemini 1.5 Pro
Google's long-context model. Its headline feature is a context of 2M+ tokens, as stated in the Gemini 1.5 report, which means you can paste a small codebase and ask questions that span files. On HumanEval it is a step below Sonnet and GPT-4o in Anthropic's comparison table (84.1% vs 92.0% and 90.2%).
6. Llama 3.3 70B
Meta's 70B instruction-tuned model, released in December 2024 (model card). Not a dedicated coding model, but smart enough to handle most tasks well. Needs serious hardware (64 GB+ of RAM for the 43 GB Q4 file). Use when you want one model for coding and general reasoning, and have the RAM to run it.
7. Qwen 2.5 Coder 7B
The 7B sibling of our #3 pick. Runs in a 4.7 GB Q4_K_M file, 88.4% HumanEval pass@1 for Qwen2.5-Coder-7B-Instruct in the Qwen2.5-Coder technical report, Apache 2.0. Our local coding ranking picks it for an 8 GB MacBook Air. If you tried the 1.5B variant and wanted more capability without workstation hardware, this is the next step up.
8. DeepSeek Coder V2 Lite 16B
Only 2.4B active parameters per token (mixture-of-experts). DeepSeek reports 81.1% HumanEval pass@1 for DeepSeek-Coder-V2-Lite-Instruct in its paper. On a 16 GB laptop it is the alternative to Qwen 2.5 Coder 14B. Covered in depth in our best local LLMs for coding post.
9. Mistral Codestral 22B
Mistral's dedicated coding model. The Mistral AI Non-Production License is restrictive, so check it before commercial use. Runs from a 13.3 GB Q4_K_M file and performs well on both completion and chat-style coding tasks.
10. Codestral Mamba 7B
Mistral's experimental Mamba architecture coding model. Worth mentioning because Mistral states that the Mamba architecture gives linear-time inference. In Mistral's own table it scores 75.0% on HumanEval, below Codestral 22B (81.1%) but above CodeGemma 1.1 7B (61.0%) and CodeLlama 7B (31.1%), and for pure long-context code it can be a better choice.
11. StarCoder 2 15B
Hugging Face + ServiceNow + NVIDIA's open coding model. Trained on permissively licensed code, which matters if you care about what your tools learned from. Behind Qwen 2.5 Coder and DeepSeek Coder V2 Lite on HumanEval in Qwen's comparison table.
12. Llama 3.1 8B
Not a dedicated coding model, but capable enough to be useful and widely supported in every runtime. Include because its ubiquity means every code editor plugin already has an integration path.
13. Qwen 2.5 Coder 1.5B
The smallest dedicated coding model we'd recommend. 70.7% HumanEval pass@1 for Qwen2.5-Coder-1.5B-Instruct at just 1.5B parameters (Qwen2.5-Coder technical report), Apache 2.0, and small enough to run on a phone or a cheap laptop. A viable first-line code completion model when latency matters more than ceiling.
14. Phi-3.5 Mini
Microsoft's 3.8B tiny model. Not a dedicated coding model but included because it punches above its weight on HumanEval (62.8% pass@1 from 3.8B parameters in Microsoft's model card, close to the 66.5% that Microsoft's own run in the same table gives Llama-3.1-8B-Instruct; Meta's model card reports 72.6% for that model). MIT license, 2.4 GB at Q4, runs on a phone.
15. CodeLlama 13B
The 2023 model that made "local coding LLMs" a real thing. Included as a historical benchmark. It's been comfortably beaten on HumanEval by Qwen Coder, DeepSeek Coder V2 Lite and StarCoder 2 in Qwen's comparison table. If you're starting fresh, don't pick CodeLlama. If you have it set up already, upgrade.
The summary table
| # | Model | Local? | License | HumanEval pass@1 (source) |
|---|---|---|---|---|
| 1 | Claude 3.5 Sonnet (June 2024) | No | Proprietary | 92.0% (Anthropic model card addendum) |
| 2 | GPT-4o | No | Proprietary | 90.2% (Anthropic model card addendum) |
| 3 | Qwen2.5-Coder-32B-Instruct | Yes (workstation) | Apache 2.0 | 92.7% (Qwen2.5-Coder report) |
| 4 | DeepSeek-Coder-V2-Instruct (236B) | Yes (multi-GPU) | DeepSeek | 90.2% (DeepSeek-Coder-V2 paper) |
| 5 | Gemini 1.5 Pro | No | Proprietary | 84.1% (Gemini 1.5 report) |
| 6 | Llama-3.3-70B-Instruct | Yes (workstation) | Llama Community | 88.4% (Meta model card) |
| 7 | Qwen2.5-Coder-7B-Instruct | Yes (laptop) | Apache 2.0 | 88.4% (Qwen2.5-Coder report) |
| 8 | DeepSeek-Coder-V2-Lite-Instruct | Yes (laptop) | DeepSeek | 81.1% (DeepSeek-Coder-V2 paper) |
| 9 | Mistral Codestral 22B | Yes (laptop) | Mistral AI Non-Production License | 81.1% (Mistral model card) |
| 10 | Codestral Mamba 7B (Mamba-Codestral-7B-v0.1) | Yes (laptop) | Apache 2.0 | 75.0% (Mistral model card) |
| 11 | StarCoder2-15B-Instruct-v0.1 | Yes (laptop) | BigCode OpenRAIL | 72.6% (BigCode model card) |
| 12 | Llama-3.1-8B-Instruct | Yes (laptop) | Llama Community | 72.6% (Meta model card) |
| 13 | Qwen2.5-Coder-1.5B-Instruct | Yes (phone) | Apache 2.0 | 70.7% (Qwen2.5-Coder report) |
| 14 | Phi-3.5-mini-instruct | Yes (phone) | MIT | 62.8% (Microsoft model card) |
| 15 | CodeLlama-13B-Instruct | Yes (laptop) | Llama Community | 42.7% (Code Llama paper) |
Which one should you actually use?
For closed-source work where you can send code to a third party: Claude 3.5 Sonnet, our #1 pick above.
For confidential code on a workstation: Qwen 2.5 Coder 32B. Close enough to the frontier that you won't miss Sonnet much, and your code is processed on the machine, not on a server.
For confidential code on a 16 GB laptop: Qwen 2.5 Coder 14B, the 16 GB pick in our local coding ranking: 89.6% HumanEval pass@1 for Qwen2.5-Coder-14B-Instruct in Table 16 of the Qwen2.5-Coder report, from a 9.0 GB Q4_K_M file. DeepSeek Coder V2 Lite 16B (#8) is the alternative.
For confidential code on a phone: Phi-3.5 Mini or Qwen 2.5 Coder 1.5B. You're not going to one-shot a Rails controller, but you can get help understanding and modifying existing code. PocketLLM lists Phi-4 Mini and Qwen 2.5 Coder 1.5B in Pro for its iPhone launch. Join the launch list.
For long-context code questions: Gemini 1.5 Pro, with the 2M+ token context that the Gemini 1.5 report states.
The quick answer
The best LLM for coding in 2026 depends on one question: can you send your code to a third party? If yes, Claude 3.5 Sonnet. If no, Qwen 2.5 Coder (at whatever size your hardware supports). If you want coding help on your phone, the local models are finally good enough that it's worth doing. Our dedicated local-coding roundup has the on-device picks in detail.