Skip to content

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

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:

BenchmarkDeepSeek-V4 Pro MaxClaude 3.5 Sonnet (2024)Poolside Laguna S 2.1 (2026)
Total Parameters671 BillionClosed API118 Billion
Active Parameters / Token49 BillionClosed API8 Billion (6x Fewer)
Terminal-Bench 2.1 (Long-Horizon Tasks)64.0%65.2%70.2%
DeepSWE Multilingual Pass@138.2%41.5%40.4%
Context Window Capacity128,000 tokens200,000 tokens1,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):

  1. DFlash speculatively generates candidate token sequences at 280+ tok/s.
  2. The 118B base model validates candidate drafts in a single parallel tensor pass.
  3. 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.