Open Source Models

Best Open Source Models for Terminal-Based AI Agents in 2026

Terminal-based coding agents can automate multi-step development workflows in 2026, operating directly within the command line to execute complex coding tasks with limited human oversight. This guide examines seven essential components for building terminal-based AI agents: the infrastructure layer that makes production deployment possible, plus six open-weight models that deliver the intelligence.

Modal TeamEngineering
July 202618 min read

Terminal-based coding agents can automate multi-step development workflows in 2026, operating directly within the command line to execute complex coding tasks with limited human oversight. Production reliability, though, depends on more than a single factor: it rests on the model, the agent scaffold, tool design, the execution environment, the evaluation process and operational controls. A purpose-built AI infrastructure platform provides the foundation for running these models at scale. This guide examines seven essential components for building terminal-based AI agents: the infrastructure layer that makes production deployment possible, plus six open-weight models (openly available under permissive licenses) that deliver the intelligence.

Key Takeaways

  • Infrastructure shapes production viability: Even a capable open-weight model needs reliable access to CPU and GPU compute, secure sandboxed execution, and elastic scaling to power a dependable terminal agent. Modal is engineered for fast cold starts that help keep agents responsive during multi-turn interactions.
  • Terminal-Bench is a useful controlled measure, not a production oracle: Terminal-Bench provides a useful controlled measure of performance on complex terminal tasks, but it does not by itself predict production reliability. GLM-5.2 reports one of the strongest published open-weight results, at 81.0 with the Terminus-2 harness and 82.7 with Z.ai's best-reported harness on Terminal-Bench 2.1.
  • MoE architectures improve compute efficiency: Models like Qwen3-Coder-Next activate only 3B parameters while, per Qwen, performing comparably to models with 10 to 20 times more active parameters on its reported evaluations. The full checkpoint still stores all 80B parameters, so compute sparsity does not translate into a small memory footprint.
  • MIT and Apache 2.0 licensing generally permits commercial use: The models use permissive MIT or Apache 2.0 licensing that generally permits commercial use, subject to license obligations and applicable law.
  • Hardware requirements vary widely and depend on precision: At released BF16 or FP8 precision and long context, several of these checkpoints exceed a single 24GB GPU. Single-24GB-GPU deployment is generally possible only with named quantization, reduced context, or CPU offload. Devstral-Small-2 ships an FP8 checkpoint that Mistral says can run on an RTX 4090 or 32GB Mac.

1. Modal

Modal delivers AI infrastructure that developers love, providing the foundation layer that enables all other entries on this list to run in production. While the open-weight models provide the intelligence, Modal provides much of the rest: elastic access to CPU and GPU compute, secure code execution, and autoscaling that handles unpredictable agent workloads.

Why Infrastructure Comes First

Terminal-based AI agents require more than a capable model. They typically need:

  • CPU and GPU availability on demand: Agents must spin up inference containers quickly without heavy capacity planning
  • Secure code execution: AI-generated terminal commands must run in isolated environments
  • Consistent low latency: Multi-turn agent interactions benefit from responsive inference
  • Production observability: Teams need visibility into what agents are doing across deployments

Core Capabilities

  • 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. Memory snapshots further streamline startup by restoring previously initialized CPU state, skipping imports, compilation, and engine initialization.
  • gVisor-based Sandboxes for isolated code execution, supporting 100k+ concurrent Sandboxes
  • On-demand CPU and GPU compute including H100, B200, A100, L40S, H200, and B300 options with multi-cloud routing
  • Code-first, code-defined infrastructure without YAML configuration, with SDKs in Python, TypeScript, and Go that can create Sandboxes, invoke deployed Functions, and manage resources such as Volumes and Secrets. Code running inside a Sandbox is not limited to one language and can use whatever runtime the workload requires

Production Validation

Modal powers cloud infrastructure for more than 10,000 teams. Customers and application developers using Modal include Ramp, which built a coding agent on Modal, along with Suno and Lovable. Modal has completed a SOC 2 Type 2 audit and supports HIPAA-compliant workloads on Enterprise plans via a BAA. Best For: Teams building production terminal agents who need elastic access to CPU and GPU compute, secure sandboxed execution, and infrastructure that scales automatically with workload demands.

2. GLM-5.2

GLM-5.2 from Z.ai reports one of the strongest published open-weight results for terminal-based agent workflows in 2026. Released in June 2026, it posts strong Terminal-Bench 2.1 numbers while carrying a permissive MIT license.

