Laguna S 2.1
Laguna S 2.1 is an open-weight Mixture-of-Experts model built for agentic coding and long-running tasks. It runs in thinking and no-thinking modes with a context window of 1M tokens. Call Laguna S 2.1 on AI Gateway with poolside/laguna-s-2.1. Your use is subject to Poolside's Terms & Privacy Policies.
- Input and output price
- Input $0.10, Output $0.20, Per 1M tokens
- 24h uptime
- Loading AI Gateway uptime
import { streamText } from 'ai'
const result = streamText({ model: 'poolside/laguna-s-2.1', prompt: 'Why is the sky blue?'})Copy link to headingPlayground
Try out Laguna S 2.1 by Poolside. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Laguna S 2.1
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Copy link to headingUptime24 hours
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
Copy link to headingThroughput24 hours
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
Copy link to headingLatency24 hours
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Getting started
Call Laguna S 2.1 through AI Gateway with the AI SDK generateText and streamText functions, or through the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages APIs by changing the base URL. AI Gateway authenticates the request and routes it to an available provider.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the text generation quickstart.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'poolside/laguna-s-2.1', prompt: 'Why is the sky blue?', });
console.log(result.text);}
main().catch(console.error);Top-level parameters
The same Laguna S 2.1 request in each API format AI Gateway supports.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'poolside/laguna-s-2.1', system: 'You are a concise technical assistant.', prompt: 'Summarize the tradeoffs between static generation and SSR.', maxOutputTokens: 1024, });
console.log(result.text);}
main().catch(console.error);Standard parameters like prompt, messages, temperature, and tools work as documented in the AI SDK docs. These are the parameters with model-specific behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID in the form creator/model, e.g. poolside/laguna-s-2.1. AI Gateway routes the request to an available provider. |
maxOutputTokens | number | No | Hard cap on generated tokens. Laguna S 2.1 supports up to 131,072 output tokens. Reasoning tokens count toward this limit. |
reasoning | 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | No | Provider-agnostic reasoning effort, available in AI SDK 7 or later. Maps to the provider’s native reasoning configuration; reasoning settings under providerOptions take precedence when both are set. See the Reasoning section below. |
providerOptions | Record<string, JSONValue> | No | AI Gateway routing options under gateway, plus any provider-native options under the provider’s own namespace — see the table below. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Prompt and response share the 1M-token context window |
Provider options
Set AI Gateway routing options under providerOptions.gateway. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.
Learn more in the AI SDK provider docs.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'poolside/laguna-s-2.1', prompt: 'Why is the sky blue?', providerOptions: { gateway: { only: ['poolside'], }, }, });
console.log(result.text);}
main().catch(console.error);These AI Gateway routing options apply to every model. Provider-specific options pass through under the provider’s own namespace (for example providerOptions.anthropic) exactly as documented by the AI SDK.
| Parameter | Type | Required | Description |
|---|---|---|---|
providerOptions.gateway.only | string[] | No | Restrict routing to these provider slugs. Requests fail over only within the listed providers. |
providerOptions.gateway.order | string[] | No | Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks. |
providerOptions.gateway.sort | 'cost' | 'ttft' | 'tps' | No | Rank candidate providers by price, time to first token, or tokens per second instead of the default routing order. |
providerOptions.gateway.zeroDataRetention | boolean | No | Route only to providers with a zero-data-retention policy for this model. |
Routing across providers
AI Gateway serves the same model through multiple providers and fails over automatically. order expresses a preference while keeping every provider eligible; only is a hard allowlist — if none of the listed providers are available the request fails instead of falling back.
Options under a provider's own namespace (for example providerOptions.anthropic) are forwarded to that provider with the request. Providers ignore option namespaces that don't apply to them, so it is safe to set provider options alongside gateway routing options.
Reasoning
AI Gateway bridges reasoning across every API format. The AI SDK exposes a provider-agnostic top-level reasoning level (none, minimal, low, medium, high, or xhigh); the Chat Completions and Responses formats take the same effort under reasoning.effort; and the Anthropic Messages format uses a native thinking token budget. Whichever you send, the gateway maps it to the target model’s native configuration, converting between effort levels and token budgets as needed. Reasoning-related settings under providerOptions take full precedence over the top-level reasoning value and are never merged. Reasoning tokens typically count toward your output-token usage, though how they’re reported and billed varies by provider.
Learn more in the AI Gateway reasoning guide.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'poolside/laguna-s-2.1', prompt: 'Explain the Monty Hall problem step by step.', reasoning: 'high', });
console.log(result.text);}
main().catch(console.error);Tool calling
Expose tools the model can call. Define each tool’s inputs with a Zod schema.
import { generateText, tool } from 'ai';import { z } from 'zod';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'poolside/laguna-s-2.1', prompt: 'What is the weather in San Francisco?', tools: { getWeather: tool({ description: 'Get the current weather for a location', inputSchema: z.object({ location: z.string() }), execute: async ({ location }) => ({ location, temperatureC: 18 }), }), }, });
console.log(result.text);}
main().catch(console.error);Copy link to headingAbout Laguna S 2.1
Laguna S 2.1 became available on AI Gateway on July 20, 2026. Laguna S 2.1 is a Mixture-of-Experts (MoE) model with 118 billion total parameters and 8 billion active per token, and it runs in thinking and no-thinking modes. Poolside published the weights on Hugging Face under the OpenMDW-1.1 license. AI Gateway lists two versions: this one, with a context window of 1M tokens, and a free version with a smaller window at laguna-s-2.1-free.
Agentic coding is the focus. With thinking enabled, Laguna S 2.1 scores 70.2% on Terminal-Bench 2.1, 78.5% on SWE-Bench Multilingual, and 59.4% on SWE-Bench Pro (public dataset). Broader agentic evaluations put it at 40.4% on DeepSWE v1.1, 46.2% on SWE Atlas codebase question answering, and 49.7% on Toolathlon Verified. Thinking accounts for a large share of those results. Without it, the Terminal-Bench 2.1 score falls to 60.4% and DeepSWE to 16.5%.
The context window of 1M tokens supports the sessions Laguna S 2.1 is built for. A single agent run accumulates terminal output, file contents, and tool results across many steps before it finishes. In one case study Poolside published, Laguna S 2.1 built a working HTML and CSS rendering engine from an empty folder over 181 steps with no human intervention, then checked its own rendering against a headless browser.
Poolside documented three limitations at release. First, Laguna S 2.1 sometimes relies on a remembered tool interface instead of the schema a third-party agent harness supplies. That usually corrects itself once the harness rejects the call and asks for a retry. Second, tool arguments that expect a JSON array can come back with invalid escaping. Third, Laguna S 2.1 can think for long stretches on competition mathematics before it makes progress. Laguna S 2.1 also accepts text input only, with no image or audio input.
Set the model to poolside/laguna-s-2.1 in the AI SDK, Chat Completions API, Responses API, Messages API, or other API formats, from TypeScript or Python. To use Laguna S 2.1 inside a coding agent, run vercel ai-gateway setup, then select poolside/laguna-s-2.1 in the agent's model configuration. AI Gateway serves Laguna S 2.1 through Poolside, with retries and failover, and expanded capacity for both versions after launch. Pricing mirrors the provider with no markup and no platform fee on inference, including on Bring Your Own Key (BYOK) requests.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Thinking mode is on by default, and Laguna S 2.1 chooses its own test-time compute budget for each problem. Poolside shipped this release without low, medium, and high effort levels, so the practical choice is thinking on or off. Hard problems can produce long thinking sequences, so set generous timeouts on agent runs and watch token usage in AI Gateway reporting.
- Zero Data Retention: Zero Data Retention is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Laguna S 2.1
Best for
- Long-Horizon Coding Agents: Sessions that run for many steps and accumulate large working context
- Terminal-Driven Automation: Agents that work through a shell to build, run, and verify software
- Multilingual Bug Fixing: Repository work that spans several programming languages, with 78.5% on SWE-Bench Multilingual
- Codebase Question Answering: Questions that need the model to read widely across a repository first
- High-Volume Agent Traffic: AI Gateway expanded serving capacity for Laguna S 2.1 after the initial launch
Consider alternatives when
- Image or Audio Input: Laguna S 2.1 takes text only, so multimodal work needs a model such as Inkling
- Strict Third-Party Harnesses: Laguna S 2.1 can misread tool schemas that closely resemble the ones it knows
- Fixed Reasoning Budgets: Thinking is either on or off, with no low, medium, or high effort levels
- Broad General Assistance: Agentic coding is the target, not open-domain chat or factual recall
- Evaluation and Prototyping: The free version at
laguna-s-2.1-freecovers early testing at a smaller context window
Copy link to headingConclusion
Laguna S 2.1 is a compact agentic coding model that leans on thinking mode rather than parameter count. Use Laguna S 2.1 for terminal-driven agents, multi-language repository work, and sessions long enough to need a context window of 1M tokens.
Copy link to headingFrequently Asked Questions
What is Laguna S 2.1 built for?
Agentic coding and long-running tasks. That includes writing and debugging code, running tests, building browser-based tooling, and working on machine learning operations (MLOps) pipelines and AI research.
How does Laguna S 2.1 differ from the free version?
The context window. Laguna S 2.1 supports 1M tokens, while
laguna-s-2.1-freesupports a smaller window. Both versions serve the same model, so capability is the same within the window each one allows.How does thinking mode affect Laguna S 2.1?
Thinking raises scores on hard agentic tasks. With thinking enabled, Laguna S 2.1 scores 70.2% on Terminal-Bench 2.1 against 60.4% without it, and 40.4% on DeepSWE v1.1 against 16.5%. Thinking is enabled by default, and the model sets its own budget per problem.
How did Laguna S 2.1 score on coding benchmarks?
70.2% on Terminal-Bench 2.1, 78.5% on SWE-Bench Multilingual, and 59.4% on SWE-Bench Pro (public dataset), all in thinking mode. On broader agentic evaluations, Laguna S 2.1 scores 40.4% on DeepSWE v1.1, 46.2% on SWE Atlas codebase question answering, and 49.7% on Toolathlon Verified.
How do I call Laguna S 2.1 through AI Gateway?
Set the model to
poolside/laguna-s-2.1in the AI SDK, Chat Completions API, Responses API, Messages API, or other API formats, from TypeScript or Python. AI Gateway handles authentication, retries, and failover acrosspoolside.Can I run Laguna S 2.1 in a coding agent?
Yes. Run
vercel ai-gateway setupto connect your agents to AI Gateway, then selectpoolside/laguna-s-2.1in the agent's model configuration. See the coding agents guide at https://vercel.com/docs/ai-gateway/coding-agents.What are the known limitations of Laguna S 2.1?
Poolside listed three. Laguna S 2.1 can follow a remembered tool interface instead of the one a third-party harness defines, which typically resolves after a rejected call and a retry. Tool arguments expecting a JSON array can come back with invalid escaping. Laguna S 2.1 can also think for long stretches on competition mathematics before making progress.
Are the weights for Laguna S 2.1 open?
Yes. Poolside published them on Hugging Face under the OpenMDW-1.1 license, which permits commercial and non-commercial use and modification. Quantized variants ship alongside the original weights.
Does AI Gateway support Zero Data Retention for Laguna S 2.1?
Zero Data Retention is not currently available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.
What does Laguna S 2.1 cost?
Current rates appear in the pricing panel on this page. AI Gateway mirrors provider pricing with no markup and adds no platform fee on inference, including on Bring Your Own Key requests.