---
title: "Best LLM for coding: November 2026 benchmarks, compared"
type: "deep dive"
url: "https://aifordevs.org/articles/best-llm-for-coding"
markdown: "https://aifordevs.org/articles/best-llm-for-coding.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/articles/best-llm-for-coding"
description: "The best LLM for coding as of November 2026, by situation: agents, value, large repos, local hardware. Dated scores and who ran each benchmark."
author: "AI for Devs"
published: "2026-11-08"
level: "Intermediate"
topics: ["coding-agents", "models"]
---

# Best LLM for coding: November 2026 benchmarks, compared

The best LLM for coding as of November 2026, by situation: agents, value, large repos, local hardware. Dated scores and who ran each benchmark.

> **TL;DR**
>
> - As of November 8, 2026, the best LLM for coding agents is Claude Opus 5.5 in Claude Code, at 64.85% on the third-party Terminal-Bench 4.0 board. Its lead over Sonnet 5.5 (61.82%) falls inside the 95% intervals.
> - GPT-6.1 Sol is the best value: 58.18% on the same board at $1.92 per trial, against $14.30 per trial for Opus 5.5.
> - For prompts near 1M tokens, Claude Sonnet 5.5 is the default. An uncached 800K-token turn costs $1.65 at Anthropic's flat rate, about half of GPT-6.1 Sol's $3.28.
> - The best local LLM for coding on 24 to 64 GB is Qwen3.8-27B, at about 16 GiB of 4-bit weights plus 64 KiB per token of context. Every coding score for it is Qwen's own.
> - This article ran no benchmark. Every figure is dated, labeled third-party or vendor-reported, and linked to the page that published it.

