Best LLM for Coding in 2026
The best LLM for coding in 2026 is the one that scores highest on the evaluation closest to your actual work: SWE-bench Verified for agentic repository fixes, LiveCodeBench for fresh problem solving, Aider Polyglot for multi-language edits, and Terminal-Bench for shell-driven tasks. Frontier models lead every column; several open-weight models now score within a few points.
Scores on this page are read from the same synchronized dataset that powers the LLM benchmark repository — currently September 10, 2026.
LLM coding benchmarks: what each score measures
“Best” is not a single number. Four public evaluations dominate coding, and each one answers a different question. A model that leads on competition problems can trail on multi-file edits inside a large repository, because the two tasks exercise different behaviour: one is generation from a blank file, the other is comprehension, patching and restraint. Read the column that matches the work before reading the ranking.
| Evaluation | What it runs | How it is graded | Read it when |
|---|---|---|---|
| SWE-bench Verified | Resolves a real GitHub issue, graded by the repository test suite | The repository’s own test suite runs against the patch. Pass or fail, no judge model. | You want an agent to fix real defects inside an existing codebase. |
| LiveCodeBench | Solves competition problems published after the model cutoff | Unit tests on problems published after the model’s training cutoff, which limits contamination. | You want raw problem-solving on code the model has never seen. |
| Aider Polyglot | Edits existing files across six languages, graded by unit tests | Unit tests across C++, Go, Java, JavaScript, Python and Rust, with a strict edit format. | Your work is editing existing files in more than one language. |
| Terminal-Bench | Completes shell-driven tasks end to end, pass or fail | Deterministic pass/fail on completing a task in a real shell. | Your assistant runs commands, builds and tests rather than only writing text. |
Three cautions carry across all four. First, scores are scaffold-dependent: the same model scores differently inside a purpose-built agent harness than it does behind a thin API wrapper, so the harness belongs in the citation alongside the number. Second, contamination is a live concern on older sets — OpenAI built SWE-bench Verified as a 500-problem human-validated subset precisely because the original set contained unsolvable and under-specified issues, and LiveCodeBench refreshes its problems after model cutoffs for the same reason. Third, the top of the table compresses: when several models land within a point or two of each other, the ranking has stopped discriminating and your own repository is the only tiebreaker left.
This page ranks models for coding work. The raw per-benchmark scores for every model and every evaluation, including the non-coding columns, live in the repository, and the wider model-by-model selection guide covers price tiers, context windows and non-coding tasks.
Best LLM for coding: the ranked table
The table below is ordered by SWE-bench Verified, the column the most models publish, with the other three coding evaluations alongside it and list price per million tokens on the right. Every value is read from the synchronized dataset behind the benchmark repository rather than typed into this page, so a model that moves in the sync moves here too.
The set is curated rather than scraped. A model earns a row here when its coding scores have been reviewed against the published evaluation, which is why this ranking is shorter than the several hundred entries in the repository’s raw universe: harness submissions, pre-release identifiers and unverified self-reported numbers stay out of a table that a procurement decision is made from. For the unfiltered view, read the raw per-benchmark scores in the LLM leaderboard, which covers every evaluation category, not only coding.
| # | Model | Lab | Weights | SWE-bench Verified | LiveCodeBench | Aider Polyglot | Terminal-Bench | In / out per 1M |
|---|---|---|---|---|---|---|---|---|
| 1 | Claude Opus 4.6 | Anthropic | API only | 78.7% | 82.1% | 84.8% | 56.8% | $5.00 / $25.00 |
| 2 | GPT-5.4 Pro | OpenAI | API only | 77.8% | 84.6% | 88.0% | 52.4% | $30.00 / $180.00 |
| 3 | GPT-5.4 | OpenAI | API only | 76.9% | 79.2% | 82.4% | 46.2% | $2.50 / $15.00 |
| 4 | Gemini 3.1 Pro | API only | 75.6% | 77.4% | 79.2% | 47.8% | $2.00 / $12.00 | |
| 5 | Claude Sonnet 4.6 | Anthropic | API only | 75.2% | 74.2% | 78.3% | 49.6% | $3.00 / $15.00 |
| 6 | DeepSeek V3.2 | DeepSeek | Open weights | 72.6% | 78.4% | 74.2% | — | $0.27 / $0.40 |
| 7 | Grok 4 | xAI | API only | 71.4% | 76.8% | 79.6% | — | $5.00 / $15.00 |
| 8 | MiniMax M2.7 | MiniMax | Open weights | 71.2% | 76.4% | — | — | $0.30 / $1.20 |
| 9 | Qwen 3.6 Plus | Alibaba | API only | 68.9% | 75.6% | — | — | $1.20 / $6.00 |
| 10 | DeepSeek R1 | DeepSeek | Open weights | 68.4% | 74.2% | — | — | $0.50 / $2.15 |
| 11 | Kimi K2 Thinking | Moonshot AI | Open weights | 66.8% | 84.2% | — | — | $0.60 / $2.50 |
| 12 | GPT-5 Mini | OpenAI | API only | 64.7% | 66.4% | — | — | $0.25 / $2.00 |
| 13 | Gemini 3.1 Flash | API only | 64.1% | 71.2% | — | — | $0.30 / $2.50 | |
| 14 | MiMo-V2-Pro | Xiaomi | Open weights | 63.8% | — | — | — | $0.55 / $2.20 |
| 15 | Llama 4 405B | Meta | Open weights | 62.1% | 71.8% | — | — | $2.70 / $2.70 |
| 16 | Gemini 3.1 Flash Lite | API only | 52.6% | 62.4% | — | — | $0.25 / $1.50 | |
| 17 | Claude Haiku 4.5 | Anthropic | API only | 52.4% | 61.8% | — | — | $1.00 / $5.00 |
| 18 | Grok 3 Mini | xAI | API only | 51.8% | — | — | — | $0.30 / $0.50 |
| 19 | Llama 4 70B | Meta | Open weights | 48.2% | — | — | — | $0.60 / $0.60 |
| 20 | Mistral Large 2 | Mistral | Open weights | 42.6% | — | — | — | $2.00 / $6.00 |
How to read the ranking
Treat the top band as a tie. When the leading models sit within two or three points of each other on SWE-bench Verified, the difference is inside the noise created by harness choice, retry policy and prompt format — it will not survive contact with your repository. What separates them in practice is the second and third column: a model that holds its score on Aider Polyglot is reliable at editing files that already exist, and a model that holds its score on Terminal-Bench can be trusted to run its own build and test loop.
Then read the price columns as a routing instruction rather than a verdict. Coding traffic is rarely uniform: a small share of requests are genuinely hard multi-file changes, and the rest are completions, renames, test stubs and explanations that a mid-tier model finishes at a fraction of the cost. Most teams over-buy by sending everything to the most expensive model in the table. If you want to size that difference in dollars before you commit, price the mix with the LLM pricing calculator.
Finally, the “Weights” column is the constraint that outranks every score for a regulated team. An API-only model cannot be brought inside a disconnected network at any price, which is why the open-weight rows matter well out of proportion to their rank. That column tracks the specific release named in the row: a lab can publish downloadable checkpoints and still serve its highest tier only through its own API, and only the downloadable release can go inside your boundary.
Best LLM for agentic coding
For agentic coding — reading a repository, planning a change, editing several files and running the tests — rank on SWE-bench Verified first and Terminal-Bench second. The current leaders on the synced scores are Claude Opus 4.6, GPT-5.4 Pro, GPT-5.4, and the models that finish shell-driven tasks most reliably are Claude Opus 4.6, GPT-5.4 Pro, Claude Sonnet 4.6.
Ranked on repository fixes
- Claude Opus 4.6
- GPT-5.4 Pro
- GPT-5.4
Ranked on shell task completion
- Claude Opus 4.6
- GPT-5.4 Pro
- Claude Sonnet 4.6
Agentic coding is where the money and the risk both concentrate. The model has to hold a long context without losing the thread, decide what not to change, and recover when a test fails — and the failure mode is not a wrong answer but a plausible patch that quietly breaks something else. That is why the grading method matters here more than anywhere: SWE-bench Verified and Terminal-Bench are pass/fail against real execution, so a high score means work was completed, not that an answer read well.
Two practical rules follow. Give the agent the same tools your engineers have — a test runner, a linter, and permission to iterate — because scores collapse when the model cannot see the result of its own change. And run a private evaluation on 30 to 50 issues from your own tracker before you standardize; a public score establishes the shortlist, your repository picks the winner.
Best LLM for code completion and inline assistance
Completion is a latency problem before it is a quality problem. The right model is the smallest one that still passes your acceptance bar, because a suggestion that arrives after the developer has typed the line is worthless. On the synced scores, the best capability-per-dollar options are GPT-5 Mini, Gemini 3.1 Flash Lite, DeepSeek V3.2.
- GPT-5 Mini
- Gemini 3.1 Flash Lite
- DeepSeek V3.2
Inline completion runs on every keystroke pause, so it is the highest-volume and most cost-sensitive coding workload a team has. It also has the shortest quality horizon: the model is finishing a line or a block with the surrounding file as context, not reasoning about architecture. Mid-tier and small models do this well, and the cost difference against a frontier model compounds across a whole engineering organization.
The measurable gains are real but narrower than the marketing suggests. GitHub’s own controlled study reported developers completing a scoped task 55% faster with Copilot, while METR’s 2025 randomized trial found experienced open-source maintainers took 19% longer on their own repositories with AI assistance, even though they believed they had been faster. Both results can hold at once: assistance helps most on unfamiliar, boilerplate-heavy code and least on code the developer already knows deeply. Measure acceptance rate and rework on your own team rather than importing either headline.
Best LLM for code review and refactoring
Review and refactoring reward a different score: multi-language editing accuracy and instruction following, not one-shot generation. Rank on Aider Polyglot, which grades edits to files that already exist across six languages. The current leaders are GPT-5.4 Pro, Claude Opus 4.6, GPT-5.4.
- GPT-5.4 Pro
- Claude Opus 4.6
- GPT-5.4
Refactoring is the task where AI assistance has historically helped least. McKinsey’s developer productivity research measured roughly 45–50% time savings on documentation and 35–45% on new code generation, but only about 20–30% on refactoring existing code — and it found the gap widens as task complexity rises. The reason is legibility: a refactor requires understanding constraints that are not written down anywhere in the file.
For review specifically, a long context window and disciplined instruction following matter more than a headline coding score. The model needs to hold the diff, the surrounding modules and your standards document at once, and then say only what the standard requires. Scepticism is warranted and widespread: in the Stack Overflow Developer Survey 2025, 46% of developers said they distrust the accuracy of AI output, and the most common complaint was answers that are almost right. Use the model to widen coverage — every diff gets a first pass — and keep a human as the approver.
Cloud API or a model on your own hardware
Before the scores matter, one question decides which half of the table you are allowed to use: can source code leave your network? For a lot of engineering organizations the answer is a qualified yes, and the frontier models are available. For anyone handling controlled unclassified information under NIST SP 800-171, export-controlled designs under ITAR, or classified work, the answer is no — and the shortlist narrows to models whose weights can be brought inside the boundary and served there.
| Deployment | What leaves your network | Model choice | Typical fit | Main constraint |
|---|---|---|---|---|
| Public cloud API | Prompts, file context and often the surrounding repository | The full table, frontier models included | Product teams on public or low-sensitivity code | Data-handling terms and retention windows change without a code change on your side |
| Private cloud or dedicated endpoint | The same payloads, into a tenant you contract for | Most frontier models, plus hosted open weights | Enterprises with a signed data-processing agreement | Still an external network path, so it rarely satisfies a no-egress rule |
| On-premises GPU cluster | Nothing | Open-weight models only | Regulated engineering orgs serving many developers | Capacity planning, quantization and serving become your responsibility |
| Workstation or AI PC | Nothing | Open-weight models sized to local memory | Individual engineers, field work, disconnected sites | Memory ceiling caps both model size and usable context |
| Air-gapped enclave | Nothing, by construction | Open-weight models cleared through an approval process | Defense, classified and CUI programs | Model updates arrive as a controlled artifact, not as a version bump |
The middle rows are where most teams get surprised. A dedicated endpoint inside a cloud tenant is a commercial control, not a network control: the packets still leave, and a policy that says no egress will fail the review no matter how good the contract is. If the requirement is that code never crosses the boundary, the deployment has to be inside it, which makes open weights a hard filter rather than a preference.
The cost profile inverts too. Cloud coding assistants bill per token, so spend scales with adoption — exactly the thing you want to encourage. Self-hosting converts that into fixed capacity you have already paid for, at the price of running the serving stack yourself. Size that capacity with the GPU sizing formulas before committing to a model class.
Best local LLM for coding, by VRAM budget
The best local LLM for coding is the largest open-weight model your memory budget can hold at the context length you actually use. Estimate weights as parameters multiplied by bytes per parameter — one byte at FP8, half a byte at INT4 — then add 30 to 50% for KV cache and overhead, and pick the tier below.
| Memory budget | Hardware shape | What fits | What it does well |
|---|---|---|---|
| 16–24 GB | One workstation GPU, or an AI PC with unified memory | 7–14B at INT4 (roughly 4–7 GB of weights), leaving room for a long file context | Inline completion, single-file edits, test stubs, commit messages, offline work |
| 48 GB | One 48 GB workstation card, or two 24 GB cards | 27–32B at INT4 (roughly 14–16 GB), or a 14B model at FP8 with a large KV cache | Whole-file refactors, code review passes, retrieval over a private repository |
| 80–141 GB | A single datacenter GPU (80 GB HBM3 or 141 GB HBM3e) | 70B at INT4 (about 35 GB) or FP8 (about 70 GB), or a ~100B-total MoE at INT4 | Multi-file agentic work for a small team, long-context review |
| 640 GB and up | An eight-GPU node | The 400–700B-parameter open-weight MoE class at FP8 | Serving a whole engineering organization at frontier-adjacent quality |
Two adjustments make the tiers behave. Quantization is close to free at INT4 for coding work, which is why a 32B model on a 48 GB card is usually a better assistant than a 14B model at full precision on the same card. And context is not free: KV cache grows with sequence length and batch size, so a model that fits comfortably at 8K tokens can fall over at 128K. Size the cache, not just the weights. The mechanics of getting a first model serving are covered in how to run an LLM locally, and the wider case for running a local LLM covers privacy, latency and cost.
Open-weight coding models: provenance and licence
Weights you can download are weights you can deploy, and for a regulated program that makes two columns as important as the scores: where the lab is headquartered, and what the published licence permits. The table below carries both alongside the same synced coding scores used in the main ranking.
One filter is applied before a model reaches this table: it lists the specific releases that publish downloadable checkpoints, not every lab that publishes weights somewhere in its range. Alibaba, for example, releases the numbered Qwen checkpoints under Apache 2.0 while serving its Plus tier through its own API, so that tier appears in the ranking above as API-only and not here. Read the ranking for capability; read this table for what can cross into your boundary.
| Model | Lab | Headquarters | Published weights licence | SWE-bench Verified | LiveCodeBench | Aider Polyglot |
|---|---|---|---|---|---|---|
| DeepSeek V3.2 | DeepSeek | China | MIT on the released weights | 72.6% | 78.4% | 74.2% |
| MiniMax M2.7 | MiniMax | China | MIT | 71.2% | 76.4% | — |
| DeepSeek R1 | DeepSeek | China | MIT on the released weights | 68.4% | 74.2% | — |
| Kimi K2 Thinking | Moonshot AI (Kimi) | China | Modified MIT | 66.8% | 84.2% | — |
| MiMo-V2-Pro | Xiaomi (MiMo) | China | MIT | 63.8% | — | — |
| Llama 4 405B | Meta | United States | Llama Community License | 62.1% | 71.8% | — |
| Llama 4 70B | Meta | United States | Llama Community License | 48.2% | — | — |
| Mistral Large 2 | Mistral AI | France | Apache 2.0 on the small open models; Mistral Research License on the large open-weight line | 42.6% | — | — |
Licences differ by release and change between versions, so confirm the terms on the model card you are actually downloading rather than on the lab’s previous one. Several of the strongest open-weight coding models — including those from DeepSeek, Moonshot AI, MiniMax and Xiaomi — are published by labs headquartered in the People’s Republic of China. They are permissively licensed and they score well, but for CMMC, ITAR, federal or classified programs the weights origin is a review item in its own right: run it through supply-chain approval, pin the version, and hash the artifact you deploy. Where that review does not clear, the US and EU open-weight rows are the fallback, at a measurable but not disqualifying cost in score.
The same review applies to open-weight coding families that sit outside this table — Alibaba (Qwen) and Z.ai (GLM) among them — if your team shortlists them from a public leaderboard. Origin review is a property of the weights, not of where you found the score.
Which of these models you can run inside your own boundary
Every open-weight row in the tables above can be brought inside a network you control. What decides whether that is a project or a product is the layer around the model: the harness the developer works in, the registry that says which model versions are approved, and the evidence trail that survives an audit.
AirgapAI Code is Iternal’s answer to that layer — an AI code assistant for teams whose source cannot reach a hosted API. It is a terminal-native agentic coding assistant built to run fully disconnected, and it is deliberately model-agnostic — it talks to customer-controlled model endpoints inside the enclave, so the ranking on this page is a menu rather than a constraint. Security teams get an approved model registry with version pinning and org-level policy packs; engineers get an assistant that reads the repository, edits files and runs the tests without a packet leaving the boundary.
Your endpoint, your model
Inference runs against model endpoints you host inside the enclave. Swap the model as the scores move; the assistant does not change.
Approved model registry
Only models your security team has cleared are selectable, pinned to a specific version, with org-level policy packs applied across teams.
No egress, no callback
Built for ITAR, CMMC and classified environments: it runs disconnected, with no license-server callback and no external dependency.
Best LLM for coding: frequently asked questions
The best LLM for coding is the model that leads the evaluation closest to your work. For agentic changes inside a real repository, rank on SWE-bench Verified and Terminal-Bench; for fresh problem solving, LiveCodeBench; for editing existing files across languages, Aider Polyglot. The ranked table on this page is ordered by SWE-bench Verified and re-synced from the same dataset as the benchmark repository, so the current leaders are always the ones shown there.
Only partly. Public evaluations are graded by real test suites, so a high score means work was completed rather than that an answer read well — but scores are scaffold-dependent, and the top of the table now clusters within a couple of points. Treat the ranking as a way to cut thirty candidates down to three, then run those three against 30 to 50 real issues from your own tracker and compare merged patches, not vibes.
On 16 to 24 GB, a 7B to 14B open-weight model at INT4 handles completion, single-file edits and test stubs. On 48 GB, a 27B to 32B model at INT4 handles whole-file refactors and review passes. On a single 80 to 141 GB datacenter GPU, a 70B model or a roughly 100B-parameter mixture-of-experts model at INT4 supports multi-file agentic work. Size the KV cache for your real context length, not just the weights.
For most coding traffic, yes. The strongest open-weight models now land within a few points of the frontier on the coding evaluations, and the majority of day-to-day requests — completion, renames, tests, explanations — never needed frontier capability. The gap that remains shows up on the hardest agentic work: long multi-file changes where the model has to recover from its own failed attempts. A routed setup that keeps routine traffic local and escalates the hard cases is usually better than picking one model.
It depends on your approval process, and it is a review item rather than a yes or no. Several of the strongest open-weight coding models are published by labs headquartered in the People’s Republic of China under permissive licences. For CMMC, ITAR, federal or classified programs, treat weights origin as part of supply-chain review: clear the model, pin the version, hash the artifact you deploy, and keep the evidence. Where the review does not clear, the US and EU open-weight models are the fallback.
The published results disagree, and both sides are informative. GitHub’s controlled study reported a scoped task finished 55% faster with Copilot, and McKinsey measured roughly 45 to 50% time savings on documentation and 35 to 45% on new code generation, but only 20 to 30% on refactoring. METR’s 2025 randomized trial found experienced maintainers were 19% slower on their own repositories while believing they were faster. Gains concentrate in unfamiliar and boilerplate-heavy work; measure acceptance and rework on your own team.
The scores are read from the benchmark sync that also feeds the LLM benchmark repository, so a model that moves in the sync moves in the table without an edit to this page. The written analysis around the table is reviewed monthly. Because model releases and score revisions land continuously, the visible sync date beside the table is the number to trust rather than the publication date.
Pick the score that matches the job, then prove it on your own code
The ranking narrows the field to a handful of models; a week of evaluation on your own repository picks the one. If the constraint is that code cannot leave the building, start from the open-weight rows and the deployment tier your hardware supports — and talk to Iternal about running them under an approved model registry rather than an API key.