Which local coding LLM runs on 8 GB of VRAM?
On 8 GB, run an 8B class model at Q4_K_M. Qwen3 8B is the strongest general pick that is also good at code, and StarCoder2 3B or 7B is the pick for in-editor completion rather than conversation. Nothing much larger than 10B fits at Q4 once you leave room for context.
The arithmetic is simple enough to do in your head. This site's quantization guide prices Q4_K_M at 4.8 bits per weight, roughly 0.6 GB per billion parameters, plus about 10 percent runtime overhead[5], and the VRAM guide walks the same sizing card by card. That is a calculation, not a measurement: an 8B model is 8 x 0.6 = 4.8 GB of weights, about 5.3 GB loaded. The catalog lists Qwen3 8B at 6 to 7 GB because it budgets some context[4]. Either way an 8 GB card has 1 to 2 GB left, which is what the guide says an 8K KV cache costs[5].
Qwen3 8B. Alibaba's Qwen family, 8B dense, Apache 2.0, 128K context, 6 to 7 GB at Q4_K_M[4]. It is the most downloaded model in this comparison by a wide margin: 15,911,466 downloads and 1,274 likes on Hugging Face, recorded on 2026-08-03[6]. The catalog calls it a leader in multilingual, coding and long-context work for its size class but names no benchmark, so treat that as editorial judgment rather than a measured result[4].
StarCoder2 3B / 7B. BigCode and Hugging Face, 3 to 5 GB, 16K context, BigCode OpenRAIL-M license[4]. Purpose-built for fill-in-the-middle completion across 600 or more languages, which is the job an IDE plugin actually asks a model to do. Two caveats: 16K context is small by 2026 standards, and OpenRAIL-M carries use restrictions a permissive license does not. No traction figure exists for it[6].
Qwen3.5 4B. Apache 2.0, 262K native context, at the low end of the family's 3 to 18 GB band, with 6,587,751 downloads and 780 likes on 2026-08-03[4][6]. Take it over Qwen3 8B only if you need long context more than capability. The research brief instead recommends a Qwen3-Coder 7B for 8 GB cards and prices a Qwen2.5-Coder 7B at roughly 5 GB at Q4, both practitioner-reported[1][3]; neither is in this site's catalog, so neither is recommended here.
What is the best local LLM for coding in 2026?
For a single consumer GPU, the best local coding models in 2026 are the 30B class models that fit a 24 GB card at Q4: Qwen3-Coder 32B Dense and GLM-4.7-Flash. Below that tier, the answer is whichever model fits. Above it, stronger open-weight coding models exist but do not fit consumer hardware at any usable quantization.
Qwen3-Coder (32B Dense). Alibaba, 32B dense, Apache 2.0, 256K context, about 20 GB at Q4[4]. Calculation check: 32 x 0.6 = 19.2 GB of weights, about 21 GB loaded, which is why the catalog calls it a tight fit on 24 GB with long context[4][5]. Dense rather than MoE, so no expert-residency surprise. The Hugging Face fetch for it returned HTTP 401 on 2026-08-03, so there is no download figure[6], but the Qwen3-Coder launch post drew 765 points and 366 comments on Hacker News on 2025-07-22[7].
GLM-4.7-Flash (30B MoE / 3B active). Zhipu AI, 200K context, about 20 GB at Q4[4]. Only 3B parameters activate per token, so it stays fast even when layers are offloaded, but all 30B must be resident. The catalog credits it with 59.2 percent on SWE-bench and 60 to 80 tokens per second at 4-bit, naming no source for either, so both are site assertions rather than cited results[4]. Traction is measured: 2,074,814 downloads and 1,800 likes on 2026-08-03[6], plus 378 Hacker News points on 2026-01-19[7].
What the ceiling looks like. DeepSeek V4 Pro is practitioner-reported at about 91.2 percent on SWE-bench Verified[2], and the Qwen3-Coder-Next Technical Report puts that model at 70.6 percent on the same benchmark under a SWE-Agent harness[9]. But Qwen3-Coder-Next needs about 43 GB at Q4, practitioner-reported[3], and V4 Pro is a 1.6 trillion parameter MoE[1], so neither fits a consumer card.
Can you run a coding LLM on a 16 GB RAM laptop?
Yes, if you keep the model at 8B or below and accept slower generation. A 16 GB laptop with no discrete GPU runs the model in system RAM on the CPU, and this site's quantization guide puts each offloaded layer at roughly 3 to 10 times slower than on a GPU[5]. A 16 GB discrete card is a much better situation.
On 16 GB of system RAM. Budget for the operating system first. A 7B or 8B model at Q4_K_M is about 4.2 to 5.3 GB of weights by the site's rule of thumb, leaving comfortable room[5]. A 14B at Q4 is about 8.4 GB, or roughly 10.7 GB as the catalog lists Qwen3 14B[4][5]: it fits, but leaves little for context or for anything else the laptop is doing. Prefer the 8B, and do not expect agentic multi-file work to feel good at these speeds. The VRAM guide covers the system-RAM and offload case in more detail.
On a 16 GB discrete GPU, three catalog models fit well:
- Devstral Small 2 (24B). Mistral AI, 24B dense, Apache 2.0, 128K context, about 15 GB at Q4[4]. Built for agentic coding and multi-file understanding, and the brief describes Devstral-Small identically: 24B dense, Apache 2.0, 128K, aimed at code agents and CLI workflows[1]. Mistral AI's own announcement puts Devstral Small 2 at 68.0 percent on SWE-bench Verified[8], which is the figure the catalog card carries. No download signal exists for it[6].
- Phi-4 (14B). Microsoft, MIT, 128K context, with a full catalog breakdown: about 11 GB at Q4, 16 GB at Q8, 28 GB at FP16[4]. Q8 on a 16 GB card is the interesting option, because it buys near-lossless quality on the task type most sensitive to quantization. 664,421 downloads and 2,285 likes on 2026-08-03[6].
- Codestral 25.05 (25B). Mistral, 256K context, about 16 GB at Q4, licensed non-commercial per the catalog and named as the Mistral AI Non-Production License by the brief, which also describes it as IDE-first with native fill-in-the-middle training[1][2][4]. Excellent completion model, unusable commercially without a separate license.
Qwen Coder or DeepSeek Coder: which should you run locally?
For a single consumer GPU in 2026, Qwen. Its coding line includes a dense 32B that fits a 24 GB card at Q4, while DeepSeek's jumps from a 16B straight to models measured in hundreds of billions of parameters. With datacenter-class memory, DeepSeek's flagships carry the higher reported benchmark numbers.
Qwen Coder. The catalog carries Qwen3-Coder 32B Dense (Apache 2.0, 256K context, about 20 GB at Q4) and Qwen3-Coder 480B MoE with 35B active (Apache 2.0, 256K context, 200 GB or more)[4]. On the 480B, Nebius reports 66.5 percent Pass@1 on SWE-bench Verified from OpenHands trajectories[10]; the catalog card's 55.4 percent predates that result and is being corrected. The brief adds coverage of up to 92 programming languages, practitioner-reported, and lists the weaknesses candidly: inconsistent output on complex multi-file tasks, occasionally verbose code, and difficulty with hard-tier reasoning and abstract math[2]. The 480B has 91,304 downloads and 1,357 likes on 2026-08-03[6].
DeepSeek Coder. The catalog carries DeepSeek Coder V2 in 16B and 236B forms, MIT licensed, 128K context, 10 GB to more than 50 GB depending on which you take[4]. The 16B at roughly 10 GB is a genuine 16 GB card option. The Instruct checkpoint shows 7,168 downloads and 696 likes on 2026-08-03[6] and its best Hacker News moment was 28 points in June 2024[7], which reads as an older release rather than an unpopular one. The brief reports the newer V4 Pro and V4 Flash as MIT with 1,000,000 token contexts, practitioner-reported[1], but neither is catalogued here and neither runs locally.
Licensing is a tie: Apache 2.0 and MIT are both permissive and clean for commercial use. That separates this pair from Codestral and StarCoder2, not from each other.
What is the best open-source coding model to self-host?
If self-hosting means shipping something commercial, filter by license first and the field narrows fast. Qwen3-Coder 32B Dense and Devstral Small 2, both Apache 2.0, are the two best-licensed dedicated coding models in this site's catalog that also fit consumer hardware[4].
License is the constraint most comparison articles skip. Among the coding-focused catalog entries: those two are Apache 2.0, DeepSeek Coder V2 and Phi-4 are MIT, GLM-4.7-Flash is listed as "Open", StarCoder2 is BigCode OpenRAIL-M with use restrictions, and Codestral is non-commercial[4]. Only the first four are unambiguously safe for a commercial self-hosted deployment without further reading.
| Model | License as catalogued | Commercial self-host |
|---|---|---|
| Qwen3-Coder 32B Dense | Apache 2.0 | Unambiguously safe |
| Devstral Small 2 | Apache 2.0 | Unambiguously safe |
| DeepSeek Coder V2 | MIT | Unambiguously safe |
| Phi-4 | MIT | Unambiguously safe |
| GLM-4.7-Flash | Listed only as "Open" | Read the actual license first |
| StarCoder2 | BigCode OpenRAIL-M | Use restrictions apply |
| Codestral 25.05 | Non-commercial | No, needs a separate license |
Two things matter once a model is in production. Dense beats MoE for predictability on a single card, because an MoE's memory cost is set by total parameters and its speed by active parameters[5]. And if your environment demands auditability, OLMo 3.1 is the only catalog family publishing training code, dataset and checkpoints rather than weights alone, with the 32B at roughly 18 to 20 GB at Q4 and a 65K context[4].
Which quantization should you use for a coding model on 8 GB?
Q4_K_M. It is this site's default for every VRAM figure it publishes, and the last level where structured code output holds up. Do not go below Q4 for coding, and do not reach for a bigger model at a lower quantization to compensate.
Two reasons, both from the quantization guide. Its sensitivity table rates structured code as highly sensitive, second only to math and logic, with syntax errors, wrong function signatures and broken JSON as the failures that appear below Q4[5]. Casual chat degrades gracefully; code does not. And its rule of thumb is that a smaller model at a higher quantization usually beats a larger model at a lower one, precisely for coding[5].
On what Q4_K_M costs in quality, the practitioner-reported range is 95 to 97 percent of FP16 quality on most benchmarks[3][5], and that is the figure this site now uses throughout. Reports also recommend a 15 to 40 percent buffer over raw weight size for context, activations and KV cache[3]. On an 8 GB card, use that buffer. The quantization guide has the full compression table and the per-task sensitivity breakdown, and the model catalog lists a Q4_K_M VRAM figure for every model it carries, which is the fastest way to check a card against a model.
How were these models compared, and what is not being claimed?
Every recommendation above rests on one of three kinds of evidence, not equally strong: benchmark figures from named primary sources where they resolve and from a dated research brief where they do not, traction from this site's signals pipeline fetched on a single date, and VRAM figures that are either catalog entries or arithmetic shown in full. Nothing here was measured on our hardware.
What each claim rests on
- Benchmark standing. Three figures trace to named primary sources: Devstral Small 2 at 68.0 percent on SWE-bench Verified from Mistral AI[8], Qwen3-Coder-Next at 70.6 percent under a SWE-Agent harness from its technical report[9], and Qwen3-Coder 480B at 66.5 percent Pass@1 from Nebius[10]. Every other SWE-bench Verified, HumanEval and MBPP+ figure here comes from a Gemini-grounded research brief generated on 2026-08-10, with the benchmark named[1][2][3], and is described as practitioner-reported because the brief's own sources do not resolve to a publisher. GLM-4.7-Flash at 59.2 percent comes instead from this site's catalog, where the card states it without a citation, and is labeled above as a site assertion[4]. The catalog card for Qwen3-Coder 480B still shows 55.4 percent; the sourced figure is 66.5 percent Pass@1 and the card is being corrected.
- Community traction. Download and like counts come from this site's signals pipeline, fetched from the Hugging Face API on 2026-08-03[6]. Hacker News points and comments come from the same pipeline, dated[7]. These measure attention, not quality.
- VRAM footprints. Where the catalog publishes a figure, it is quoted[4]. Where arithmetic is shown, it uses the quantization guide's rule of thumb, roughly 0.6 GB per billion parameters at Q4_K_M plus overhead, and is labeled a calculation[5].
What is not being claimed
- No first-party benchmark runs. We did not run SWE-bench, HumanEval or any other evaluation. Every score is reported from a source, and if that source is wrong, this page is wrong.
- No speed figures of our own. The one tokens-per-second number here, 60 to 80 for GLM-4.7-Flash at 4-bit, is the catalog's own claim and is flagged as such[4]. Throughput depends on your card, runner, context length and quantization.
- No claim that these are the best models in existence. They are the best fits among the models this site catalogs, for the three tiers in the title. The brief documents models we do not carry, including Qwen3-Coder-Next, DeepSeek V4 Pro and V4 Flash, and GLM-5.2[1]. Where the brief and the catalog disagree on a version or a size, the disagreement is stated rather than resolved in favor of whichever sounded better.
- No uniform citation strength. The three figures above trace to named publishers. The rest of the brief's benchmark numbers, including the DeepSeek V4 Pro figure, rest on search-grounding redirect URLs with no resolvable publisher, so they are given as practitioner-reported and are not linked. That is the weakest link in the chain, stated rather than hidden.
- No claim about missing traction data. Five Hugging Face fetches failed with an authorization error on 2026-08-03, including Qwen3-Coder 32B Dense and Codestral, and are recorded as zero downloads[6]. A failed fetch is not a measurement, and none of those zeros are reported as traction.
FAQ
Do I need a dedicated coding model, or will a general model do?
On an 8 GB card, a strong general model like Qwen3 8B is usually the better single choice, because you get code plus everything else in the same 6 to 7 GB[4]. Dedicated coding models earn their place at 16 GB and above, where Devstral Small 2 and Qwen3-Coder 32B Dense bring agentic multi-file behavior a general model of the same size does not have[1][4].
Does a bigger context window help with code?
Only if you have the VRAM for it. This site's quantization guide puts the KV cache at 1 to 2 GB at 8K, 4 to 8 GB at 32K, and 20 to 40 GB at 128K[5], so a model advertising 256K context on a 24 GB card cannot use anywhere near that. The brief adds that quality can degrade at very large contexts and that runner defaults often cap context far below the advertised maximum[2].
Can I run these on an AMD card or an Apple Silicon Mac?
Broadly yes, with the same VRAM arithmetic. The catalog notes GLM-4.7-Flash running on RTX 3090 and 4090 class cards and on Apple M-series[4], and the brief lists Ollama, llama.cpp and LM Studio as the common runners, with LM Studio serving GGUF and MLX[3]. On unified-memory Macs the budget is shared with the system, so size down.
Will a 24 GB card run the frontier open models like DeepSeek V4 or GLM-5?
No. Those are MoE models measured in hundreds of billions of parameters, and MoE reduces compute per token, not memory: every expert weight must be resident even though only a subset activates, so a 236B MoE with 22B active still needs roughly 120 GB at Q4[5]. Speed follows active parameters, memory follows total parameters.
Sources
- Gemini web-grounded research brief,
research/grounding-coding-llm.json, query 1: parameter counts, context lengths, licenses, training lineage and intended use for Qwen Coder, DeepSeek Coder, Codestral, Devstral and GLM. Generated 2026-08-10. Its own source list is search-grounding redirects with no resolvable publisher, so figures resting on it alone are given as practitioner-reported and are not linked. - Same brief, query 2: documented strengths, weaknesses and benchmark scores (SWE-bench Verified, HumanEval, MBPP+, LiveCodeBench, Terminal-Bench) versus peer models. Answer truncated mid-entry at Codestral.
- Same brief, query 3: VRAM requirements at Q4, Q5, Q8 and FP16, and runner support for Ollama, llama.cpp and LM Studio. Answer truncated mid-entry at DeepSeek.
- local-ai-models.ai model catalog, local-ai-models.html, site build v2026.08.24, 100 models. Per-model size, Q4_K_M VRAM figure, context window, license and card claims.
- local-ai-models.ai quantization guide, quantization.html: compression table for Llama 3.3 70B at seven levels, task sensitivity table, MoE memory behavior, KV cache cost by context length, and CPU offload penalty.
- local-ai-models.ai model signals pipeline,
data/model-signals/*.json: Hugging Face rolling 30-day download counts and like counts, fetched 2026-08-03 (the Hub download counter covers the prior 30 days). Five fetches returned HTTP 401 and are recorded as zero. - Same pipeline, Hacker News records with submission dates, point counts and comment counts.
- Mistral AI, Devstral 2 and Vibe CLI announcement: Devstral Small 2 at 68.0 percent on SWE-bench Verified. mistral.ai/news/devstral-2-vibe-cli
- Qwen3-Coder-Next Technical Report: 70.6 percent on SWE-bench Verified under a SWE-Agent harness. arxiv.org/html/2603.00729v1
- Nebius, OpenHands trajectories with Qwen3-Coder-480B: 66.5 percent Pass@1 on SWE-bench Verified for Qwen3-Coder-480B-A35B. nebius.com/blog/posts/openhands-trajectories-with-qwen3-coder-480b