AI Models

Best Open Source Code LLMs for Building Custom Coding Agents in 2026

Open-source code LLMs have reached a turning point. Models like Qwen3-Coder now report results around 69.6% on SWE-bench Verified, while offering full deployment control and zero API lock-in. But choosing the right model is only half the equation — running these models at production scale requires AI infrastructure that handles secure code execution, CPU and GPU compute, and dynamic scaling.

Modal TeamEngineering
July 202620 min read
Best open source code LLMs for building custom coding agents

Open-source code LLMs have reached a turning point. Models like Qwen3-Coder now report results around 69.6% on SWE-bench Verified, a widely used human-filtered benchmark of 500 real GitHub issue-resolution tasks, while offering full deployment control and zero API lock-in. But choosing the right model is only half the equation. Running these models at production scale requires AI infrastructure that handles secure code execution, CPU and GPU compute, and dynamic scaling. This guide covers seven options for building custom coding agents in 2026: Modal as the serverless infrastructure foundation, followed by six open-source code LLMs ranked by benchmark performance, licensing, and production readiness.

Key Takeaways

  • SWE-bench Verified is a key benchmark: This human-filtered subset of 500 SWE-bench instances measures whether systems can resolve real GitHub issues, making it a useful proxy for agentic coding capability that is best interpreted alongside other benchmarks and real workload evaluations
  • Mixture-of-Experts (MoE) architecture dominates large models: GLM-5.2 (around 744B-753B total / 40B active, depending on source metadata) and Qwen3-Coder (480B/35B active) achieve frontier performance while keeping inference costs manageable through sparse activation
  • Apache 2.0 licenses simplify enterprise adoption: Qwen3-Coder, Devstral-Small, Qwen2.5-Coder, and Granite all use Apache 2.0, a permissive commercial license, though standard legal and procurement review still applies
  • Context window size determines repository-scale capability: GLM-5.2's 1M token context enables processing entire codebases without chunking, while most models support 128K-256K tokens
  • Infrastructure determines production viability: Modal powers over 10,000 teams running AI workloads, with secure sandboxes that support 100k+ concurrent sandboxes for executing agent-generated code

1. Modal

Modal provides the serverless infrastructure that makes deploying open-source code LLMs practical for production coding agents. The platform handles containerization, GPU scheduling, and auto-scaling through native SDKs, eliminating the infrastructure management overhead that typically slows agent development.

Core Capabilities

  • gVisor container isolation: Secure sandboxed execution for running AI-generated code, the primary workload for coding agents
  • On-demand GPU access: Support for T4, L4, A10, L40S, A100, H100, H200, and B200 enables running any model in this list at scale
  • Scale-to-zero architecture: Automatic scaling from zero to thousands of containers eliminates idle infrastructure costs
  • Fast cold starts: Engineered for fast cold starts and faster feedback loops, with an optimized filesystem that helps containers come online quickly without letting large images slow startup down
  • Code-first SDKs: Define compute, storage, and networking in code rather than YAML, using Modal's SDKs for Python, TypeScript, and Go (TypeScript and Go in beta). Sandboxes are not limited to one language; they can run whatever runtime or language the workload requires, not just Python

Security and Compliance

Modal has completed a SOC 2 Type 2 audit and supports HIPAA-compliant workloads on Enterprise plans via a Business Associate Agreement (BAA). The platform uses gVisor-based sandboxing for compute isolation, TLS 1.3 for public APIs, and encryption for data in transit and at rest.

Production-Proven Results

Modal powers production workloads for AI companies across agent systems, video processing, inference, and batch workloads:

  • Ramp uses Modal Sandboxes to power Inspect, an internal background coding agent that writes over half of all merged pull requests at Ramp
  • Sync Labs achieves 95 deployments per day processing over 100 hours of video daily
  • Ramp cut infrastructure costs for automated receipt processing by an estimated 79% by switching from OpenAI to running an open-source LLM on Modal

