10 Best Open-Source LLM Models for Coding: Local Hardware & Benchmark Guide (2026)

Looking for coding LLMs that can run locally? This guide compares open-weight options for a practical self-hosted programming setup. Can you run a capable coding LLM on a single RTX 4090? Yes—but choosing the right model is less about chasing the biggest parameter count and more about matching the model, quantization, context length and coding workflow to 24 GB of GPU memory. This guide compares ten open-weight models worth evaluating on a local workstation, explains what each is good at, and gives you a repeatable way to benchmark them without confusing published scores with your own results.

Last reviewed: 2 December 2026. This field moves quickly — model releases and runtime support change month to month. If you are reading this well after that date, check each model card for newer releases before building a shortlist.

Editorial transparency: The workstation profile below is supplied for this guide. No local inference run, timing log or pass/fail benchmark dataset was provided for this article. Therefore, the model-fit notes are practical deployment assessments, not claimed hands-on measurements. No TPS, latency, VRAM peak or coding accuracy figures have been invented.

On this page

Coding LLMs: test workstation and what 24 GB of VRAM means

ComponentConfiguration
CPUAMD Ryzen 9 9950X
GPUNVIDIA GeForce RTX 4090, 24 GB VRAM
System memory128 GB DDR5
Storage2 TB NVMe Gen4 SSD
PlatformUbuntu 24.04 LTS
CUDACompatible current CUDA release
Python3.12

This is a powerful single-GPU desktop, but the 4090’s 24 GB VRAM is still a hard constraint. A model’s advertised parameter count is not the same as its runtime memory requirement. Weight quantization reduces memory use, while the KV cache grows with context length and concurrent requests. Runtime overhead, batch size and GPU offloading also matter. A 30B-class model may be practical in a 4-bit format, while a much larger model may need CPU offload, shorter context or a split between GPU and system RAM. Offloading can make a model load; it does not guarantee a responsive coding assistant.

Stacked bars showing a 32B model needing 70 GB at FP16, 38 GB at 8-bit and 22 GB at 4-bit against a 24 GB limit

Figure 1: A 32B model only fits a 24 GB card once it is quantized. KV cache and runtime overhead sit on top of the weights.

How to choose the right local coding model

For everyday programming, separate four jobs that are often bundled under the word “coding”: inline completion, generating a new function, understanding an unfamiliar repository, and making a multi-file change that passes tests. Fill-in-the-middle (FIM) support is particularly useful for autocomplete. Repository-level agents need reliable instruction following, long-context handling, tool use and the ability to make small, verifiable edits. A model that writes a convincing code snippet can still fail when asked to trace a bug across several files.

Four columns showing inline completion, generating a new function, understanding a repository and a multi-file change that passes tests

Figure 2: Four different jobs hide under the word “coding”. FIM matters most for the first; tool use and long context matter for the last two.

Also check the exact model card and license before downloading. “Open-weight” does not automatically mean OSI-approved open source, unrestricted commercial use, or permission to redistribute every quantized build. Prefer official model repositories and trusted quantization publishers, pin a revision, and keep the license with your experiment notes.

If the model will drive a retrieval-based assistant rather than plain autocomplete, the model is only one half of the system. How you split and index your codebase matters just as much — see chunking in RAG for why retrieval quality caps what any model can do, and how agentic RAG works for the tool-calling loop these models have to sustain.

10 open-weight LLMs to evaluate for coding in 2026

Dot plot of 4-bit weight memory for seven coding models from 16 GB down to 3.5 GB against a 24 GB limit

Figure 3: Weights at 4-bit for the models whose parameter count is stated, against the 24 GB limit. This is the floor, not the full runtime requirement.

1. Qwen3-Coder-Next

Qwen3-Coder-Next is an interesting first candidate when the goal is agentic software work rather than only short code completion. Its intended use makes it worth testing on repository navigation, tool-assisted edits and multi-step tasks. Treat its full model size and the available inference formats as separate questions: on a 24 GB card, a suitable quantized build and context setting will be essential. Check the official release notes for the current architecture, context limits and recommended serving stack before selecting a quantization.

2. Qwen3-Coder-30B-A3B-Instruct

This mixture-of-experts coding model is a strong candidate for a local coding-agent comparison. The “active parameters” figure in an MoE model should not be mistaken for the complete storage footprint: all expert weights still need to be available to the runtime, even if only a subset is active for a token. Evaluate it on tool calls, structured edits and debugging—not just one-shot code generation. A quantized build is the sensible starting point for a single 4090.

3. Devstral Small 2

Devstral Small 2 is designed with software-engineering and coding-agent workflows in mind. That makes it especially relevant for tasks such as locating the right file, understanding project conventions and applying a focused patch. It is a good candidate to test with an agent harness that can inspect a repository and run tests. Do not assume that a repository-agent model will automatically work well in every IDE: tool schemas, prompt templates and runtime compatibility can change the result.

4. OpenAI gpt-oss-20B

