Best LLMs for Coding
Choosing a coding model involves a real tradeoff: the strongest models on code benchmarks are often an order of magnitude more expensive per token than models that score within a few points of them. This page ranks models by their measured performance on code-generation benchmarks (SciCode, Terminal-Bench Hard, and LiveCodeBench where published), so the quality side of that tradeoff rests on published evidence rather than creator claims.
The quality index shown is the same per-task projection the Inferbase router consults when it routes coding traffic in production. Terminal-Bench Hard, an agentic coding evaluation that measures task completion in a real terminal, is part of that projection; benchmark publishers have been shifting their newest evaluation rounds toward it, so for the most recent frontier models it is often the coding evidence that exists. Where a model has no published result on a benchmark, the cell says so; absence of evidence is shown as absence, not filled in with a guess.
The top pick
The strongest measured fit for this task right now, taken from the live ranking below.
The ranking
Ordered from live catalog data; the note beneath the table states exactly how. Missing values are shown as missing, never estimated.
| # | Model | Quality index | SciCode | Terminal-Bench Hard | Context |
|---|---|---|---|---|---|
| 1 | anthropic | 100 | 66.9% | No data | 1M |
| 2 | anthropic | 98.7 | 63.1% | No data | 1M |
| 3 | anthropic | 97.8 | 61.0% | 62.9% | 1M |
| 4 | google | 97.5 | 61.8% | No data | 1M |
| 5 | openai | 97.4 | No data | 57.6% | 1.1M |
| 6 | anthropic | 96.2 | 61.0% | No data | 1M |
| 7 | openai | 95.4 | No data | 53.0% | 400K |
| 8 | openai | 93.9 | No data | 47.0% | 400K |
| 9 | xiaomi | 93.7 | 60.9% | No data | 1M |
| 10 | anthropic | 93.4 | No data | 51.5% | 1M |
This list is ordered by the same per-task quality projection the Inferbase router uses to route production traffic: benchmark results from independent suites are normalized and combined per task. The quality index is a 0-100 percentile among the 193 models with measured evidence for this task. Models without published benchmark results here are not ranked, and not guessed at.
marks models served through the Inferbase API. Missing values are shown as No data rather than estimated.
Also worth evaluating
The next ranks after the top ten, for teams that want a wider shortlist.
Or stop choosing manually
The honest answer changes as benchmarks and prices move. Routing makes the choice per request instead of once.
Send model="auto" to one OpenAI-compatible endpoint and each request is served by the best fit from the same quality and price data behind this ranking, with the decision disclosed per request.
Every routed request records the task it was classified as, the models that qualified, the one that won and why, so a pick made here can be checked against what the router chose in production. A model pinned by name is served as named, with no routing decision.
from openai import OpenAI
client = OpenAI(
base_url="https://api.inferbase.ai/v1",
api_key="YOUR_INFERBASE_KEY",
)
# Let routing pick the best model per request,
# or pin any model id from GET /models.
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "..."}],
)Frequently asked questions
How this ranking works and how to act on it.
Benchmark results on SciCode, Terminal-Bench Hard, and LiveCodeBench (where published) are normalized within each suite and combined into a per-task quality score, the same projection the Inferbase router uses to route coding requests in production. The displayed index is a 0-100 percentile among models with measured coding evidence.
Models appear only when a covered benchmark suite has published code-generation results for them. A missing model is not a judgment; it means there is no measured evidence to rank it on, and this page does not substitute estimates for evidence.
No. The ranking regularly shows models within a few index points of the leader at a fraction of the per-token price. For bulk coding workloads such as boilerplate generation or test scaffolding, a mid-ranked model is often the economically rational pick.
Models marked as served on Inferbase are available through a single OpenAI-compatible endpoint. You can pin any served model by id, or send model="auto" and let the router pick per request based on the same quality data behind this page.
The underlying benchmark and pricing data refresh on the catalog sync cycle, and the page regenerates at least hourly from that data. The date in the title reflects the current data, not an editorial revision.
The highest open-weight entry in the table above; the ranking puts open-weight and proprietary models on the same coding evidence, so the answer is whichever open model sits highest on the date shown. Open a model page for its license, or filter the model catalog by Open Source to see every open-weight option with its benchmark scores.
The ones that test what you ship. SciCode measures scientific programming from a specification; Terminal-Bench Hard measures completing multi-step tasks in a real terminal, the closest published proxy for agentic coding; LiveCodeBench measures competitive-style problem solving on problems published after the model’s training data. A model strong on all three is a safe default; one strong on a single suite is a fit for that kind of work.
Usually not. Completion and small edits are short, well-specified requests that models a tier down answer as well, at a fraction of the price and latency, while a refactor across files or a failing test with an unclear cause rewards the top of the table. Routing makes that split per request: it classifies the task and its complexity and sends each to the cheapest model that clears the quality bar.
Related rankings
The same evidence-first method, applied to other tasks.
Put intelligence in the middle.
One gateway in front of every model, with your policies applied and every decision on record. Start on the free plan with 5,000 requests a month, no card required.