Technical Specifications

  • Parameters: 753B total (Mixture of Experts architecture). The cited model card does not state an activated-parameter count; a 40B figure is associated with related GLM-5 architecture descriptions rather than the GLM-5.2 card.
  • Context Window: 1M tokens
  • License: MIT (permissive; subject to license obligations and applicable law)
  • Terminal-Bench 2.1: 82.7 with Z.ai's best-reported (modified Claude Code) harness; 81.0 with Terminus-2 (vendor-reported)
  • SWE-bench Pro: 62.1 (vendor-reported)

What Makes GLM-5.2 Stand Out

GLM-5.2's IndexShare architecture reduces per-token FLOPs by a reported 2.9x at 1M context, making long-horizon agent tasks more computationally feasible. The model supports multiple thinking effort levels that balance performance against latency, letting terminal agents trade off thoroughness for speed depending on task complexity. The 82.7 result is worth reading closely: it is labeled Z.ai's best-reported harness and was obtained with Claude Code, a custom proxy raising maximum output to 128K, no wall-clock limit, and an average over five runs. The more standardized Terminus-2 result on the same page is 81.0. As of July 16, 2026, Hugging Face displayed 489,611 downloads in the preceding month and 100 Spaces for the model, indicating meaningful adoption for agentic workflows. Best For: Teams that want strong terminal-specific results with 1M context for codebase-wide reasoning and MIT licensing for commercial deployment, subject to license obligations and applicable law.

3. DeepSeek-V4-Pro

DeepSeek-V4-Pro is a preview open-weight MoE model that posts strong coding results on algorithmic benchmarks in DeepSeek's vendor-reported comparisons. The model targets complex reasoning tasks that terminal agents encounter when debugging intricate code paths or implementing sophisticated algorithms. Because DeepSeek describes V4 as a preview version of the series, interfaces, serving support, and model behavior may still change, which matters for production planning.

Technical Specifications

  • Parameters: 1.6T total, 49B active (MoE)
  • Context Window: 1M tokens. For Think Max mode, DeepSeek recommends configuring at least 384K of context; this is a context recommendation, not an output-length limit.
  • License: MIT (subject to license obligations and applicable law)
  • LiveCodeBench: 93.5 for V4-Pro-Max, the maximum-reasoning mode, and the highest score among models with reported values in DeepSeek's comparison table (vendor-reported)
  • SWE-bench Verified: 80.6 for V4-Pro-Max (vendor-reported); 73.6 non-thinking and 79.4 in high mode
  • Codeforces Rating: 3206 for V4-Pro-Max (vendor-reported); 2919 in high mode

Algorithmic Reasoning Strength

DeepSeek-V4-Pro pairs a 1M-token context with strong algorithmic-reasoning scores. For terminal agents generating extensive code modifications or implementing complex features, the large context helps keep long codebases and long-running sessions in view. The headline LiveCodeBench, SWE-bench Verified, and Codeforces figures above are all V4-Pro-Max (maximum reasoning) results; the same page reports materially lower numbers in non-thinking and high modes, so teams should weigh the latency and compute cost of Max mode against those alternatives when planning deployment. Best For: Terminal agents focused on algorithmic problem-solving or competitive-programming-style tasks, where teams can accept the added latency and compute of the higher reasoning modes.

4. Qwen3-Coder-Next

Qwen3-Coder-Next targets a strong capability-per-footprint ratio among coding models, activating only 3B parameters while, per Qwen, performing comparably to models with 10 to 20 times more active parameters on its reported evaluations.

Technical Specifications

  • Parameters: 80B total, 3B active (MoE)
  • Context Window: 262,144 tokens (native)
  • License: Apache 2.0 (subject to license obligations and applicable law)
  • SWE-bench Verified: 70.6 (vendor/model-card evaluation)
  • SWE-bench Pro: 44.3 (vendor-reported)
  • Terminal-Bench 2.0: 36.2 (vendor-reported)

Efficiency Without Compromise

The model activates only 3B parameters per token, but it still retains an 80B-parameter checkpoint that determines storage and much of the memory footprint. The official Hugging Face weights are BF16, and raw BF16 storage alone is roughly 160 GB before runtime overhead and KV cache, so Qwen's full-context deployment examples are multi-GPU. Community quantizations may run on a 24GB GPU with reduced precision and often reduced context or CPU offload; the official BF16 checkpoint does not fit in 24GB. For teams that apply such quantization, the model can support responsive local or edge inference, but consumer-device deployment ordinarily depends on quantization and memory offload rather than a small native checkpoint. Qwen3-Coder-Next integrates with SGLang (v0.5.8+) and vLLM (v0.15.0+) with native tool-call parsing, enabling structured function calls that terminal agents rely on for executing shell commands and file operations. Best For: Teams deploying terminal agents on constrained hardware who can apply quantization and offload, and who want strong coding capability from a compute-sparse MoE checkpoint.

5. Qwen3.6-27B

