Best LLMs for coding
Every model in our directory that its provider positions for software work, from frontier models that refactor whole repositories to small open-weight models that autocomplete on a laptop.
Coding is where differences between models show up fastest. A stronger model fixes the bug on the first attempt; a weaker one spends tokens on retries. That makes list price a poor guide to cost per solved task, so treat this page as a shortlist and test the top candidates on issues from your own codebase.
Agentic coding tools send large contexts on every turn: whole files, test output, diffs and tool results. Input price and prompt caching usually matter more than output price, and a long context window keeps more of the repository in view.
The shortlist
| Model | Tier | Weights | Context | Input / 1M | Output / 1M | Inputs |
|---|---|---|---|---|---|---|
| DeepSeek-V4-ProDeepSeek | Frontier | Open weights | 1M | $1.32 | $3.96 | Text |
| GLM-5.3Z.ai (Zhipu AI) | Frontier | Open weights | 1M | $1.40 | $4.40 | Text |
| Grok 4.7xAI | Frontier | Closed | 500K | $2 | $6 | Text, Images |
| Qwen3.8-MaxAlibaba (Qwen) | Frontier | Closed | 1M | $2 | $6 | Text, Images |
| Qwen3.8-2.4T-A95BAlibaba (Qwen) | Frontier | Open weights | 256K | $2 | $6 | Text |
| Kimi K3Moonshot AI | Frontier | Open weights | 1M | $3 | $15 | Text, Images, Video |
| Claude Opus 5.5Anthropic | Frontier | Closed | 1M | $4 | $20 | Text, Images, PDF |
| Claude Fable 5.1Anthropic | Frontier | Closed | 1M | $10 | $50 | Text, Images, PDF |
| GPT-6 AstraOpenAI | Frontier | Closed | 1.05M | $10 | $50 | Text, Images |
| gpt-oss-120bOpenAI | Advanced | Open weights | 128K | $0.15 | $0.60 | Text |
| DeepSeek-V4.1-FlashDeepSeek | Advanced | Open weights | 1M | $0.30 | $1.20 | Text, Images |
| MiniMax-M3MiniMax | Advanced | Open weights | 1M | $0.30 | $1.20 | Text, Images, Video |
| NVIDIA Nemotron 3 UltraNVIDIA | Advanced | Open weights | 1M | $0.50 | $2.20 | Text |
| Gemini 3.8 FlashGoogle | Advanced | Closed | 1M | $0.75 | $3.75 | Text, Images, Video, Audio, PDF |
| Gemini 3.6 FlashGoogle | Advanced | Closed | 1M | $0.75 | $3.75 | Text, Images, Video, Audio, PDF |
| Mistral Medium 3.5Mistral AI | Advanced | Open weights | 256K | $1.50 | $7.50 | Text, Images |
| Claude Sonnet 5.5Anthropic | Advanced | Closed | 1M | $2 | $10 | Text, Images, PDF |
| GPT-6.1 SolOpenAI | Advanced | Closed | 1.05M | $2 | $10 | Text, Images |
| GLM-5.3-FlashZ.ai (Zhipu AI) | Efficient | Open weights | 1M | $0.15 | $0.50 | Text, Images, Video |
| Mistral Small 4Mistral AI | Efficient | Open weights | 256K | $0.15 | $0.60 | Text, Images |
| Codestral 25.08Mistral AI | Efficient | Closed | 125K | $0.30 | $0.90 | Text |
| Muse Glimmer 30BMeta | Efficient | Open weights | 128K | $0.35 | $1.50 | Text, Images, Video |
| Qwen3.8-27BAlibaba (Qwen) | Efficient | Open weights | 256K | $0.80 | $4 | Text, Images, Video |
| NVIDIA Nemotron 3.5 Lightning 30B-A3BNVIDIA | Compact | Open weights | 1M | $0.05 | $0.20 | Text |
| Qwen3.6-35B-A3BAlibaba (Qwen) | Compact | Open weights | 256K | $0.10 | $0.95 | Text, Images, Video |
| Gemini 3.1 ProGoogle | Frontier | Closed | 1M | $2 | $12 | Text, Images, Video, Audio, PDF |
| Muse Spark 1.3Meta | Advanced | Closed | 1M | $1.25 | $4.25 | Text, Images, Video, PDF |
| Grok Build 0.1xAI | Efficient | Closed | 250K | $1 | $2 | Text, Images |
| Grok 4.6xAI | Frontier | Closed | 500K | $2 | $6 | Text, Images |
| GPT-5.6 SolOpenAI | Frontier | Closed | 1.05M | $4 | $20 | Text, Images |
| Claude Opus 5Anthropic | Frontier | Closed | 1M | $5 | $25 | Text, Images, PDF |
| GPT-5.5OpenAI | Frontier | Closed | 1.05M | $5 | $30 | Text, Images |
Ordered by status, capability tier and then price. Tiers are our editorial grouping of provider positioning and public benchmark standings, not our own test results. How we rank.
How to choose
- For multi-file changes, refactors and agents that run tests, start with frontier and advanced models that support tool calling and long context.
- For inline completion and quick edits, latency beats peak quality: efficient and compact models answer faster and cost a fraction as much.
- If code can't leave your network, shortlist open-weight models and size the hardware with the VRAM calculator.
- Check independent coding leaderboards such as SWE-bench and Aider's leaderboards, then confirm on your own tasks.
Frequently asked questions
Which LLM is best for coding?
No single model wins every coding task. Frontier models generally handle complex, multi-file work best, while cheaper efficient models are often good enough for completions and small edits. Shortlist three models from this page and compare them on 20-50 real tasks from your repository, measuring solved tasks per dollar.
Is a bigger context window better for coding?
It helps when an agent needs many files, logs and test output in view at once. But every token in the prompt is billed on every call, so good retrieval of relevant files and prompt caching usually save more money than simply sending the whole repository.
Can I use an open-weight model for coding?
Yes. Several open-weight models in this list are positioned for coding and can run on your own servers, which keeps source code inside your network. Check the license and the GPU memory you need before you commit.
Other shortlists
Need hands-on help building it?
RAG, agents, fine-tuning or a production chatbot: describe the project and we'll suggest an approach and, if you want, partners who build it.
- Free and vendor-neutral: no model provider pays for placement.
- Your details go only to partners you agree to.