gpt-oss-20B is a general reasoning-oriented open-weight model that can be evaluated for code explanation, planning, debugging and function calling. It is not a code-only specialist, so compare it against the coding-focused models on the same tasks rather than assuming its reasoning strengths translate into better patches. Check the official model card for its supported precision format, context configuration and license. On consumer hardware, use a supported optimized build rather than treating generic parameter-count estimates as a memory guarantee.

5. Qwen2.5-Coder-32B-Instruct

Although it belongs to an earlier generation, Qwen2.5-Coder-32B-Instruct remains a useful baseline for code generation, explanation and repair. A comparison needs at least one established model alongside newer releases; otherwise it is difficult to tell whether a newer model genuinely improves your workflow. The 32B size makes quantization important on a 24 GB GPU, especially if you want a larger context window. Include both a short-function task and a bug-fix task in its evaluation.

6. DeepSeek-Coder-V2-Lite-Instruct

DeepSeek-Coder-V2-Lite-Instruct is a smaller MoE coding option that can help establish a lower-memory comparison point. It is useful to assess code completion, explanation and straightforward code edits without beginning with the largest available checkpoint. As with other MoE architectures, do not estimate the full memory requirement from active parameters alone. Confirm the exact repository variant and quantization, then test it with your own language mix and project types.

7. StarCoder2-15B

StarCoder2-15B is worth retaining as a code-specialist baseline, particularly for completion-oriented workflows and code infilling. It is not necessarily the best choice for modern autonomous repository agents, but that is precisely why it is useful in a balanced test: autocomplete and agentic programming are different workloads. Test FIM explicitly by placing a missing code segment between a prefix and suffix. Check the model’s training-data and license documentation before using it in a commercial setting.

8. IBM Granite Code 8B

A compact Granite Code checkpoint offers a practical low-memory point of comparison. Smaller models can be attractive when you value quick startup, lower resource use or running an assistant alongside an IDE and other tools. They may be less capable on complicated repository-level changes, so avoid judging them only on easy prompts. Use the same test cases as the larger models and report where the compact model succeeds, where it needs more guidance and where it fails.

9. CodeGemma 7B Instruct

CodeGemma 7B Instruct is another compact baseline for code-focused chat and generation. Its smaller footprint makes it easier to experiment with locally, but newer models may offer stronger instruction following or more capable agent behavior. It is useful for measuring the quality floor of a lightweight self-hosted setup and for simple tasks where a large model may be unnecessary. Verify the exact variant, intended use and license rather than treating every CodeGemma checkpoint as interchangeable.

10. DeepSeek-R1-Distill-Qwen-14B

This reasoning-distilled model is a useful non-specialist comparison for problems that require explaining a debugging path or thinking through an algorithm before writing code. It may be less convenient than a code-specialist model for fast inline completion, so benchmark it on reasoning-heavy tasks rather than only autocomplete. Ask it to identify a root cause, propose a minimal patch and explain what test would prove the fix. Score the patch with executable tests, not with the confidence of the explanation.

Local benchmark methodology: make the comparison repeatable

A useful benchmark is a small, controlled engineering experiment. Pick one inference platform—such as llama.cpp, Ollama, LM Studio or vLLM—and record its exact version. Do not mix results from different runtimes and then rank the models as if the environment were identical. Record the model repository, revision, quantization format, context length, GPU layers, sampling settings and prompt template. If you change any of these, treat it as a separate configuration.

Five numbered steps for a repeatable local LLM benchmark, from pinning the runtime to logging every run

Figure 4: A repeatable benchmark is a controlled experiment. Change one value in the configuration and it becomes a new configuration, not a new data point.

Use a balanced task set

  • Code generation: implement a small function from a precise specification.
  • Bug fixing: reproduce a known bug, request a minimal patch and run the existing tests.
  • Code explanation: explain an unfamiliar function and identify edge cases.
  • Refactoring: improve readability without changing behavior.
  • FIM completion: complete a missing block while preserving the surrounding code.
  • Repository task: make a scoped change across files and run the project test suite.
  • Tool use: ask the agent to inspect files, invoke a test command and report the result.

Use tasks from projects you are legally allowed to test, and keep a fixed prompt set. Include Python, JavaScript or TypeScript, and at least one additional language relevant to your actual work. Avoid selecting only prompts that favor one model. Run each deterministic task more than once when sampling is enabled, and report the number of attempts. For agent tasks, reset the repository to the same clean commit before every run.

Measure the right things

MetricWhat to record
Load timeTime from launch to model ready
TTFTTime to first generated token after prompt submission
Generation speedOutput tokens per second, with prompt and output lengths
Peak VRAMMaximum GPU memory during the task
System RAMPeak resident memory, especially when offloading
CorrectnessTests passed, patch accepted, and regressions introduced
Agent reliabilitySuccessful completion rate across repeated repository tasks
Dimension drawing showing load time, time to first token, generation speed, peak VRAM and system RAM across one request

Figure 5: Where each metric is measured across a single request. Correctness and agent reliability are scored on the output, not the clock.