Qwen3.6-27B is a dense self-hosting option that delivers competitive coding performance, with latency characteristics that can be attractive for interactive terminal workflows.

Technical Specifications

  • Parameters: 27B dense (all parameters active)
  • Context Window: 262,144 tokens native, extensible to 1,010,000 with YaRN
  • License: Apache 2.0 (subject to license obligations and applicable law)
  • SWE-bench Verified: 77.2 (vendor-reported), exceeding the other similarly sized models included in Qwen's published comparison table
  • Terminal-Bench 2.0: 59.3 (vendor-reported)
  • LiveCodeBench v6: 83.9 (vendor-reported)

Dense Architecture Advantages

Qwen3.6-27B's dense execution avoids expert selection, which may simplify capacity modeling relative to very large MoE checkpoints. Request latency still depends heavily on prompt length, output length, batch composition, KV-cache state, tool interactions, framework scheduling, and hardware contention, so consistent latency is not guaranteed by the dense architecture alone. On memory, the official checkpoint is BF16 and the language-model weights alone are roughly 54 to 56 GB before the vision encoder, runtime allocations, and KV cache. Qwen's full 262K-context SGLang and vLLM examples use tensor parallelism across eight GPUs. A quantized checkpoint can potentially run on a 24GB GPU with constrained context and/or offload; the released BF16 model does not fit entirely in 24GB. The model's Thinking Preservation feature can retain reasoning context from earlier messages and reduce repeated reasoning overhead across conversation turns, which can help during longer debugging sessions. Best For: Teams that want a dense checkpoint for interactive terminal workflows and are prepared to size hardware to the released precision and context, using quantization where a single 24GB GPU is required.

6. Devstral-Small-2-24B-Instruct-2512

Devstral-Small-2 is purpose-built for agentic software engineering and has a first-party terminal integration through the Mistral Vibe CLI, giving teams an out-of-the-box terminal agent experience.

Technical Specifications

  • Parameters: 24B dense
  • Context Window: 256K tokens
  • License: Apache 2.0 (subject to license obligations and applicable law)
  • SWE-bench Verified: 68.0 (vendor-reported)
  • Hardware: Mistral states that the FP8 checkpoint can run on a single RTX 4090 or 32GB Mac; achievable context and throughput depend on framework and memory configuration, and Mistral's production-serving example uses tensor parallelism with a 262K maximum model length

Native Terminal Integration

Devstral-Small-2 combines a terminal-focused design with vision capability and can accept images as input. The official card confirms general image-analysis capability but does not document benchmarked performance specifically on terminal screenshots, operating-system dialogs, or UI-debugging workflows, so teams should evaluate it on those tasks before making production claims about visual debugging. The model integrates with popular agentic frameworks including Cline, OpenHands, SWE-Agent, Kilo Code, and Claude Code, providing proven compatibility with established terminal agent tooling. Best For: Developers wanting immediate terminal agent capabilities through Mistral Vibe CLI integration, with the option to test its vision capability on their own debugging tasks.

7. Qwen3.6-35B-A3B

Qwen3.6-35B-A3B targets an attractive compute-to-capability tradeoff by activating 3B of 35B parameters, and its native multimodal capabilities enable visual context understanding that pure text models cannot provide.

Technical Specifications

  • Parameters: 35B total, 3B active (MoE)
  • Context Window: 262,144 tokens native, extensible to 1,010,000
  • License: Apache 2.0 (subject to license obligations and applicable law)
  • SWE-bench Verified: 73.4 (vendor-reported)
  • Terminal-Bench 2.0: 51.5 (vendor-reported)
  • Claw-Eval Pass^3: 50.0 (vendor-reported)

Multimodal Agent Capabilities

For terminal agents that need to understand visual context, diagrams, or screenshots, Qwen3.6-35B-A3B provides native multimodal support without requiring separate vision models. The model processes text, image, and video inputs through a unified architecture. On memory, the 3B active count reduces per-token computation but does not reduce the checkpoint to 3B stored parameters; the model still contains 35B total parameters, and Qwen's standard 262K-context SGLang and vLLM commands use eight-way tensor parallelism. Quantized community variants may be usable on 24GB GPUs with configuration tradeoffs; the standard full-context deployment shown by Qwen is multi-GPU. Qwen reports a 50.0 Claw-Eval Pass^3 score, indicating repeatable success across three trials on Claw-Eval's mixed autonomous-agent task set. Claw-Eval is a heterogeneous autonomous-agent benchmark rather than a terminal-coding-only evaluation, so this figure supports general reliability analysis rather than a specific claim about extended terminal coding sessions. Best For: Teams building multimodal terminal agents that process visual context alongside text and can size hardware to a 35B-total MoE checkpoint.