Picking the best LLM for coding means reading boards that disagree: Gemini 3.8 Flash resolves 94.86% of public [SWE-Bench Pro V2](https://labs.scale.com/leaderboard/swe_bench_pro_public_v2) tasks and 19.09% of [Terminal-Bench 4.0](https://www.tbench.ai/) tasks. The two benchmarks use different tasks, and SWE-Bench Pro's public split comes from repositories a model could have trained on. Each pick below names the board behind it, who runs that board, and the evidence that would overturn it.

## Best LLM for coding by situation

The best LLM for coding depends on four things you can state in advance: unattended agent runs, cost per solved task, repository size per prompt, and your hardware's memory. The table gives one pick for each case, dated November 8, 2026.

| Situation | Pick | Evidence and class | What would change the pick |
| --- | --- | --- | --- |
| Agents that run unattended | Claude Opus 5.5 in Claude Code | Third-party: Terminal-Bench 4.0, 64.85% ±3.11 (row dated Sep 22, 2026); Coding Agent Index 62 | A rival within 2 points at a lower cost per solved task |
| Best value for daily agent work | GPT-6.1 Sol in Codex | Third-party: Terminal-Bench 4.0, 58.18% ±3.11, $1.92 per trial (Sep 29, 2026) | A price rise, or a DeepSeek V4.1 Flash row on Terminal-Bench 4.0 |
| Prompts near 1M tokens | Claude Sonnet 5.5 | Third-party: SWE Atlas QnA 71.8 ±8.0 (Nov 2026). Vendor price: flat across the window | OpenAI dropping its 272K surcharge, or tighter intervals that separate DeepSeek V4.1 Flash |
| Local, 24 to 64 GB | Qwen3.8-27B | Vendor only: 61.7 on SWE-bench Pro, reported by Qwen (Aug 2026) | Any third-party board row for it |
| Local, 128 GB or more | Qwen3.8-27B, or Laguna S 2.1 for a 1M window | Vendor only: 59.4 on SWE-Bench Pro public, reported by Poolside (Jul 21, 2026) | A third-party comparison of the two |

The agentic pick is narrow. Opus 5.5 at 64.85% and Sonnet 5.5 at 61.82% have overlapping intervals on Terminal-Bench 4.0, so a rerun could reverse their order. Sonnet 5.5 at max effort also cost more per trial on that board, $22.22 against $14.30, which is why Opus 5.5 keeps the pick despite a higher list price.

Start Opus 5.5 at high effort instead of max. On Cursor's own [CursorBench 4.0](https://cursor.com/en-US/cursorbench), Opus 5.5 scored 56.0% at high effort for $3.97 per task and 57.8% at max for $13.43. Cursor notes that small differences may not be statistically meaningful, and its board is vendor-run, so test the same trade-off on your repository.

## How this comparison was built

This article ran no benchmark of its own. Every score below was read on November 8, 2026, from the page that publishes it, and each is labeled third-party or vendor-reported. The table lists what each benchmark measures, who runs it, and the commercial interests attached to that operator.

| Benchmark | What it measures | Run by | Last update | Independence check |
| --- | --- | --- | --- | --- |
| [Terminal-Bench 4.0](https://www.tbench.ai/) | 66 command-line tasks, 5 trials each | Hosted by Stanford, Harbor, and Laude Institute | Oct 23, 2026 | Modal, Anthropic, OpenAI, and Google [sponsor compute](https://raw.githubusercontent.com/harbor-framework/terminal-bench/main/README.md). The board does not say who ran each row |
| [Coding Agent Index v2.0](https://artificialanalysis.ai/methodology/coding-agents-benchmarking) | Equal-weight mean of FrontierCode v1.1, Terminal-Bench 4.0, and regraded SWE-Atlas QnA | Artificial Analysis | Version since October 2026 | FrontierCode is built by [Cognition](https://cognition.com/), which sells the Devin agent |
| [SWE-Bench Pro V2](https://labs.scale.com/leaderboard/swe_bench_pro_public_v2) | 642 public and 272 private repository tasks | Scale AI | V2 released Sep 22, 2026; newer rows added since | Meta holds a [minority stake in Scale](https://scale.com/blog/scale-ai-announces-next-phase-of-company-evolution), and its Muse models appear on the board. V2 was co-developed with [Reflection](https://reflection.ai/), which trains models |
| [SWE Atlas](https://labs.scale.com/leaderboard/swe-atlas?tab=qna) | Codebase questions, test writing, and refactoring on 15 repositories | Scale AI | November 2026 | Same ownership note as SWE-Bench Pro V2 |
| [SWE-bench Verified](https://www.vals.ai/benchmarks/swebench) | 500 human-validated issue fixes | Vals AI | Sep 1, 2026, archived | Vals [calls itself independent](https://www.vals.ai/about); its about page does not state its funding |
| [DeepSWE v1.1](https://deepswe.datacurve.ai/) | 113 tasks written from scratch | Datacurve | Sep 22, 2026 | Datacurve built the benchmark and [compares it favorably](https://arxiv.org/abs/2607.07946) with SWE-Bench Pro |

Vendor numbers come from launch posts and model cards, and each names the company that reported it. OpenAI's site refused automated reading on November 8 with an HTTP 403, so OpenAI-reported scores here are quoted from Anthropic's footnotes and labeled that way.

Third-party means the result appears on a board its vendor does not operate. It does not prove the vendor had no hand in the run, since Terminal-Bench's repository shows anyone running evaluations with its CLI.

Treat any gap smaller than a board's interval as a tie. Terminal-Bench 4.0 publishes 95% intervals, Scale publishes a ± value on most rows, and Artificial Analysis publishes whole numbers. Scores from different benchmarks are never comparable, even when the percentages look close.

## SWE-bench, Terminal-Bench, and agent index results

On third-party boards, Claude Opus 5.5 in Claude Code leads Terminal-Bench 4.0 and the Coding Agent Index, while GPT-6.1 Sol in Codex matches the pricier GPT-6 Astra on Terminal-Bench. The leading gaps are small, and the public SWE-Bench Pro V2 set has stopped separating top models at all.

All values were read on November 8, 2026. "Not listed" means no row on the pages read.

Terminal-Bench rows are max effort unless noted, and ± there is the board's 95% interval, with the row's own date. SWE Atlas does not state its interval level.

| Third-party results | Terminal-Bench 4.0 | Coding Agent Index v2.0 | Index cost per task | SWE Atlas QnA (Nov 2026) |
| --- | --- | --- | --- | --- |
| Claude Opus 5.5, Claude Code | 64.85 ±3.11 (Sep 22) | 62 | $11.42 | 77.4 ±7.5 |
| Claude Sonnet 5.5, Claude Code | 61.82 ±2.94 (Sep 28) | 59 | $13.30 | 71.8 ±8.0 |
| Claude Fable 5.1, Claude Code | 57.88 ±3.76 (Sep 1) | 58 | $11.53 | 73.4 ±7.9 |
| GPT-6 Astra, Codex | 58.18 ±2.79 (Sep 3) | 55 | $7.04 | 70.2 ±8.2 |
| GPT-6.1 Sol, Codex | 58.18 ±3.11 (Sep 29) | 54 | $1.50 | 71.0 ±8.1 |
| GLM-5.3 | 41.82 ±3.23, Claude Code (Aug 14) | 49, Opencode | $5.23 | Not listed |
| DeepSeek V4.1 Flash, Codex | Not listed | 47 | $0.39 | 71.0 ±8.1 |
| Gemini 3.8 Flash, mini-SWE-agent | 19.09 ±3.36, high effort (Sep 2) | Not listed | Not listed | 45.2 ±8.9 |

The index and cost columns come from the Artificial Analysis [Claude Code and Codex](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-codex) and [Claude Code and Opencode](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-opencode) tables. Artificial Analysis does not date individual rows.

SWE-Bench Pro V2's full set no longer ranks the frontier. Scale's [leaderboard](https://labs.scale.com/leaderboard/swe_bench_pro_public_v2) shows 14 of 18 rows at 94.86% or higher, with Opus 5 on top at 99.40 ±0.40. The separate 51-task HARD tab spreads those models from 98.00 down to 25.50, so read that tab or the private split instead.

## Vendor-reported numbers against the boards

Treat vendor launch numbers as claims to verify, because the settings differ even when the benchmark matches. Anthropic reports 70.6% for Sonnet 5.5 on Terminal-Bench 4.0 without naming an effort level, while the third-party board's only Sonnet 5.5 row, at max effort, reads 61.82%. OpenAI's 57.9% for GPT-6 Astra matches its board row.

| Vendor-reported figure | Reported by | Setting disclosed | Board value for comparison |
| --- | --- | --- | --- |
| Opus 5.5, Terminal-Bench 4.0: 66.4 (standard error 2.6) | [Anthropic](https://www.anthropic.com/claude-opus-5-5), Sep 22, 2026 | xhigh effort | 64.85, max effort |
| Sonnet 5.5, Terminal-Bench 4.0: 70.6 | [Anthropic](https://www.anthropic.com/claude-sonnet-5-5), Sep 28, 2026 | Not stated | 61.82, max effort |
| GPT-6 Astra, Terminal-Bench 4.0: 57.9 | OpenAI, quoted by Anthropic | high effort | 57.88, high effort |
| Qwen3.8-27B, SWE-bench Pro: 61.7 | [Qwen](https://huggingface.co/Qwen/Qwen3.8-27B), Aug 2026 | Claude Code runner, 256K window | None listed |
| Qwen3.8-27B, Terminal-Bench 2.1: 73.0 | Qwen, Aug 2026 | Terminus runner | None listed |
| Laguna S 2.1, SWE-Bench Pro public: 59.4 | [Poolside](https://huggingface.co/poolside/Laguna-S-2.1), Jul 21, 2026 | Not stated | None listed |
| DeepSeek V4.1 Flash, DeepSWE v1.1: 74.2 | [DeepSeek](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash), read Nov 8, 2026 | mini-SWE runner, max effort | None listed |

Anthropic's launch post says its safeguards handed some blocked tasks to Claude Opus 4.8 or Claude Opus 5, and that this likely lowered the Opus 5.5 scores. A safety fallback that changes which model completed a task is a product behavior your own eval should capture.

## What benchmarks cannot tell you

Benchmarks cannot tell you how a model behaves on your repository. They measure a bundle of model, agent runner, effort setting, and test suite, on tasks the model may have seen during training. Contamination, flawed verifiers, runner choice, and effort level each move scores by more than the gaps between leading models.

### Contamination

Scale reported no successful retrieval of solutions during its locked V2 runs, yet [private-split scores](https://labs.scale.com/blog/swe-bench-pro-v2) fell 17 to 22 points below public ones. Scale attributes that gap to exposure during training, which a locked test cannot undo, and treats only the private set as a clean measurement.

**Figure 1.** Every model Scale reported on both SWE-Bench Pro V2 splits loses 17 to 22 points on private code, so the public split overstates what a model can do on code it has not seen.

The private split only exists for five models in Scale's post, and the post does not cover Claude Opus 5.5 or GPT-6.1 Sol. Treat the figure as a measure of contamination, not as a current ranking.

### Verifiers and saturation

[SWE-bench](https://aifordevs.org/glossary#swe-bench) Verified has saturated. [Vals AI](https://www.vals.ai/benchmarks/swebench) archived it with Claude Opus 5 at 97.00% and no longer runs new models on it.

Test quality is a separate problem. [Aleithan et al.](https://arxiv.org/abs/2410.06992) found in 2024 that 32.67% of passing SWE-bench patches had the fix in the issue text, and 31.08% passed tests too weak to verify them.

Datacurve's [DeepSWE paper](https://arxiv.org/abs/2607.07946) reports an LLM judge disagreeing with SWE-Bench Pro's verifiers on 32.4% of 789 audited runs, against 1.4% of 735 on DeepSWE. Datacurve built DeepSWE, the judge was GPT-5.5, and the authors say the figure measures disagreement rather than ground truth. The same problem applies to any judge you build, as [LLM-as-a-judge](https://aifordevs.org/articles/llm-as-a-judge) explains.

### Agent runner and effort setting

The agent runner moves scores by several points. On Vals AI's [SWE-bench Verified run](https://www.vals.ai/benchmarks/swebench), GPT 5.5 scored 82.6% in mini-SWE-agent, 76.4% in Codex, and 76.2% in Factory. Claude Opus 4.8 scored 88.6% in mini-SWE-agent and 85.8% in Claude Code.

Effort moves scores further. Terminal-Bench 4.0 shows Opus 5 from 34.85% at low effort to 53.94% at xhigh.

**Figure 2.** One model can span 19 points by effort setting and 6 points by agent runner, more than the gaps between the top models, so any comparison must fix both.

Scale's [V2 study](https://labs.scale.com/blog/swe-bench-pro-v2) found the opposite for its strongest open-weight models. Mini-swe-agent, Pi, and OpenCode did not change the outcome on an equal budget, and Scale recommends picking a runner on token cost. Inkling did worse under Pi, so that finding does not cover every model.

### Model versus coding agent product

The best AI for coding is usually a product, and no board above measures a model alone. Artificial Analysis states it directly: "Each public row is an agent variant, not a model." The [agent loop](https://aifordevs.org/glossary#agent-loop), tool set, and defaults are all part of the score you see.

Anthropic's Sonnet 5.5 post gives a concrete case. It says Sonnet 5.5 scored lower on FrontierCode at max effort than at xhigh. At max effort it more often ran Claude Code's code-review skill, which in two cases Cognition examined caused a timeout or out-of-scope edits.

To learn how a model behaves on your code, [build your own eval](https://aifordevs.org/articles/llm-evaluation) instead of trusting anyone's average.

## The best AI model for coding on a budget

GPT-6.1 Sol is the best AI model for coding when cost per solved task matters most. On the Terminal-Bench 4.0 board it solved 192 of 330 trials for $634 in total, or $3.30 per solved trial, against $22.05 for Claude Opus 5.5 at max effort.

List prices below are per million tokens at standard tier, read November 8, 2026, from each provider's own page: [Anthropic](https://platform.claude.com/docs/en/about-claude/pricing), [OpenAI](https://developers.openai.com/api/docs/pricing), [Google](https://aistudio.google.com/docs/pricing), and [DeepSeek](https://api-docs.deepseek.com/quick_start/pricing/). The [Claude API pricing guide](https://aifordevs.org/articles/claude-api-pricing) and [Gemini API pricing guide](https://aifordevs.org/articles/gemini-api-pricing) go deeper on each.

| Model (vendor's list price) | Input | Cached input | Output | Long-prompt rule |
| --- | --- | --- | --- | --- |
| Claude Opus 5.5 | $4.00 | $0.20 | $20.00 | Same rate to 1M tokens |
| Claude Sonnet 5.5 | $2.00 | $0.10 | $10.00 | Same rate to 1M tokens |
| GPT-6.1 Sol | $2.00 | $0.10 | $10.00 | Over 272K input: 2x input and cache, 1.5x output |
| GPT-6.1 Terra | $1.00 | $0.05 | $5.00 | Same 272K rule |
| GPT-6 Astra | $10.00 | $1.00 | $50.00 | Same 272K rule |
| Gemini 3.8 Flash | $0.75 to Dec 31, 2026, then $1.50 | $0.075, then $0.15 | $3.75, then $7.50 | One listed rate |
| Gemini 4 Argon | $2.00 to Nov 30, 2026, then $4.00 | $0.10, then $0.20 | $10.00, then $20.00 | One listed rate |
| DeepSeek V4.1 Flash | $0.15 off-peak, $0.30 peak | $0.003, $0.006 | $0.60, $1.20 | One listed rate |

Sol and Sonnet 5.5 share a list price, so the cost gap between them in the board runs comes from how many tokens each run used. The Coding Agent Index shows the same order for Sonnet 5.5 and Opus 5.5, $13.30 against $11.42 per task.

**Figure 3.** Up to $1.50 per task, 23 index points cost $1.34; the next 8 points to Opus 5.5 cost $9.92, so stop at GPT-6.1 Sol until you measure the difference on your own work.

On Artificial Analysis's [Coding Agent Index](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-codex), each point above GPT-6.1 Sol costs about $1.24 per task, against about six cents per point below it.

A third-party Terminal-Bench 4.0 row for DeepSeek V4.1 Flash, which costs $0.39 per index task, or a Sol price increase would change this pick.

## Best coding LLM for large repositories

Claude Sonnet 5.5 is the best coding LLM for prompts near 1M tokens. It scored 71.8 ±8.0 on [SWE Atlas QnA](https://labs.scale.com/leaderboard/swe-atlas?tab=qna), and Anthropic bills 1M-token requests at the standard rate, so an uncached 800K-token turn costs $1.65, about half of GPT-6.1 Sol's $3.28.

| Model | Context window (vendor) | SWE Atlas QnA (third-party) | 800K in, 5K out, cold | Same turn, 95% cache hits |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | 1M | 71.8 ±8.0 | $1.65 | $0.21 |
| Claude Opus 5.5 | 1M | 77.4 ±7.5 | $3.30 | $0.41 |
| GPT-6.1 Sol | 1.05M, 922K max input | 71.0 ±8.1 | $3.28 | $0.39 |
| GPT-6 Astra | 1.05M | 70.2 ±8.2 | $16.38 | $2.70 |
| Gemini 4 Argon, to Nov 30 | 1M | 65.3 ±8.5 | $1.65 | $0.21 |
| Gemini 3.8 Flash, to Dec 31 | 1,048,576 | 45.2 ±8.9 | $0.62 | $0.11 |
| DeepSeek V4.1 Flash | 1M | 71.0 ±8.1 | $0.12 to $0.25 | $0.01 to $0.02 |

Context windows come from each vendor's model pages: [Anthropic](https://platform.claude.com/docs/en/models/overview), [OpenAI](https://developers.openai.com/api/docs/models/gpt-6.1-sol), and [Google](https://aistudio.google.com/docs/models/gemini-3.8-flash).

Costs are derived from the list prices above, recomputed in code, and exclude cache-write charges. Opus 5.5 scores highest on this test, but its ±7.5 interval overlaps Sonnet 5.5's, and Sonnet 5.5 costs half as much per turn. OpenAI's [272K rule](https://developers.openai.com/api/docs/models/gpt-6.1-sol) applies to the full request, so a large prompt crosses it all at once.

DeepSeek V4.1 Flash matches Sonnet 5.5 on this test at about one-seventh to one-thirteenth the cold cost. Its [privacy policy](https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html) says DeepSeek stores personal data in China, so read its API terms before sending proprietary code. Its [MIT-licensed weights](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash) total about 510 GB, so self-hosting needs a server.

Filling the [context window](https://aifordevs.org/glossary#context-window) is rarely the goal. [Context engineering](https://aifordevs.org/articles/context-engineering) covers keeping prompts narrow, and [prompt caching](https://aifordevs.org/glossary#prompt-caching) is what makes the last column possible.

## Best local LLM for coding, by hardware tier

The best local LLM for coding on 24 to 64 GB of memory is Qwen3.8-27B, under Apache 2.0. Plan for the GGUF file plus 64 KiB per token of context. Every coding score on [its model card](https://huggingface.co/Qwen/Qwen3.8-27B) comes from Qwen, and none of the third-party boards above lists it yet.

Estimates below add [GGUF](https://aifordevs.org/glossary#gguf) file sizes from Hugging Face to computed [KV cache](https://aifordevs.org/glossary#kv-cache) memory for the chosen context. They are estimates, not measurements: this article did not run these models. Add headroom for the operating system and your tools.

| Memory | Build ([quantization](https://aifordevs.org/glossary#quantization)) | Weights | Context | Estimated total | Use it for |
| --- | --- | --- | --- | --- | --- |
| 16 GB | Qwen3.8-27B, [UD-Q2_K_XL](https://huggingface.co/api/models/unsloth/Qwen3.8-27B-GGUF/tree/main) | 9.15 GiB | 32K | 11.15 GiB | Chat and small edits; Qwen publishes no 2-bit scores |
| 24 GB GPU | Qwen3.8-27B, UD-Q4_K_XL | 16.35 GiB | 64K | 20.35 GiB | Short agent runs |
| 32 GB unified | Qwen3.8-27B, UD-Q4_K_XL | 16.35 GiB | 128K | 24.35 GiB | Daily agent work |
| 64 GB | Qwen3.8-27B, [Q8_0](https://huggingface.co/api/models/ggml-org/Qwen3.8-27B-GGUF/tree/main) | 26.63 GiB | 256K | 42.63 GiB | Matches Qwen's 256K test window |
| 128 GB | Laguna S 2.1, [Q4_K_M](https://huggingface.co/api/models/poolside/Laguna-S-2.1-GGUF/tree/main) | 89.44 GiB | 256K | 101.51 GiB | Only if you need its 1M window |
| 256 GB and up | Laguna S 2.1, Q8_0 | 119.91 GiB | 1M | 167.98 GiB | Full 1M context |

Qwen's card gives no memory figure, so the KV cache is computed from each [configuration file](https://huggingface.co/Qwen/Qwen3.8-27B/raw/main/config.json). Qwen3.8-27B stores keys and values for 16 full-attention layers out of 64, and its other 48 layers are linear-attention layers, assumed here to keep a fixed-size state.

[Laguna S 2.1](https://huggingface.co/poolside/Laguna-S-2.1/raw/main/config.json) keeps every token for 12 full-attention layers and only 512 tokens for its 36 sliding-window layers. The script below ran on Python 3.15.1 with no dependencies, and no model was loaded.

```python title="kv_budget.py"
GIB = 1024**3


def kv_bytes_per_token(full_layers, kv_heads, head_dim, elem_bytes=2):
    # One K tensor and one V tensor per layer that stores every token.
    return full_layers * 2 * kv_heads * head_dim * elem_bytes


def budget_gib(file_bytes, ctx_tokens, per_token_bytes, fixed_bytes=0):
    return (file_bytes + ctx_tokens * per_token_bytes + fixed_bytes) / GIB


qwen = kv_bytes_per_token(full_layers=16, kv_heads=4, head_dim=256)
laguna = kv_bytes_per_token(full_layers=12, kv_heads=8, head_dim=128)
laguna_sliding = 36 * 2 * 8 * 128 * 2 * 512  # 36 layers, 512-token window

print(f"Qwen3.8-27B: {qwen / 1024:.0f} KiB per token")
print(f"Laguna S 2.1: {laguna / 1024:.0f} KiB per token")
print(f"Qwen UD-Q4_K_XL at 128K context: {budget_gib(17_559_178_144, 131_072, qwen):.2f} GiB")
print(f"Laguna Q4_K_M at 256K context: {budget_gib(96_031_829_760, 262_144, laguna, laguna_sliding):.2f} GiB")
```

```text
Qwen3.8-27B: 64 KiB per token
Laguna S 2.1: 48 KiB per token
Qwen UD-Q4_K_XL at 128K context: 24.35 GiB
Laguna Q4_K_M at 256K context: 101.51 GiB
```

The 2 in `elem_bytes` is llama.cpp's [default 16-bit KV cache type](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/src/llama-context.cpp). The [KV cache explainer](https://aifordevs.org/articles/kv-cache-explained) covers why the cache grows with context, and the [inference engine comparison](https://aifordevs.org/articles/vllm-sglang-llama-cpp) covers how to serve these files.

More memory does not buy a better local model here. Poolside reports 59.4 for Laguna S 2.1 on SWE-Bench Pro public, and Qwen reports 61.7 for Qwen3.8-27B on SWE-bench Pro, each on its own test setup. Spend extra memory on context length first. 

Laguna S 2.1 activates about 8B of its 118B parameters per token, but as with any [mixture-of-experts model](https://aifordevs.org/articles/mixture-of-experts), all 89.44 GiB of Q4 weights must stay loaded.

Open weights do not always mean local. DeepSeek V4.1 Flash is about 510 GB of weights, and the [Kimi K3 repository](https://huggingface.co/moonshotai/Kimi-K3/tree/main) is 1.56 TB, so both are data-center deployments.

## Pick your best LLM for coding in one afternoon

You can settle the best LLM for coding on your own repository in one afternoon. Take 20 recent merged pull requests, strip the code changes, and run your two finalists through the same agent runner at the same effort setting. Count the patches you would merge, then divide total spend by that count.

1. Pick 20 merged pull requests that represent your work, and save each one's prompt or issue as your [golden dataset](https://aifordevs.org/glossary#golden-dataset).
2. Reset the repository to each pull request's parent commit and give both finalists the same description.
3. Run each model on each task at least three times. Terminal-Bench 4.0 runs five trials per task.
4. Review the diffs yourself, or use a calibrated LLM judge once you trust it, and record whether you would merge each one.
5. Choose the cheaper model as your default if it produces at least 85% as many mergeable patches at less than half the cost per mergeable patch, and route its failures to the stronger model.

That 85% threshold is a starting point, so adjust it to the cost of a bad merge on your team. Rerun the same set when the [evals hub](https://aifordevs.org/topics/evals) or the [news feed](https://aifordevs.org/news) reports a new model, because the boards in this article will move within months.

## Questions

### What is the best LLM for coding right now?

As of November 8, 2026, the best LLM for unattended coding agents is Claude Opus 5.5 in Claude Code. It scored 64.85% on the third-party Terminal-Bench 4.0 board and 62 on the Coding Agent Index. Its lead over Sonnet 5.5 falls inside the reported intervals, and a rerun could reverse the order.

### What is the best local LLM for coding?

Qwen3.8-27B is the best local LLM for coding on machines with 24 to 64 GB of memory. Its Apache-2.0 weights fit in about 16 GiB at 4-bit, and context adds about 64 KiB per token. Every coding score published for it comes from Qwen, and none of the boards in this article lists it yet.

### Is Claude or GPT better for coding?

Claude Opus 5.5 scores higher on the third-party Terminal-Bench 4.0 board, 64.85% against 58.18% for GPT-6.1 Sol and GPT-6 Astra. GPT-6.1 Sol cost about one seventh as much per trial on the same board, so it wins on cost per solved task. Measure both on your own repository before you commit.

### Are SWE-bench scores reliable?

SWE-bench scores on public datasets overstate what a model can do on unseen code. Vals AI archived SWE-bench Verified on September 1, 2026, after performance saturated. Scale's SWE-Bench Pro V2 shows every model it reported on both splits losing 17 to 22 points on private repositories. Use private splits and your own tasks.

### How much memory do I need to run a coding LLM locally?

Budget the GGUF file plus the KV cache for your context length. For Qwen3.8-27B at 4-bit, that is about 16 GiB of weights and 64 KiB per token, so a 128K-token window needs about 24 GiB before the operating system and your tools. A 32 GB machine is a practical floor for agent work.

### What is the cheapest good LLM for coding agents?

GPT-6.1 Sol is the cheapest model near the top of the third-party boards, at $1.92 per Terminal-Bench 4.0 trial and $1.50 per Coding Agent Index task. DeepSeek V4.1 Flash costs less, $0.39 per index task, but scores 47 on the index against 54 for Sol, and it has no Terminal-Bench 4.0 row.

## Sources

1. [Terminal-Bench 4.0 official leaderboard (Stanford, Harbor, Laude Institute)](https://www.tbench.ai/)
2. [Terminal-Bench repository README (Harbor Framework)](https://raw.githubusercontent.com/harbor-framework/terminal-bench/main/README.md)
3. [Artificial Analysis, Coding Agent Index methodology (2026)](https://artificialanalysis.ai/methodology/coding-agents-benchmarking)
4. [Artificial Analysis, Claude Code vs. Codex agent variants (2026)](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-codex)
5. [Artificial Analysis, Claude Code vs. Opencode agent variants (2026)](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-opencode)
6. [Scale Labs, SWE-Bench Pro V2 leaderboard (2026)](https://labs.scale.com/leaderboard/swe_bench_pro_public_v2)
7. [Scale Labs, SWE-Bench Pro V2: A Cleaner, Harder-to-Game Leaderboard (2026)](https://labs.scale.com/blog/swe-bench-pro-v2)
8. [Scale Labs, SWE Atlas leaderboard (2026)](https://labs.scale.com/leaderboard/swe-atlas?tab=qna)
9. [Scale AI, Scale AI announces next phase of company evolution (2025)](https://scale.com/blog/scale-ai-announces-next-phase-of-company-evolution)
10. [Reflection, company site (2026)](https://reflection.ai/)
11. [Vals AI, SWE-bench Verified benchmark (updated September 1, 2026)](https://www.vals.ai/benchmarks/swebench)
12. [Vals AI, About (2026)](https://www.vals.ai/about)
13. [Datacurve, DeepSWE leaderboard v1.1 (2026)](https://deepswe.datacurve.ai/)
14. [Huang et al., DeepSWE: Measuring Frontier Coding Agents on Original, Long-Horizon Engineering Tasks (2026)](https://arxiv.org/abs/2607.07946)
15. [Aleithan et al., SWE-Bench+: Enhanced Coding Benchmark for LLMs (2024)](https://arxiv.org/abs/2410.06992)
16. [Cognition, Devin and FrontierCode (2026)](https://cognition.com/)
17. [Cursor, CursorBench 4.0 (2026)](https://cursor.com/en-US/cursorbench)
18. [Anthropic, Introducing Claude Opus 5.5 (2026)](https://www.anthropic.com/claude-opus-5-5)
19. [Anthropic, Introducing Claude Sonnet 5.5 (2026)](https://www.anthropic.com/claude-sonnet-5-5)
20. [Anthropic, Pricing (read November 8, 2026)](https://platform.claude.com/docs/en/about-claude/pricing)
21. [Anthropic, Models overview (read November 8, 2026)](https://platform.claude.com/docs/en/models/overview)
22. [OpenAI, API pricing (read November 8, 2026)](https://developers.openai.com/api/docs/pricing)
23. [OpenAI, GPT-6.1 Sol model page (read November 8, 2026)](https://developers.openai.com/api/docs/models/gpt-6.1-sol)
24. [Google, Gemini API pricing (read November 8, 2026)](https://aistudio.google.com/docs/pricing)
25. [Google, Gemini 3.8 Flash model page (read November 8, 2026)](https://aistudio.google.com/docs/models/gemini-3.8-flash)
26. [DeepSeek, Models and pricing (read November 8, 2026)](https://api-docs.deepseek.com/quick_start/pricing/)
27. [DeepSeek, Privacy Policy (last updated February 10, 2026)](https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html)
28. [DeepSeek, DeepSeek-V4.1-Flash model card (2026)](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash)
29. [Qwen Team, Qwen3.8-27B model card (2026)](https://huggingface.co/Qwen/Qwen3.8-27B)
30. [Qwen Team, Qwen3.8-27B configuration file (2026)](https://huggingface.co/Qwen/Qwen3.8-27B/raw/main/config.json)
31. [ggml-org, Qwen3.8-27B GGUF files on Hugging Face (2026)](https://huggingface.co/api/models/ggml-org/Qwen3.8-27B-GGUF/tree/main)
32. [Unsloth, Qwen3.8-27B GGUF files on Hugging Face (2026)](https://huggingface.co/api/models/unsloth/Qwen3.8-27B-GGUF/tree/main)
33. [Poolside, Laguna S 2.1 model card (2026)](https://huggingface.co/poolside/Laguna-S-2.1)
34. [Poolside, Laguna S 2.1 configuration file (2026)](https://huggingface.co/poolside/Laguna-S-2.1/raw/main/config.json)
35. [Poolside, Laguna S 2.1 GGUF files on Hugging Face (2026)](https://huggingface.co/api/models/poolside/Laguna-S-2.1-GGUF/tree/main)
36. [Moonshot AI, Kimi K3 repository files (2026)](https://huggingface.co/moonshotai/Kimi-K3/tree/main)
37. [llama.cpp, default KV cache types in llama-context.cpp](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/src/llama-context.cpp)

## Cite this deep dive

AI for Devs. "Best LLM for coding: November 2026 benchmarks, compared." Published November 8, 2026. https://aifordevs.org/articles/best-llm-for-coding

- Page: https://aifordevs.org/articles/best-llm-for-coding
- Markdown: https://aifordevs.org/articles/best-llm-for-coding.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
- Published: 2026-11-08
