Text Generation
Transformers
Safetensors
laguna
laguna-s-2.1
vllm
conversational
custom_code
Eval Results
Instructions to use poolside/Laguna-S-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside/Laguna-S-2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="poolside/Laguna-S-2.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("poolside/Laguna-S-2.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside/Laguna-S-2.1", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use poolside/Laguna-S-2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "poolside/Laguna-S-2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside/Laguna-S-2.1
- SGLang
How to use poolside/Laguna-S-2.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "poolside/Laguna-S-2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "poolside/Laguna-S-2.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside/Laguna-S-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside/Laguna-S-2.1 with Docker Model Runner:
docker model run hf.co/poolside/Laguna-S-2.1
Update README.md
#1
by Jiminator - opened
- .eval_results/deepswe.yaml +1 -1
- README.md +12 -53
- chat_template.jinja +2 -3
- generation_config.json +2 -1
- tokenizer.json +1 -1
- tokenizer_config.json +2 -2
.eval_results/deepswe.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
- dataset:
|
| 2 |
id: datacurve/deep-swe
|
| 3 |
-
task_id:
|
| 4 |
value: 40.4
|
| 5 |
source:
|
| 6 |
url: https://huggingface.co/poolside/Laguna-S-2.1
|
|
|
|
| 1 |
- dataset:
|
| 2 |
id: datacurve/deep-swe
|
| 3 |
+
task_id: deepswe_%_resolved
|
| 4 |
value: 40.4
|
| 5 |
source:
|
| 6 |
url: https://huggingface.co/poolside/Laguna-S-2.1
|
README.md
CHANGED
|
@@ -11,37 +11,29 @@ license: openmdw-1.1
|
|
| 11 |
pipeline_tag: text-generation
|
| 12 |
---
|
| 13 |
|
| 14 |
-
<p align="center">
|
| 15 |
-
<img alt="poolside-banner" src="https://poolside.ai/assets/laguna/laguna-s-2-1-banner.svg" width="800px">
|
| 16 |
-
</p>
|
| 17 |
-
|
| 18 |
-
<p align="center">
|
| 19 |
-
<a href="https://openrouter.ai/poolside/laguna-s-2.1"><strong>Use on OpenRouter</strong></a> ·
|
| 20 |
-
<a href="https://vercel.com/ai-gateway/models/laguna-s-2.1"><strong>Use on Vercel AI Gateway</strong></a> ·
|
| 21 |
-
<a href="https://poolside.ai/blog/introducing-laguna-s-2-1"><strong>Release blog post</strong></a>
|
| 22 |
-
</p>
|
| 23 |
-
|
| 24 |
-
<br>
|
| 25 |
-
|
| 26 |
# Laguna S 2.1
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
Laguna S 2.1 is a 118B total parameter Mixture-of-Experts model with 8B activated
|
| 29 |
parameters per token, designed for agentic coding and long-horizon work. It sits
|
| 30 |
-
between [Laguna XS 2.1](https://huggingface.co/poolside/Laguna-XS-2.1) (33B
|
| 31 |
-
Laguna M.1 (
|
| 32 |
-
token-choice router with
|
| 33 |
expert, grouped-query attention, and interleaved full/sliding-window attention.
|
| 34 |
|
| 35 |
## Highlights
|
| 36 |
|
| 37 |
- **Mixed SWA and global attention layout**: 48 layers in a 1:3 global-to-SWA ratio
|
| 38 |
-
(12 global attention layers, 36 sliding-window layers, window 512), with
|
| 39 |
attention gating and per-layer-type rotary scales
|
| 40 |
- **1M context**: 1,048,576-token context window
|
| 41 |
- **Native reasoning support**: interleaved thinking between tool calls, with
|
| 42 |
per-request control via `enable_thinking`
|
| 43 |
- **Speculative decoding**: a trained
|
| 44 |
-
[DFlash
|
| 45 |
for lower-latency serving
|
| 46 |
- **Quantized variants**:
|
| 47 |
[FP8](https://huggingface.co/poolside/Laguna-S-2.1-FP8),
|
|
@@ -57,33 +49,13 @@ expert, grouped-query attention, and interleaved full/sliding-window attention.
|
|
| 57 |
- Number of parameters: 118B total, ~8B activated per token
|
| 58 |
- Layers: 48 (12 global attention, 36 sliding-window attention)
|
| 59 |
- Experts: 256 routed (top-10) plus 1 shared expert
|
| 60 |
-
- Attention: grouped-query, 8 KV heads, head dim 128; per-head
|
| 61 |
- Sliding window: 512 tokens
|
| 62 |
- Context window: 1,048,576 tokens
|
| 63 |
- Vocabulary: 100,352 tokens (Laguna family tokenizer)
|
| 64 |
- Modality: text-to-text
|
| 65 |
- Reasoning: interleaved thinking with preserved thinking
|
| 66 |
|
| 67 |
-
## Benchmark results
|
| 68 |
-
|
| 69 |
-
<p align="center">
|
| 70 |
-
<img alt="benchmarks" src="https://poolside.ai/assets/laguna/laguna-s-2-1-chart.svg" width="800px">
|
| 71 |
-
</p>
|
| 72 |
-
|
| 73 |
-
| Model | Size | Terminal-Bench 2.1 | SWE-bench Multilingual | SWE-Bench Pro (Public Dataset) | DeepSWE | SWE Atlas (Codebase QnA) | Toolathlon Verified |
|
| 74 |
-
|---|---|---|---|---|---|---|---|
|
| 75 |
-
| **Laguna S 2.1** | 118B-A8B | **70.2%** | **78.5%** | **59.4%** | **40.4%** | **46.2%** | **49.7%** |
|
| 76 |
-
| Tencent Hy3 | 295B-A21B | 71.7% | 75.8% | 57.9% | - | - | - |
|
| 77 |
-
| Inkling | 975B-A41B | 63.8% | - | 54.3% | - | - | 45.5%* |
|
| 78 |
-
| Nemotron 3 Ultra | 550B-A55B | 56.4% | 67.7% | - | - | - | 34.3%* |
|
| 79 |
-
| DeepSeek-V4-Pro Max | 1.6T-A49B | 64.0%* | 76.2% | 55.4% | 9.0%* | 27.2%* | 55.9%* |
|
| 80 |
-
| Kimi K3 | 2800B-A50B | 88.3% | - | - | 69% | - | - |
|
| 81 |
-
| Qwen 3.7 Max | - | 74.5%* | 78.3% | 60.6% | - | - | - |
|
| 82 |
-
| Muse Spark 1.1 | - | 80% | - | 61.5% | 53.3% | 42.2%* | 75.6% |
|
| 83 |
-
| Claude Fable 5 | - | 88% | - | 80.3% | 70% | - | - |
|
| 84 |
-
|
| 85 |
-
Benchmarks as of 21 July 2026. Laguna S 2.1 in **bold**; a dash (-) marks a benchmark a model was not evaluated on. Scores marked * are as reported by third parties: Terminal-Bench 2.1 and DeepSWE via Artificial Analysis, SWE Atlas via Scale AI's official leaderboard, and Toolathlon Verified via its official leaderboard. Full evaluation trajectories: [trajectories.poolside.ai](https://trajectories.poolside.ai).
|
| 86 |
-
|
| 87 |
## Usage
|
| 88 |
|
| 89 |
Laguna S 2.1 uses the same `laguna` architecture as Laguna XS 2.1, so the same
|
|
@@ -106,7 +78,7 @@ vllm serve \
|
|
| 106 |
|
| 107 |
> [!NOTE]
|
| 108 |
> **Optional: speculative decoding with DFlash.** Pair with the
|
| 109 |
-
> [Laguna S 2.1 DFlash
|
| 110 |
> by adding
|
| 111 |
> `--speculative-config '{"model":"poolside/Laguna-S-2.1-DFlash","num_speculative_tokens":7,"method":"dflash"}'`.
|
| 112 |
|
|
@@ -150,22 +122,9 @@ cd llama.cpp && cmake -B build && cmake --build build -j
|
|
| 150 |
# with DFlash speculative decoding:
|
| 151 |
./build/bin/llama-server -m laguna-s-2.1-Q4_K_M.gguf \
|
| 152 |
-md laguna-s-2.1-DFlash-BF16.gguf \
|
| 153 |
-
--spec-type draft-dflash --spec-draft-n-max
|
| 154 |
```
|
| 155 |
|
| 156 |
-
### Ollama
|
| 157 |
-
|
| 158 |
-
Run directly from the [Ollama library](https://ollama.com/library/laguna-s-2.1):
|
| 159 |
-
|
| 160 |
-
```shell
|
| 161 |
-
ollama run laguna-s-2.1
|
| 162 |
-
```
|
| 163 |
-
|
| 164 |
-
Quantization variants are available as tags (`q4_K_M`, `q8_0`, `f16`, `mxfp8`,
|
| 165 |
-
`nvfp4`, `mlx-bf16`), for example `ollama run laguna-s-2.1:q8_0`. The Laguna chat
|
| 166 |
-
template is baked into the model, so tool-calling and interleaved reasoning work
|
| 167 |
-
automatically.
|
| 168 |
-
|
| 169 |
## Controlling reasoning
|
| 170 |
|
| 171 |
Laguna S 2.1 has native reasoning support and works best with *preserved thinking*:
|
|
|
|
| 11 |
pipeline_tag: text-generation
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Laguna S 2.1
|
| 15 |
|
| 16 |
+
> [!IMPORTANT]
|
| 17 |
+
> Private preview. This repository and the rest of the Laguna S 2.1 family are not
|
| 18 |
+
> yet public.
|
| 19 |
+
|
| 20 |
Laguna S 2.1 is a 118B total parameter Mixture-of-Experts model with 8B activated
|
| 21 |
parameters per token, designed for agentic coding and long-horizon work. It sits
|
| 22 |
+
between [Laguna XS 2.1](https://huggingface.co/poolside/Laguna-XS-2.1) (33B/3B) and
|
| 23 |
+
Laguna M.1 (222B/23B) in the Laguna family and shares the family recipe: a
|
| 24 |
+
token-choice router with sigmoid gating over 256 routed experts plus one shared
|
| 25 |
expert, grouped-query attention, and interleaved full/sliding-window attention.
|
| 26 |
|
| 27 |
## Highlights
|
| 28 |
|
| 29 |
- **Mixed SWA and global attention layout**: 48 layers in a 1:3 global-to-SWA ratio
|
| 30 |
+
(12 global attention layers, 36 sliding-window layers, window 512), with sigmoid
|
| 31 |
attention gating and per-layer-type rotary scales
|
| 32 |
- **1M context**: 1,048,576-token context window
|
| 33 |
- **Native reasoning support**: interleaved thinking between tool calls, with
|
| 34 |
per-request control via `enable_thinking`
|
| 35 |
- **Speculative decoding**: a trained
|
| 36 |
+
[DFlash drafter](https://huggingface.co/poolside/Laguna-S-2.1-DFlash) is available
|
| 37 |
for lower-latency serving
|
| 38 |
- **Quantized variants**:
|
| 39 |
[FP8](https://huggingface.co/poolside/Laguna-S-2.1-FP8),
|
|
|
|
| 49 |
- Number of parameters: 118B total, ~8B activated per token
|
| 50 |
- Layers: 48 (12 global attention, 36 sliding-window attention)
|
| 51 |
- Experts: 256 routed (top-10) plus 1 shared expert
|
| 52 |
+
- Attention: grouped-query, 8 KV heads, head dim 128; per-head sigmoid output gating
|
| 53 |
- Sliding window: 512 tokens
|
| 54 |
- Context window: 1,048,576 tokens
|
| 55 |
- Vocabulary: 100,352 tokens (Laguna family tokenizer)
|
| 56 |
- Modality: text-to-text
|
| 57 |
- Reasoning: interleaved thinking with preserved thinking
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
## Usage
|
| 60 |
|
| 61 |
Laguna S 2.1 uses the same `laguna` architecture as Laguna XS 2.1, so the same
|
|
|
|
| 78 |
|
| 79 |
> [!NOTE]
|
| 80 |
> **Optional: speculative decoding with DFlash.** Pair with the
|
| 81 |
+
> [Laguna S 2.1 DFlash drafter](https://huggingface.co/poolside/Laguna-S-2.1-DFlash)
|
| 82 |
> by adding
|
| 83 |
> `--speculative-config '{"model":"poolside/Laguna-S-2.1-DFlash","num_speculative_tokens":7,"method":"dflash"}'`.
|
| 84 |
|
|
|
|
| 122 |
# with DFlash speculative decoding:
|
| 123 |
./build/bin/llama-server -m laguna-s-2.1-Q4_K_M.gguf \
|
| 124 |
-md laguna-s-2.1-DFlash-BF16.gguf \
|
| 125 |
+
--spec-type draft-dflash --spec-draft-n-max 15 -fa on --jinja --port 8000
|
| 126 |
```
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
## Controlling reasoning
|
| 129 |
|
| 130 |
Laguna S 2.1 has native reasoning support and works best with *preserved thinking*:
|
chat_template.jinja
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
{#- Iteration on laguna_glm_thinking_v8/chat_template.jinja -#}
|
| 2 |
{#- No formatting instructions -#}
|
| 3 |
{{- "〈|EOS|〉" -}}
|
| 4 |
-
{%- set enable_thinking = enable_thinking | default(
|
| 5 |
{%- set add_generation_prompt = add_generation_prompt | default(false) -%}
|
| 6 |
-
{%- set preserve_thinking = preserve_thinking | default(false) -%}
|
| 7 |
|
| 8 |
{#- ───── header (system message) ───── -#}
|
| 9 |
{#- A caller-supplied system message with empty content opts out of the default below, producing no <system> block — used to train without a system message. -#}
|
|
@@ -52,7 +51,7 @@
|
|
| 52 |
{%- set reasoning_content = message.reasoning_content -%}
|
| 53 |
{%- endif -%}
|
| 54 |
{#- Display reasoning content for all messages if enable_thinking -#}
|
| 55 |
-
{%- if enable_thinking
|
| 56 |
{{- '<think>' + reasoning_content + '</think>' -}}
|
| 57 |
{%- else -%}
|
| 58 |
{{- '</think>' -}}
|
|
|
|
| 1 |
{#- Iteration on laguna_glm_thinking_v8/chat_template.jinja -#}
|
| 2 |
{#- No formatting instructions -#}
|
| 3 |
{{- "〈|EOS|〉" -}}
|
| 4 |
+
{%- set enable_thinking = enable_thinking | default(false) -%}
|
| 5 |
{%- set add_generation_prompt = add_generation_prompt | default(false) -%}
|
|
|
|
| 6 |
|
| 7 |
{#- ───── header (system message) ───── -#}
|
| 8 |
{#- A caller-supplied system message with empty content opts out of the default below, producing no <system> block — used to train without a system message. -#}
|
|
|
|
| 51 |
{%- set reasoning_content = message.reasoning_content -%}
|
| 52 |
{%- endif -%}
|
| 53 |
{#- Display reasoning content for all messages if enable_thinking -#}
|
| 54 |
+
{%- if enable_thinking -%}
|
| 55 |
{{- '<think>' + reasoning_content + '</think>' -}}
|
| 56 |
{%- else -%}
|
| 57 |
{{- '</think>' -}}
|
generation_config.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
2,
|
| 6 |
24
|
| 7 |
],
|
|
|
|
| 8 |
"pad_token_id": 9,
|
| 9 |
"temperature": 1.0,
|
| 10 |
"top_p": 1.0,
|
|
@@ -21,4 +22,4 @@
|
|
| 21 |
"model": "poolside/Laguna-S-2.1-DFlash",
|
| 22 |
"num_speculative_tokens": 15
|
| 23 |
}
|
| 24 |
-
}
|
|
|
|
| 5 |
2,
|
| 6 |
24
|
| 7 |
],
|
| 8 |
+
"max_new_tokens": 32768,
|
| 9 |
"pad_token_id": 9,
|
| 10 |
"temperature": 1.0,
|
| 11 |
"top_p": 1.0,
|
|
|
|
| 22 |
"model": "poolside/Laguna-S-2.1-DFlash",
|
| 23 |
"num_speculative_tokens": 15
|
| 24 |
}
|
| 25 |
+
}
|
tokenizer.json
CHANGED
|
@@ -226,7 +226,7 @@
|
|
| 226 |
"lstrip": false,
|
| 227 |
"rstrip": false,
|
| 228 |
"normalized": false,
|
| 229 |
-
"special":
|
| 230 |
},
|
| 231 |
{
|
| 232 |
"id": 25,
|
|
|
|
| 226 |
"lstrip": false,
|
| 227 |
"rstrip": false,
|
| 228 |
"normalized": false,
|
| 229 |
+
"special": false
|
| 230 |
},
|
| 231 |
{
|
| 232 |
"id": 25,
|
tokenizer_config.json
CHANGED
|
@@ -542,7 +542,7 @@
|
|
| 542 |
"lstrip": false,
|
| 543 |
"rstrip": false,
|
| 544 |
"normalized": false,
|
| 545 |
-
"special":
|
| 546 |
},
|
| 547 |
"25": {
|
| 548 |
"content": "<tool_call>",
|
|
@@ -572,5 +572,5 @@
|
|
| 572 |
"sep_token": "〈|SEP|〉",
|
| 573 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 574 |
"unk_token": "〈|UNK|〉",
|
| 575 |
-
"chat_template": "{
|
| 576 |
}
|
|
|
|
| 542 |
"lstrip": false,
|
| 543 |
"rstrip": false,
|
| 544 |
"normalized": false,
|
| 545 |
+
"special": false
|
| 546 |
},
|
| 547 |
"25": {
|
| 548 |
"content": "<tool_call>",
|
|
|
|
| 572 |
"sep_token": "〈|SEP|〉",
|
| 573 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 574 |
"unk_token": "〈|UNK|〉",
|
| 575 |
+
"chat_template": "{% include 'chat_template.jinja' %}"
|
| 576 |
}
|