Inside Poolside Laguna S 2.1: The 118B-A8B Open-Weight MoE Built for 1M-Context Agentic Coding
An architectural analysis of Poolside's Laguna S 2.1: a 118B open-weight Mixture-of-Experts coding model activating 8B parameters per token with a 1M context window and 70.2% Terminal-Bench score.
By Manoranjan Mishra · 20 Aug 2026 · 4 min read

Inside Poolside Laguna S 2.1: The 118B-A8B Open-Weight MoE Built for 1M-Context Agentic Coding
In 2026, the open-weight AI ecosystem witnessed a major architectural milestone: Poolside released Laguna S 2.1, a 118-billion-parameter Mixture-of-Experts (MoE) foundation model designed specifically for autonomous, long-horizon software engineering. By activating only 8 billion parameters per token, Laguna S 2.1 combines the reasoning depth and semantic comprehension of a frontier dense network with the sub-cent token economics ($0.10 input / $0.20 output per million tokens) of an 8B model.
Crucially, Laguna S 2.1 is paired with a native 1-million-token context window, dual Thinking and Direct Execution modes, and state-of-the-art results on real-world developer benchmarks—scoring 70.2% on Terminal-Bench 2.1 and outperforming closed models activating six times as many parameters.
Here is an architectural deep dive into Laguna S 2.1, its trajectory-based training methodology, and how it handles whole-repository agentic coding workloads.
1. The Architectural Thesis: Human Planning Trajectories Over Brute-Force Scaling
Traditional LLMs trained on static code repositories struggle with agentic execution because GitHub code represents only the final artifact, omitting the hundreds of intermediate dead-ends, compiler errors, and refactoring iterations human developers navigate.
Poolside trained Laguna S 2.1 on 30 trillion tokens featuring synthetic execution traces, AST edit graphs, and interactive terminal sessions:
flowchart TD
TaskPrompt(["Enterprise Task: `Migrate 40 Microservices from REST to gRPC with Mutual TLS`"]) --> Orchestrator["1. Laguna S 2.1 Agent Engine (1M Context Ingestion)"]
subgraph SparseMoERouting["118B Total / 8B Active MoE Architecture"]
Orchestrator --> Top2Router["2. Top-2 Expert Router (Softmax Gating)"]
Top2Router --> Expert1["Expert A: AST Syntax & Type Checker (4B Params)"]
Top2Router --> Expert2["Expert B: Terminal Shell & Docker Sandboxing (4B Params)"]
Top2Router --> ExpertN["Expert N: Protocol Buffer Serialization (Inactive)"]
end
Expert1 --> LongContextAttention["3. 1M-Token Sparse KV Cache Attention Engine"]
Expert2 --> LongContextAttention
subgraph AutonomousExecution["Epistemic Sandboxed Execution Loop"]
LongContextAttention --> ThinkingMode["4. Latent Thinking & Task DAG Plan"]
ThinkingMode --> ToolExec["5. Native Bash / MCP Subprocess Execution"]
ToolExec --> TestRunner["6. Automated Unit Tests & Vitest Verification"]
end
TestRunner -->|"Compiler Error / Test Failure"| ThinkingMode
TestRunner -->|"All Assertions Green"| VerifiedPR(["Atomic Git PR Ready for Human Merge"])
2. Sparse MoE Routing & Long-Context Attention
Laguna S 2.1 maintains 118 billion total weights partitioned across specialized feed-forward expert networks.
A. Top-2 Sparse Expert Routing
For every incoming token embedding $x$, the router selects the top-2 experts:
$$y = \sum_{i \in \text{Top-2}} G(x)_i , E_i(x), \quad \text{where } G(x) = \text{Softmax}(\text{Top-2}(x \cdot W_g + \epsilon))$$
Where $W_g$ is the learnable gating parameter and $\epsilon$ introduces exploratory routing noise during pre-training. Because only 8B parameters execute per token, the model fits comfortably within high-throughput inference serving frameworks like vLLM and SGLang.
B. 1M-Token Context Window Scaling
To process entire multi-service repositories in a single prompt without losing middle-context attention, Laguna S 2.1 utilizes RoPE (Rotary Position Embedding) base frequency extension ($\theta = 10^7$) combined with custom FlashAttention-3 kernels, keeping KV cache lookup latency under 35ms even at 500,000 tokens.
sequenceDiagram
autonumber
actor Dev as Staff Engineer
participant Agent as Poolside Laguna S 2.1 (OpenCode CLI)
participant Terminal as Hardened MicroVM Sandbox
participant Git as Local Git Worktree
Dev->>Agent: "Fix race condition in distributed cache and verify under load"
Agent->>Git: Ingest 450,000 Tokens (Entire Repo + Concurrency Tests)
Agent->>Agent: Switch to `Thinking Mode` (Generates Internal Plan DAG)
Agent->>Terminal: Execute `go test -race ./cache/...`
Terminal-->>Agent: Returns ThreadSanitizer Data Race Warning in `mutex.go:42`
Agent->>Git: Apply Atomic Patch Replacing Mutex with Lock-Free Atomic Pointer
Agent->>Terminal: Re-run `go test -race -count=100 ./cache/...`
Terminal-->>Agent: PASS (0 Data Races Detected)
Agent-->>Dev: Resolution Complete: Staged Clean Commit with Explanation
3. Benchmark Comparisons: Laguna S 2.1 vs Frontier Coding Models
In evaluations measuring long-horizon terminal execution, complex debugging, and multi-file code editing:
| Benchmark | DeepSeek-V4 Pro Max | Claude 3.5 Sonnet (2024) | Poolside Laguna S 2.1 (2026) |
|---|---|---|---|
| Total Parameters | 671 Billion | Closed API | 118 Billion |
| Active Parameters / Token | 49 Billion | Closed API | 8 Billion (6x Fewer) |
| Terminal-Bench 2.1 (Long-Horizon Tasks) | 64.0% | 65.2% | 70.2% |
| DeepSWE Multilingual Pass@1 | 38.2% | 41.5% | 40.4% |
| Context Window Capacity | 128,000 tokens | 200,000 tokens | 1,048,576 tokens (1M) |
| Serving Cost / 1M Tokens (OpenRouter) | $0.60 | $3.00 | $0.10 (Input) / $0.20 (Output) |
4. Local Deployment & Speculative Decoding
Because Poolside released native NVFP4 (4-bit floating point) quantized weights under the OpenMDW-1.1 license, engineering teams can self-host Laguna S 2.1 locally on enterprise workstations.
When deployed with its lightweight companion draft model (Laguna S 2.1 DFlash):
- DFlash speculatively generates candidate token sequences at 280+ tok/s.
- The 118B base model validates candidate drafts in a single parallel tensor pass.
- The system achieves sustained 80+ tokens/sec on a single NVIDIA DGX Spark workstation.
5. Frequently Asked Questions (FAQ)
Is Laguna S 2.1 open-weight for commercial use?
Yes. Laguna S 2.1 is published on Hugging Face under the OpenMDW-1.1 license, allowing commercial deployment, internal enterprise self-hosting, and fine-tuning.
How does Laguna handle non-coding conversational prompts?
While capable of general dialogue, Laguna S 2.1 is explicitly optimized as an agentic coding specialist. For general chat or creative writing, general-purpose foundation models are preferable.
6. Conclusion
Poolside's Laguna S 2.1 proves that sparse Mixture-of-Experts architectures combined with 1-million-token context windows can outperform massive monolithic models in real-world software engineering. By democratizing frontier-grade terminal execution under open weights, Laguna S 2.1 sets a new benchmark for autonomous coding agents.
(Cover Image Courtesy: Unsplash / Neural Network Architecture & Autonomous Code Execution)
- #AI Models
- #Poolside
- #Laguna
- #MoE
- #Coding Agents
- #Open Source
- #Software Architecture
Manoranjan Mishra
Written by the team at Lobhari, a software development company in Bhubaneswar building web, mobile and AI products. Meet the team.
Need help with your own build? Explore custom software development or get an estimate.
Related posts

Engineering
Google Gemini 3.8 Flash & 3.8 Flash Cyber: Deep Dive into Architecture, Benchmarks & Autonomous Cyber Defense
An in-depth technical analysis of Google's Gemini 3.8 Flash and Gemini 3.8 Flash Cyber: 73.7% DeepSWE scores, recursive agentic diligence, 86.2% CyberGym vulnerability discovery, and 1M-token context engineering.
2 Sept 2026 · 8 min read

Engineering
GLM-5.3 & The Rise of Cyber-Capable AI: Automated Vulnerability Discovery & Defensive Architecture
An architectural deep dive into Zhipu AI's GLM-5.3: a 743B open-weight foundation model scoring 84.5% on CyberGym, automating zero-day vulnerability discovery, and reshaping enterprise DevSecOps.
21 Aug 2026 · 4 min read

Engineering
Inside Miles v0.1: The Production-Grade RL Post-Training Architecture for Trillion-Parameter MoE Models
An architectural deep dive into Miles v0.1 by LMSYS and RadixArk: scaling asynchronous RL post-training for 700B+ MoE models using SGLang rollouts, Rollout Routing Replay (R3), and Megatron-LM.
21 Aug 2026 · 5 min read