Why Modal Stands Out for Terminal-Based AI Agents

Purpose-Built for AI Workloads

Modal's infrastructure differs from general-purpose cloud platforms because it is engineered specifically for AI workloads. The platform includes a custom filesystem, container runtime, scheduler, and image builder optimized for the rapid iteration cycles that terminal agent development demands.

Secure Code Execution at Scale

Terminal agents must execute AI-generated commands safely. Modal's Sandboxes provide gVisor-based container isolation, supporting 100k+ concurrent Sandboxes and strengthening separation between untrusted workloads and the underlying infrastructure so agents can run untrusted code with strong isolation. Companies such as Ramp use Modal Sandboxes for background coding agents, and Lovable uses them as preview environments for generated apps.

Instant Compute Access Without Reservations

Building terminal agents requires experimentation across different model sizes and architectures. Modal provides elastic access to CPU and GPU compute, including H100, B200, A100, L40S, H200, and B300 hardware, without heavy capacity planning or reservations.

Fast Cold Starts

Interactive terminal agents benefit from responsive inference. Modal is 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. Modal's memory snapshots further streamline startup by restoring previously initialized CPU state, skipping imports, compilation, and engine initialization.

Production-Ready Security

Enterprise deployments require compliance guarantees. Modal has completed a SOC 2 Type 2 audit and supports HIPAA-compliant workloads on Enterprise plans via a BAA.

Complete Developer Experience

Modal's code-first approach means terminal agent infrastructure can be defined in code alongside application code, without separate YAML configurations or container orchestration complexity. Modal supports code-defined infrastructure through SDKs in Python, TypeScript, and Go that can create Sandboxes, invoke deployed Functions, and manage Modal resources. Explore Modal's documentation to see how teams deploy terminal agents in production.

Explore Modal's infrastructure for deploying terminal-based AI agents at scale.

Get Started with Modal

Frequently asked questions

What are the primary benefits of using open-weight models for terminal AI agents?

Open-weight models provide access to model weights, enabling fine-tuning for specific terminal workflows and reducing vendor lock-in. Permissive MIT and Apache 2.0 licenses generally permit commercial use, subject to license obligations and applicable law. Self-hosting can reduce per-token API costs for high-volume agent workloads. A fully local, correctly configured deployment can keep code within the organization's environment, provided remote telemetry, external tools, and hosted fallbacks are disabled or controlled. (These are downloadable-weight models; whether each fully satisfies the Open Source AI Definition would require a separate audit, which is why this guide uses the term open-weight.)

How does Modal facilitate the deployment of these open-weight AI models?

Modal handles CPU and GPU provisioning, container orchestration, and autoscaling. Teams define their model-serving logic in code using SDKs in Python, TypeScript, or Go, and Modal manages much of the infrastructure complexity. Memory snapshots reduce cold-start latency by restoring initialized CPU state. Sandboxes provide gVisor-isolated environments for AI-generated terminal commands.

Which of these models is best suited for code generation in a terminal environment?

There is no single controlled ranking, because the published scores use different benchmark versions and harnesses. As vendor-reported figures: GLM-5.2 posts strong Terminal-Bench 2.1 results (81.0 with Terminus-2 and 82.7 with Z.ai's best-reported harness). For algorithmic reasoning, DeepSeek reports 93.5 on LiveCodeBench for V4-Pro-Max (maximum reasoning), the highest among models with reported values in its comparison table. Teams constrained to smaller deployments often consider Qwen3.6-27B, which Qwen reports at 77.2 on SWE-bench Verified, though its released BF16 checkpoint requires quantization and context tradeoffs to fit a single 24GB GPU.

Can these open-weight models run entirely offline, or do they require cloud access?

All six models can be deployed offline once weights are downloaded. However, their released BF16 or FP8 checkpoints and long context windows mean that single-24GB-GPU, air-gapped deployment generally requires named quantization, reduced context, or CPU offload rather than being a default property of the released weights. Larger models like GLM-5.2 and DeepSeek-V4-Pro typically use multi-GPU setups. Modal can provide the cloud-inference component of a hybrid architecture; application developers can implement routing logic that selects between local inference and a Modal-hosted endpoint according to workload requirements.

How can I integrate an AI agent built with these models into my existing developer workflow?

Start by deploying your chosen model on Modal using the inference product, which handles CPU and GPU allocation and autoscaling. Use Modal's web endpoints to expose your agent as an API, then integrate with terminal clients or IDE extensions. For agents executing shell commands, leverage Modal Sandboxes to run AI-generated code in gVisor-isolated containers that strengthen separation from your development environment.

Run your first terminal agent in minutes.

Get Started Free

$30 in free compute to get started.