Best GPU for local LLM coding: the cheapest card that fits
Which GPU runs a local coding model with room for long prompts? Picks from a used RTX 3060 to three RTX 3090s, with Oct 19, 2026 prices and estimated speeds.
Updated · By RigPerDollar
As an Amazon Associate I earn from qualifying purchases. Some links on this page are affiliate links.
For most people, the best GPU for local LLM coding is a used RTX 3090. Its 24 GB of VRAM (the memory on the graphics card) runs Qwen3-Coder-30B-A3B and Devstral Small with plenty of room for long prompts. On a tight budget, a used RTX 3060 12GB runs JetBrains Mellum2.1 with its full context. The biggest coding model in our data, Qwen3-Coder-Next, needs about 50 GB, which means three 24 GB cards or a machine with lots of unified memory (memory the CPU and GPU share, as on a Mac Studio or Framework Desktop).
Coding prompts get long fast, so this guide picks the cheapest hardware that runs each model with usable context. Context is how much text the model can see at once, counted in tokens (small pieces of words). Speeds are our estimates for llama.cpp, a popular open-source program for running models locally. All prices are from Oct 19, 2026, except the Framework Desktop (Oct 16, 2026).
The short answer by budget
- 12 GB: a used RTX 3060 12GB ($301 used) runs Mellum2.1 with its full 128K context at an est. 144 tok/s (tokens per second, how fast it writes).
- 24 GB: a used RTX 3090 ($1,416 used) runs Qwen3-Coder-30B (est. 242 tok/s) and Devstral Small (est. 54 tok/s) with tens of thousands of tokens of context.
- 32 GB: two new RX 9070 cards ($1,140 for the pair) run Qwen3-Coder-30B with 123K tokens of context at an est. 155 tok/s, or Flint 40B-A2.5B with 168K tokens at an est. 175 tok/s.
- About 50 GB: three new RX 7900 XTX cards ($4,050), three used RTX 3090s ($4,248), both GPU-only prices, or a Framework Desktop ($6,799) run Qwen3-Coder-Next with its full 256K context.
Two RX 9070s cost less than one used 3090 and give you more memory. You do need a board with two slots and a power supply that can feed both cards. The 3090 is simpler, and it generates faster on the mixture-of-experts (MoE) coding models below.
The coding models in our data
The table shows the cheapest setup we price that runs each model with usable context. The file sizes are for Q4 versions, which are compressed to about 4 bits per weight so they fit in less memory. An MoE model runs only a few of its parts for each token, so “active params” is the share of weights it reads per token. A dense model reads all of its weights every time. Context is shown as two numbers: first with the default 16-bit (FP16) cache, then with a smaller 8-bit (q8_0) cache. The cache is the memory that holds the context, explained below. Card prices cover the GPUs only.
| Model | Type | Q4 file | Active params | Memory that works | Cheapest fit (Oct 19, 2026) | Context | Est. tok/s |
|---|---|---|---|---|---|---|---|
| Mellum2.1 12B-A2.5B | MoE | 8.07 GB | 2.5B | 12 GB | RTX 3060 12GB, $301 used | full 128K | 144 |
| Devstral Small 2505 | Dense | 14.33 GB | 23.57B | 24 GB | Two RTX 3060 12GB, $602 used | 51K · 97K | 22 |
| Qwen3-Coder-30B-A3B | MoE | 18.56 GB | 3.3B | 24 GB | Two RTX 3060 12GB, $602 used | 44K · 83K | 124 |
| Flint 40B-A2.5B | MoE | 25.99 GB | 2.5B | 32 GB | Two RX 9070, $1,140 new | 168K · 256K | 175 |
| Qwen3-Coder-Next | MoE | 48.53 GB | 3B | About 50 GB | Three RX 7900 XTX, $4,050 new | full 256K | 138 |
Two used 3060s are the cheapest way to 24 GB, but one used 3090 is much faster with the same context (see the 24 GB section below).
JetBrains’ Mellum2.1 model card calls it “a thinking model” for “complex agentic tasks, such as working in a repository, running commands, and calling tools.” Mistral’s model card describes Devstral Small as “an agentic LLM for software engineering tasks built under a collaboration between Mistral AI and All Hands AI.” Qwen’s model card calls Qwen3-Coder-Next “an open-weight language model designed specifically for coding agents and local development.” The site marks Qwen3-Coder-30B as replaced by Qwen3-Coder-Next.
RigPerDollar ranks hardware by fit, context and estimated speed. We don’t test how well any of these models write code, so pick the model on its own merits first and then use this guide to pick the card.
Why coding needs so much context
A coding assistant sends a lot more than your question. It sends file contents, diffs, tool output and the whole conversation so far, and all of it has to fit in the context window.
The model keeps that context in a KV cache, a block of memory that grows with every token. How fast it grows depends on the model. Devstral, a dense model, uses 163,840 bytes per token at FP16. Qwen3-Coder-Next uses 24,576 bytes per token, and Mellum2.1 uses 14,336. So the same card can hold very different amounts of code depending on the model.
Devstral on 16 GB cards: under 8K tokens of context
Devstral Small loads on a 16 GB card, but only just. With the default cache it gets about 3K tokens of context, and 7K with the 8-bit cache. Our fit rule calls anything under 8K “tight.”
Speed is fine there (est. 27 tok/s on an RTX 5060 Ti 16GB at $780 new, 55 on an RTX 5080 at $1,600 new), but 3K to 7K tokens of context leaves little room for code. On 24 GB the same model gets 51K tokens (97K with the 8-bit cache).
Qwen3-Coder-30B doesn’t fit 16 GB at all. On an RTX 5060 Ti it comes up 4.1 GB short. On a 16 GB card, Mellum2.1 is the coding model that fits well: full 128K context at an est. 173 tok/s on an RX 9070 ($570 new).
24 GB: the used RTX 3090 and its rivals
The used RTX 3090 ($1,416, the low end of the typical range across 337 eBay sales tracked by gpusold.com) is the value pick for coding. It gives Qwen3-Coder-30B 44K tokens of context (83K with the 8-bit cache) at an est. 242 tok/s. That works out to $5.85 per est. tok/s. Devstral gets 51K tokens of context (97K with the 8-bit cache) at est. 54 tok/s. You can check these numbers with the My Rig preset for the RTX 3090.
A new RX 7900 XTX ($1,350) has the same 24 GB and the same context, at an est. 196 tok/s on Qwen3-Coder-30B and 52 on Devstral. A used RTX 4090 ($2,906) is only a little faster than the 3090, at est. 252 and 58.
Flint 40B-A2.5B doesn’t fit 24 GB. On an RTX 3090 or RX 7900 XTX it comes up 3.5 GB short.
32 GB: two RX 9070s or an RTX 5090
At 32 GB, Qwen3-Coder-30B gets 123K tokens of context with the default cache and 232K with the 8-bit cache. Two RX 9070s reach that for $1,140 new, at an est. 155 tok/s.
The RTX 5090 ($6,500 new, lowest Newegg listing) gets the same context at an est. 336 tok/s. It also runs Devstral with 99K tokens at FP16 (full 128K with the 8-bit cache) at est. 97 tok/s. It is fast, but you pay $19 per est. tok/s on Qwen3-Coder-30B, against $7.35 for two RX 9070s.
Flint: a new pick for 32 GB and 48 GB Macs
Recursive Flint 40B-A2.5B is an MoE model with 39.8B parameters in total and about 2.5B active per token. It uses the Apache 2.0 license, and its context goes up to 256K tokens (262,144). Recursive’s official file is Q4_1 at 25.99 GB, a little bigger than a typical Q4 file. Support for it was merged into llama.cpp on Oct 21, 2026. The Flint model card has Recursive’s own details.
By our fit rule, Flint needs about 27.1 GB at minimum (4K context with the 8-bit cache), so it fits 32 GB and up. That makes it a strong match for the two RX 9070 value pick:
- Two new RX 9070 (32 GB, $1,140): est. 175 tok/s, with 168K tokens of context at FP16 and the full 256K with the 8-bit cache.
- RTX 5090 (32 GB, $6,500 new): est. 366 tok/s, with the same 168K and 256K.
- Two used RTX 3090s (48 GB): est. 272 tok/s with the full 256K.
- A Mac with 48 GB of unified memory, of which about 36 GB is usable by the GPU: est. 85 tok/s on an M4 Pro, 118 on a 40-core M4 Max and 124 on a 40-core M5 Max, all with the full 256K.
Recursive claims Flint runs at 125+ tok/s on an M4 Pro MacBook Pro and 150+ tok/s on a 64GB “RTX Spark.” Those are Recursive’s own numbers, at short context, using the engine Recursive recommends. There are no measured llama.cpp benchmarks for Flint yet, so our numbers above are estimates. Our M4 Pro estimate of 85 tok/s is below Recursive’s 125+, which came from a different engine.
Qwen3-Coder-Next and the 48 GB near miss
Qwen3-Coder-Next has 80B parameters in total, with 3B active per token. Its Q4 file is 48.53 GB, so it needs about 50 GB once you add headroom. That makes 48 GB a frustrating near miss. Two RTX 3090s, one RTX A6000 48GB, or a 64 GB Mac Studio all come up 2.1 GB short.
These setups fit it with the full 256K context:
- Three used RTX 3090s (72 GB, $4,248): est. 158 tok/s.
- Three new RX 7900 XTX (72 GB, $4,050): est. 138 tok/s.
- Framework Desktop with Ryzen AI Max+ PRO 495 and 192 GB of unified memory ($6,799 starting price for the DIY edition without storage or OS, dated Oct 16, 2026): est. 74 tok/s.
The three-card prices cover the GPUs only. You would also need a motherboard with room for three cards and a power supply that can feed them. The Framework Desktop price is a whole computer apart from storage and the OS. Our dual RTX 3090 build guide (in the Related list) shows what the rest of a multi-GPU PC costs.
Qwen’s model card suggests cutting context to 32,768 tokens if you run out of memory. That shrinks the cache, but the file alone is too big for 48 GB.
Why MoE coding models are so fast
Four of the five models here are MoE models. Only a few “expert” parts run for each token, so the card reads far less memory per token than it does for a dense model like Devstral. That’s why Qwen3-Coder-30B is more than four times faster than Devstral on the same 3090 (est. 242 against 54 tok/s).
Extra identical cards add memory while speed stays about the same. In published llama-bench runs (llama.cpp’s speed test, posted on ahelpme.com), one, two and three RTX 3090s ran Qwen3.6-27B at 40.1, 40.6 and 39.5 tok/s. Buy extra cards to fit a bigger model or more context.
What these estimates leave out
Our speeds estimate how fast llama.cpp writes tokens at short context. Three things they leave out matter for coding:
- Time to first token. Before the model writes anything, it has to read your whole prompt. With big coding prompts this wait can be long, and we don’t model it.
- Long-context slowdown. Every new token reads the whole KV cache, so speed drops as context fills, often by 20% or more by 8K tokens.
- System RAM offloading. Running part of a model from system memory isn’t modelled.
The methodology page explains these limits in more detail.