Best For: Teams that need to deploy any open-source code LLM with secure sandboxed execution, CPU and GPU compute, and production-grade scaling.

2. GLM-5.2

GLM-5.2 posts strong open-source coding results, reporting 62.1 on SWE-bench Pro in its official release materials. Its 1M token context window makes it well suited for repository-scale agentic coding.

Core Capabilities

  • Parameters: Approximately 744B-753B total / 40B active (MoE architecture), depending on source metadata
  • Context Window: 1M tokens input
  • License: MIT (unrestricted commercial use, allows distillation)
  • Release: June 17, 2026

Key Strengths

  • Repository-scale context: Process entire mid-size codebases without chunking or RAG complexity
  • Efficiency optimization: IndexShare technology cuts per-token compute by 2.9x at full 1M context
  • Strong coding-agent results: Official release materials report 62.1 on SWE-bench Pro

GLM-5.2 excels at complex, multi-file refactoring and full-stack application generation where other models require multiple passes or external context management.

Best For: Teams building agents that work across entire repositories or need strong coding benchmark performance with repository-scale context.

3. Qwen3-Coder-480B-A35B-Instruct

Qwen3-Coder is a leading open-weight coding model with strong SWE-bench Verified results reported at 69.6%, though the exact figure depends on the benchmark scaffold, turn budget, and source. It offers the most permissive licensing in its performance class. Alibaba's long-horizon agent reinforcement learning across large-scale parallel coding environments makes it particularly effective for agentic workflows.

Core Capabilities

  • Parameters: 480B total / 35B active (MoE architecture)
  • Context Window: 256K tokens (extendable to 1M via Yarn)
  • License: Apache 2.0 (most permissive, no commercial restrictions)
  • Languages: 358 programming languages

Key Strengths

  • Multi-language proficiency: Broad multilingual code generation across 358 coding languages, with strong performance in Python, Java, PHP, C++, and TypeScript
  • Agentic training: Long-horizon reinforcement learning across large-scale parallel coding environments for real-world software engineering workflows
  • License clarity: Apache 2.0 eliminates legal review friction for enterprise deployments
  • Polyglot capability: 61.8% Aider-Polyglot score demonstrates cross-language task handling

Qwen3-Coder's combination of benchmark leadership and permissive licensing makes it the default choice for teams that need both capability and deployment flexibility.

Best For: Enterprise teams requiring maximum coding performance under the cleanest possible license terms, especially for multi-language codebases.

4. Devstral-Small-2505

Devstral-Small-2505 proves that compact models can compete with giants for agentic coding tasks. At just 24B parameters, it achieves 46.8% SWE-bench Verified, outperforming much larger models when evaluated under the same agent scaffold, while remaining small enough for local deployment.

Core Capabilities

  • Parameters: 24B (dense architecture)
  • Context Window: 128K tokens
  • License: Apache 2.0
  • Release: May 2025 (jointly developed by Mistral AI and All Hands AI)

Key Strengths

  • Local deployment viable: Runs on high-end consumer hardware (RTX 4090, 32GB RAM Macs) for development and testing
  • Purpose-built for agents: Fine-tuned from Mistral-Small-3.1 specifically for codebase exploration, multi-file editing, and agent integration
  • Framework compatibility: Works with vLLM, Transformers, and Ollama inference frameworks
  • Evaluated with OpenHands: Optimized and benchmarked using the OpenHands agent scaffold

Devstral-Small demonstrates that careful training can compensate for parameter count, beating DeepSeek-V3-0324 (671B) and Qwen3-232B-A22B when evaluated under consistent agent conditions.

Best For: Teams that need self-hosted agentic coding without massive infrastructure, or want a capable local model for development before deploying larger models in production.

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

Qwen2.5-Coder-32B hits the sweet spot for cost-efficient code generation. Its 92.7% HumanEval pass@1 score demonstrates exceptional single-function correctness, while its dense 32B architecture can be served cost-effectively on a single high-memory GPU, with quantization or memory optimization required to fit within 40GB.