For correctness, define the scoring rule before running the models. A simple rubric is: all tests pass; partial progress with a correct approach but incomplete patch; or failure. Record compile errors, test failures and unwanted changes. For code generation, run unit tests and static checks where appropriate. For repository work, inspect the diff and run the project’s test suite. A plausible-looking answer is not a successful software change.

Benchmarks such as SWE-bench can provide useful external context, but their published scores are not local RTX 4090 measurements. Benchmark versions, task selection, agent scaffolding, test environments and contamination concerns all affect interpretation. If you cite a public benchmark in a later update, state the exact version and evaluation setup. Do not compare a model’s score from one harness directly with another model’s score from a different harness.

How to run a Local LLM for programming

For a first local experiment, choose a model with a supported quantized build and start with a moderate context length. Install one runtime, download the exact model artifact, verify its checksum when available, and run a short prompt before connecting it to an IDE. Monitor GPU and system memory while generating. Then increase context length gradually and repeat the same task. This makes it easier to identify whether a slowdown comes from the model, context cache, CPU offload or the surrounding agent framework.

Ollama and LM Studio are convenient entry points for desktop experimentation; llama.cpp gives more direct control over quantized GGUF models and offloading; vLLM is commonly used for serving workloads where its supported model architecture and GPU memory requirements fit. These tools are not interchangeable wrappers. The best choice depends on the model format, features you need and how much control you want over serving parameters.

Ollama, LM Studio, llama.cpp and vLLM placed along a convenience to control axis with what each is best for

Figure 6: Ollama, LM Studio, llama.cpp and vLLM trade convenience against control. They are not interchangeable wrappers.

For a self hosted coding assistant, keep the model endpoint bound to localhost unless remote access is genuinely required. If you expose an endpoint to a network, add authentication, firewall rules and transport security. Treat repository contents, environment variables, credentials and private source code as sensitive data. Review what your IDE extension or agent sends to the model and any external tools before connecting it to a work repository.

Which model should you start with?

If your priority is repository-level agent work, begin by evaluating Qwen3-Coder-Next and Devstral Small 2 alongside Qwen3-Coder-30B-A3B-Instruct. For general reasoning and function calling, include gpt-oss-20B. For a smaller-memory comparison, use Granite Code 8B, CodeGemma 7B or DeepSeek-Coder-V2-Lite. Keep StarCoder2-15B in the set if FIM completion matters, and retain Qwen2.5-Coder-32B as an older code-specialist baseline. DeepSeek-R1-Distill-Qwen-14B adds a reasoning-focused comparison.

Decision ladder matching six kinds of coding work to a shortlist of open-weight models

Figure 7: A decision path from the kind of coding work you do to a shortlist worth benchmarking.

The most useful result is not a universal winner. It is a record of which model completes your own programming tasks, at what memory cost, with what latency and how often it introduces regressions. A smaller model that reliably handles routine edits can be more valuable than a larger one that occasionally produces impressive but unverified patches. Start with a reproducible local test, keep the logs, and let the results—not the parameter count—decide what belongs in your daily development setup.

FAQ

Can a 24 GB GPU actually run a 32B coding model?
At 4-bit quantization the weights of a 32B model land around 22 GB, which fits — but only just, and the KV cache and runtime overhead sit on top of that. In practice you will need to reduce context length, accept CPU offload, or choose a smaller model if you want headroom for a long context window. Treat the weight size as the floor, never the total.

Does a higher parameter count mean better code?
Not reliably. The four coding jobs — inline completion, writing a function, understanding a repository, and making a multi-file change — reward different capabilities. A 15B code specialist can beat a 32B generalist at fill-in-the-middle completion, while a reasoning-tuned model may be better at explaining a bug than at autocompleting it. Benchmark against your own tasks.

Why not just use published benchmark scores like SWE-bench?
Because those scores were not produced on your hardware, your quantization, or your runtime. Benchmark version, agent scaffolding, test environment and data contamination all move the number. Published scores are useful for building a shortlist; they are not a substitute for running the models on your own codebase.

What does “active parameters” mean on a mixture-of-experts model?
It is the subset of weights used for any single token, not the storage footprint. All expert weights still have to be available to the runtime, so an MoE model with a small active-parameter count can still need as much VRAM as a much larger dense model. Size your hardware from the full checkpoint.

Which runtime should I start with?
Ollama or LM Studio if you want to be generating within the hour; llama.cpp if you need direct control over GGUF quantization and GPU offload; vLLM if you are serving rather than experimenting. Pick one and record its version — mixing runtimes and then ranking models is the most common way local benchmarks go wrong.

Is “open-weight” the same as open source?
No. Open-weight means the weights are downloadable; the licence may still restrict commercial use, redistribution, or specific applications. Check each model card individually, and keep the licence alongside your experiment notes rather than assuming consistency across a family of models.

1 thought on “10 Best Open-Source LLM Models for Coding: Local Hardware & Benchmark Guide (2026)”

Leave a Comment