Core Capabilities

  • Parameters: 32B (dense architecture)
  • Context Window: 128K tokens
  • License: Apache 2.0
  • HumanEval: 92.7% (pass@1)

Key Strengths

  • Single-GPU deployment: Runs on a single high-memory GPU with quantization or memory optimizations; full-precision serving generally requires a larger-memory or multi-GPU setup
  • Function-level excellence: Best-in-class HumanEval score for single-function generation tasks
  • Predictable performance: Dense architecture avoids MoE routing complexity
  • Active community: Part of Qwen family with extensive documentation and tooling support

Qwen2.5-Coder excels at code completion, single-file generation, and IDE integration where repository-scale context is less critical than fast, accurate completions.

Best For: Teams building code completion tools, CI/CD integrations, or agents focused on function-level tasks where a 480B MoE model would be overkill.

6. DeepSeek-Coder-V2-Instruct

DeepSeek-Coder-V2 remains a strong open-weight code model with documented benchmark performance and broad language coverage. Its 90.2% HumanEval score and established ecosystem of fine-tuned derivatives make it a dependable option for teams that value documented reliability.

Core Capabilities

  • Parameters: 236B total / 21B active (MoE architecture)
  • Context Window: 128K tokens
  • License: DeepSeek License (released under DeepSeek's model license, described as allowing research and unrestricted commercial use)
  • Languages: 338 programming languages

Key Strengths

  • Production track record: Extensive deployment history with known performance characteristics
  • Derivative ecosystem: A permissive model license has enabled numerous fine-tuned variants for specialized tasks

While newer models achieve higher benchmark scores, DeepSeek-Coder-V2's reliability and established tooling reduce deployment risk for production systems.

Best For: Teams that prioritize production stability over bleeding-edge benchmarks, or need a proven baseline for building specialized fine-tuned variants.

7. Granite-34b-Code-Instruct-8k

Granite-34B-Code-Instruct-8K is a historically important, Apache 2.0-licensed coding model from IBM Research. It is now deprecated and not recommended for new projects, having been superseded by IBM's current mainline Granite models, but its permissive license and focus on code explanation and fixing made it a notable enterprise-oriented option. For new 2026 deployments, IBM's current Granite models are the better reference.

Core Capabilities

  • Parameters: 34B
  • Context Window: 8K tokens (IBM has separately published long-context Granite Code work up to 128K for some variants)
  • License: Apache 2.0 (permissive license)
  • Developer: IBM Research

Key Strengths

  • Permissive licensing: Apache 2.0 is a permissive license often attractive for enterprise use, though normal legal and procurement review still applies
  • Code explanation focus: Strong performance on HumanEvalExplain benchmarks for code documentation and review
  • Family approach: 3B, 8B, 20B, and 34B variants let teams right-size deployments
  • Enterprise backing: Developed by IBM Research and released under Apache 2.0

Granite trades raw benchmark performance for licensing clarity, and historically suited code review and documentation generation use cases, though it is deprecated for new builds.

Best For: Enterprise teams in regulated industries where licensing clarity outweighs pure benchmark performance, with the caveat that this specific model is deprecated and current Granite models should be evaluated for new deployments.

Why Modal Stands Out for Open-Source Code LLM Deployment

Purpose-Built Infrastructure for Agent Workloads

Modal's architecture addresses the specific challenges of running code LLMs for agentic applications. The platform's custom container runtime, scheduler, and file system are optimized for the dynamic scaling and fast cold starts that agent workflows demand.

Secure Execution at Scale

Coding agents generate and execute code autonomously, making isolation essential. Modal's sandboxes provide gVisor-isolated containers that support 100k+ concurrent sandboxes with observability through logging and monitoring, enabling agents to safely execute untrusted generated code at production scale.

GPU Access Across the Full Stack

Open-source code LLMs span a wide range of compute requirements, from Devstral-Small-2505 on a single GPU to GLM-5.2 requiring multi-GPU clusters. Modal's GPU support covers T4 through B200 (and RTX-PRO-6000), letting teams match infrastructure to model requirements without separate procurement for each tier.

Developer Experience That Accelerates Iteration

Modal's native SDKs eliminate YAML configuration and infrastructure management overhead. Teams define compute, images, and scaling behavior in code using Modal's Python, TypeScript, and Go SDKs. This approach enables the rapid iteration that Sync Labs demonstrates with 95 deployments per day.

Production-Proven at Enterprise Scale

Modal powers infrastructure for over 10,000 teams, including AI companies like Ramp and Suno. This production track record demonstrates reliability for enterprise coding agent deployments where downtime directly impacts developer productivity.

For teams building coding agents with open-source LLMs, Modal's combination of secure sandboxed execution, flexible CPU and GPU access, and developer-friendly SDKs provides the infrastructure foundation that makes these models production-ready.

Explore the Modal documentation to get started.

Explore the Modal documentation to get started with open-source code LLM deployment.

View Modal Docs

Frequently asked questions

What is SWE-bench Verified and why does it matter for coding agents?

SWE-bench Verified is a human-filtered subset of 500 SWE-bench instances that evaluates whether systems can resolve real GitHub issues; many leading evaluations run it with agentic, multi-turn scaffolds. Unlike HumanEval (single-function correctness), it tests the complete workflow coding agents perform: understanding context, planning changes, and implementing fixes across multiple files. GLM-5 reports 77.8% on SWE-bench Verified, while GLM-5.2's official release materials report 62.1 on SWE-bench Pro. Scores should be interpreted alongside the specific scaffold used and other benchmarks.

How do I choose between MoE and dense architecture code LLMs?

Mixture-of-Experts (MoE) models like GLM-5.2 and Qwen3-Coder offer higher total parameters with only a fraction active per inference, balancing capability with cost. Dense models like Qwen2.5-Coder-32B and Devstral-Small provide simpler deployment and more predictable performance. Choose MoE for maximum capability when infrastructure supports it; choose dense for straightforward single-GPU deployment or local development.

What infrastructure is required to run these open-source code LLMs?

Requirements vary significantly by model size. Devstral-Small-2505 (24B) runs on high-end consumer hardware. Qwen2.5-Coder-32B can be served on a single high-memory GPU with quantization or memory optimization. GLM-5.2 (744B-753B) requires multi-GPU clusters. Modal's serverless infrastructure handles this variability automatically, scaling across cloud GPU tiers from T4/L4/A10/L40S through A100/H100/H200/B200-class hardware based on workload requirements.

Why is Apache 2.0 licensing important for enterprise deployments?

Apache 2.0 permits unrestricted commercial use, modification, and distribution, though it still carries terms such as notice-preservation obligations and patent provisions. Four of the seven models in this list (Qwen3-Coder, Devstral, Qwen2.5-Coder, Granite) use Apache 2.0, a permissive license often attractive for risk-averse enterprises that need clear legal terms, though organizations still need normal legal and procurement review.

How does secure sandboxed execution protect against AI-generated code risks?

Coding agents generate and execute code autonomously, creating potential for malicious or buggy code to cause damage. Sandboxed execution isolates this code in secure environments where it cannot access host systems, other workloads, or sensitive data. Modal's gVisor-based sandboxes provide this isolation at scale, essential for production coding agent deployments.

Can these models handle complex software architecture tasks?

The leading models demonstrate strong architectural capability. GLM-5.2's 1M context window enables processing entire repositories for refactoring decisions. Qwen3-Coder's training across large-scale parallel environments includes complex multi-step planning scenarios. For pure architecture generation, pairing these models with retrieval systems and iterative refinement produces the best results.

Run your first sandbox in minutes.

Get Started Free

$30 in free compute to get started.