varunrandery commited on
Commit
aa9a715
·
verified ·
1 Parent(s): edcd812

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +325 -66
README.md CHANGED
@@ -1,85 +1,344 @@
1
  ---
2
  library_name: vllm
3
- pipeline_tag: text-generation
 
 
 
4
  tags:
5
- - laguna
6
- - vllm
7
- - fp8
8
- - moe
 
 
9
  ---
10
 
11
  <p align="center">
12
  <img alt="poolside-banner" src="https://poolside.ai/assets/laguna/laguna-m1-banner.svg" width="800px">
13
  </p>
14
 
15
- # Laguna-M.1 (FP8 + FP8 KV-cache)
16
-
17
- Poolside Laguna-M, FP8-quantized weights (block scheme, 128×128) with FP8 KV-cache scales.
18
- Packaged as a self-contained HuggingFace repo so partners can `hf download` once and
19
- serve via the bundled vLLM overlay image without additional build steps.
20
-
21
- ## Contents
22
-
23
- | Path | Size | What it is |
24
- |-----------------------------------------------|--------|------------------------------------------------------------|
25
- | `config.json`, `*.safetensors`, `tokenizer.*` | 214 GB | Laguna-M FP8 weights + FP8 KV-cache scales + tokenizer |
26
- | `image/laguna-vllm-v0.19.0-overlay.tar.gz` | 8.9 GB | vLLM v0.19.0 Docker image with Laguna support overlaid |
27
-
28
- ## Hardware
29
-
30
- Built and tested on **NVIDIA H200 (141 GB HBM3e)**. Recommended serving config: **4× H200, TP=4**.
31
- Other GPU generations (H100, B200) may work but are untested.
32
-
33
- ## Quickstart
34
-
35
- ```bash
36
- # 1. Download.
37
- hf download poolside/Laguna-M.1 --local-dir laguna-m
38
-
39
- # 2. Load the vLLM image.
40
- gunzip -c laguna-m/image/laguna-vllm-v0.19.0-overlay.tar.gz | docker load
41
- # -> laguna-vllm:v0.19.0-overlay
42
-
43
- # 3. Serve on H200.
44
- docker run --gpus '"device=0,1,2,3"' --network host \
45
- -v "$PWD/laguna-m":/model \
46
- laguna-vllm:v0.19.0-overlay \
47
- /model \
48
- --tensor-parallel-size 4 \
49
- --trust-remote-code \
50
- --dtype bfloat16 \
51
- --kv-cache-dtype fp8 \
52
- --max-model-len 4096 \
53
- --gpu-memory-utilization 0.85 \
54
- --served-model-name laguna \
55
- --reasoning-parser poolside_v1 \
56
- --tool-call-parser poolside_v1 \
57
- --enable-auto-tool-choice \
58
- --port 8000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  ```
60
 
61
- Smoke test once the server logs `Application startup complete`:
62
 
63
- ```bash
64
- curl -s http://127.0.0.1:8000/v1/completions \
65
- -H 'Content-Type: application/json' \
66
- -d '{"model":"laguna","prompt":"The capital of France is","max_tokens":8,"temperature":0}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ```
68
 
69
- ## Eval (5-shot)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
- - MMLU: 79.06% ± 0.33% *(all 14k questions, TP=4 H200)*
72
- - GSM8K: 92% strict-match *(n=50 smoke, TP=4 H200; full run to come)*
73
 
74
- ## Architecture
75
 
76
- Laguna-M is a 70-layer MoE transformer:
77
 
78
- - hidden=4096, Q-heads=64, KV-heads=8, head_dim=128 (Q-projection is hidden 8192)
79
- - First 3 layers dense SwiGLU; remaining 67 are sparse MoE (256 experts, top-k=16, sigmoid router, shared expert)
80
- - Per-element attention output gating (softplus)
81
- - RoPE θ=500000, YaRN factor=32, original ctx 4096
82
- - Auxiliary-loss-free load balancing via `e_score_correction_bias`
83
 
84
- Weights use compressed-tensors FP8 block format (128×128 blocks, dynamic activation quant).
85
- FP8 KV-cache scales are included under `model.layers.*.self_attn.{k,v}_scale`.
 
1
  ---
2
  library_name: vllm
3
+ inference: false
4
+ extra_gated_description: >-
5
+ To learn more about how we process your personal data, please read our <a
6
+ href="https://poolside.ai/legal/privacy">Privacy Policy</a>.
7
  tags:
8
+ - laguna-m.1
9
+ - vllm
10
+ - fp8
11
+ - moe
12
+ license: apache-2.0
13
+ pipeline_tag: text-generation
14
  ---
15
 
16
  <p align="center">
17
  <img alt="poolside-banner" src="https://poolside.ai/assets/laguna/laguna-m1-banner.svg" width="800px">
18
  </p>
19
 
20
+ <p align="center">
21
+ <a href="https://platform.poolside.ai"><strong>Get an API key</strong></a> ·
22
+ <a href="https://poolside.ai/blog/laguna-a-deeper-dive"><strong>Release blog post</strong></a> ·
23
+ <a href="https://poolside.ai/assets/laguna/laguna-m1-xs2-technical-report.pdf"><strong>Technical report</strong></a>
24
+ </p>
25
+
26
+ <br>
27
+
28
+ # Laguna M.1
29
+
30
+ Laguna M.1 is a 225B total parameter Mixture-of-Experts model with 23B activated parameters per token designed for agentic coding and long-horizon work. This release provides open weights under the Apache 2.0 license, with upstream support in vLLM, Transformers and TRT-LLM.
31
+
32
+ > [!NOTE]
33
+ > For more details on how we trained this model, including our Model Factory approach, post-training recipe, async off-policy agent RL, and evaluations, check out our [release blog post](https://poolside.ai/blog/laguna-a-deeper-dive) and [technical report](https://poolside.ai/assets/laguna/laguna-m1-xs2-technical-report.pdf).
34
+
35
+ ## Highlights
36
+
37
+ * **Large sparse MoE for agentic coding**: Laguna M.1 is a 70-layer MoE transformer with 225.8B total parameters and 23.4B activated parameters per token
38
+ * **High-capacity expert routing**: After 3 dense SwiGLU layers, Laguna M.1 uses 67 sparse MoE layers with 256 experts, top-k=16 routing and auxiliary-loss-free load balancing
39
+ * **Global attention architecture**: Laguna M.1 uses global attention across all layers with 64 Q-heads, 8 KV-heads and softplus attention output gating
40
+ * **Native reasoning support**: Interleaved thinking between tool calls with support for enabling and disabling thinking per-request
41
+ * **Strong agentic benchmark performance**: Laguna M.1 is competitive with state-of-the-art open-weight and frontier models on SWE-bench Verified, SWE-bench Multilingual, SWE-Bench Pro, and Terminal-Bench 2.0
42
+ * **Apache 2.0 license**: Use and modify freely for commercial and non-commercial purposes
43
+
44
+ ---
45
+
46
+ ## Model overview
47
+
48
+ - Training: pre-training, post-training and reinforcement learning stages
49
+ - Number of parameters: 225B total with 23B activated per token
50
+ - Optimizer: Muon
51
+ - Layers: 70 layers with global attention
52
+ - Experts: 256 experts with 1 shared expert; top-k=16 routing
53
+ - Dense layers: first 3 layers are dense SwiGLU; remaining 67 layers are sparse MoE
54
+ - Attention: 64 Q-heads, 8 KV-heads, head dimension 128, with softplus attention output gating
55
+ - Positional encoding: RoPE with YaRN
56
+ - Modality: text-to-text
57
+ - Context window: 262,144 tokens
58
+ - Reasoning support: interleaved thinking with preserved thinking
59
+
60
+ ## Benchmark results
61
+
62
+ <p align="center">
63
+ <img alt="benchmarks" src="https://poolside.ai/assets/laguna/laguna-m1-chart.svg" width="800px">
64
+ </p>
65
+
66
+ | Model | Size (total params.) | SWE-bench Verified | SWE-bench Multilingual | SWE-bench Pro (Public Dataset) | Terminal-Bench 2.0 |
67
+ |---------------------------|----------------------|--------------------|------------------------|--------------------------------|--------------------|
68
+ | **Laguna M.1** | 225B | 74.6% | 63.1% | 49.2% | 45.8% |
69
+ | Devstral 2 | 123B dense | 72.2% | 61.3% | - | 32.6% |
70
+ | GLM-4.7 | 355B-A32B | 73.8% | 66.7% | - | 41.0% |
71
+ | DeepSeek-V4 Flash | 284B-A13B | 79.0% | 73.3% | 52.6% | 56.9% |
72
+ | Qwen3.5-397B-A17B | 397B-A17B | 76.2% | 69.3% | 50.9% | 52.5% |
73
+ | Claude Sonnet 4.6 | - | 79.6% | - | - | 59.1% |
74
+
75
+ *We used the highest publicly-referenced scores for all comparison models across each benchmark. In almost all cases these were official scores published in release blog posts or equivalent, with Claude Sonnet 4.6 shown as a frontier proprietary reference of comparable model size. “-” indicates a score not reported by the model provider.*
76
+
77
+ <details>
78
+ <summary>Expand for benchmarking methodology</summary>
79
+
80
+ All benchmarking for Laguna M.1 was completed using our [pool agent harness](https://github.com/poolsideai/pool), with a maximum of 500 steps and sandboxed execution. The same sampling parameters were used for all Laguna M.1 benchmarking: temperature=1.0 and top_k=20, with thinking mode enabled and a context length of 256K tokens. All tasks were run in their own sandbox using 8 GB RAM/2 CPUs, with the exception of Terminal-Bench 2.0, which used 48 GB RAM/32 CPUs.
81
+
82
+ Some base task images and verifiers were patched to fix infrastructure reliability issues inherent in task setup, such as rate limits on third-party dependencies in external registries used by the verifier. All four agentic benchmarks were run with patched images. We also ran a reward-hack judge post-hoc on Laguna M.1 evaluation runs and did not find significant reward hacking after joint judge review and manual review.
83
+
84
+ - SWE-bench Verified: mean pass@1 averaged over 4 runs
85
+ - SWE-bench Multilingual: mean pass@1 averaged over 4 runs
86
+ - SWE-Bench Pro: mean pass@1 averaged over 4 runs
87
+ - Terminal-Bench 2.0: mean pass@1 averaged over 4 runs; 48 GB RAM/32 CPUs
88
+
89
+ </details>
90
+
91
+ ## Usage
92
+
93
+ Laguna M.1 is available through the Poolside API and as open weights under the Apache 2.0 license.
94
+
95
+ The fastest way to get started is with our API, directly or using OpenRouter.
96
+
97
+ > [!NOTE]
98
+ > We are providing free access for a limited time to Laguna M.1 and Laguna XS.2 on our API. You can create an API key on our [Platform](https://platform.poolside.ai).
99
+
100
+ ### pool
101
+
102
+ **pool** is a lightweight terminal-based coding agent and a dual [Agent Client Protocol](https://agentclientprotocol.com/get-started) client-server.
103
+
104
+ Download and install for macOS and Linux:
105
+
106
+ ```shell
107
+ curl -fsSL https://downloads.poolside.ai/pool/install.sh | bash
108
+ ```
109
+
110
+ Launch and *Log in with Poolside* to get a free API key.
111
+
112
+ ```shell
113
+ pool
114
+ ```
115
+
116
+ Use in any [ACP client](https://agentclientprotocol.com/get-started/clients). Configure Zed and JetBrains automatically:
117
+
118
+ ```shell
119
+ pool acp setup --editor zed|jetbrains
120
+ ```
121
+
122
+ #### Feedback and issues
123
+
124
+ Submit feedback with `/feedback` and read the [full documentation on GitHub](https://github.com/poolsideai/pool).
125
+
126
+ ### Local deployment
127
+
128
+ Laguna M.1 is supported in vLLM and Transformers, and TRT-LLM thanks to the support of the team at NVIDIA.
129
+
130
+ #### vLLM
131
+
132
+ Serve Laguna M.1 locally with vLLM and query it from any OpenAI-compatible client (see [Controlling reasoning](#controlling-reasoning) for tool calls, streaming, and reasoning extraction):
133
+
134
+ > [!NOTE]
135
+ > Laguna M.1 support is available in upstream vLLM.
136
+
137
+ ```shell
138
+ pip install vllm
139
+
140
+ vllm serve \
141
+ --model poolside/Laguna-M.1 \
142
+ --tool-call-parser poolside_v1 \
143
+ --reasoning-parser poolside_v1 \
144
+ --enable-auto-tool-choice \
145
+ --served-model-name laguna \
146
+ --default-chat-template-kwargs '{"enable_thinking": true}'
147
+ ```
148
+
149
+ See the [vLLM recipes page](https://recipes.vllm.ai/poolside/Laguna-XS.2) for our Laguna XS.2 model with which the implementation is shared for additional deployment guidance.
150
+
151
+ #### Transformers
152
+
153
+ Laguna M.1 is supported in Transformers.
154
+
155
+ ```python
156
+ import torch
157
+ from transformers import AutoModelForCausalLM, AutoTokenizer
158
+
159
+ model_id = "poolside/Laguna-M.1"
160
+
161
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
162
+ model = AutoModelForCausalLM.from_pretrained(
163
+ model_id,
164
+ dtype=torch.bfloat16,
165
+ device_map="auto",
166
+ )
167
+
168
+ messages = [
169
+ {"role": "user", "content": "Write a Python retry wrapper with exponential backoff."},
170
+ ]
171
+
172
+ # Reasoning is on by default; pass enable_thinking=False to skip the <think> block.
173
+ inputs = tokenizer.apply_chat_template(
174
+ messages,
175
+ add_generation_prompt=True,
176
+ return_tensors="pt",
177
+ enable_thinking=True,
178
+ ).to(model.device)
179
+
180
+ outputs = model.generate(
181
+ inputs,
182
+ max_new_tokens=1024,
183
+ do_sample=True,
184
+ temperature=1,
185
+ top_k=20,
186
+ )
187
+
188
+ response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)
189
+ print(response)
190
+ ```
191
+
192
+ #### TRT-LLM
193
+
194
+ Laguna M.1 is supported in TRT-LLM thanks to the support of the team at NVIDIA.
195
+
196
+ ```python
197
+ from tensorrt_llm import LLM, SamplingParams
198
+
199
+ llm = LLM(
200
+ model="poolside/Laguna-M.1",
201
+ trust_remote_code=True,
202
+ tensor_parallel_size=4,
203
+ )
204
+
205
+ sampling = SamplingParams(max_tokens=1024, temperature=1, top_k=20)
206
+ out = llm.generate(["Write a Python retry wrapper with exponential backoff."], sampling)
207
+ print(out[0].outputs[0].text)
208
+ ```
209
+
210
+ Or serve with an OpenAI-compatible endpoint:
211
+
212
+ ```shell
213
+ trtllm-serve poolside/Laguna-M.1 --port 8000 --trust-remote-code
214
  ```
215
 
216
+ ## Controlling reasoning
217
 
218
+ Laguna M.1 has native reasoning support and is designed to work best with *preserved thinking*, where `reasoning` content from prior assistant messages is preserved in the message history. This model will generally reason before calling tools and between tool calls.
219
+
220
+ <details>
221
+ <summary>Expand for example</summary>
222
+
223
+ ```python
224
+ import json
225
+ from openai import OpenAI
226
+
227
+ client = OpenAI(
228
+ base_url="https://inference.poolside.ai/v1",
229
+ api_key="...",
230
+ )
231
+
232
+ model = "poolside/laguna-m.1"
233
+
234
+ tools = [{"type": "function", "function": {
235
+ "name": "shell",
236
+ "description": "Execute a bash command and return the output.",
237
+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]},
238
+ }}]
239
+
240
+ messages = [
241
+ {"role": "system", "content": "You are a coding agent with access to a shell tool."},
242
+ {"role": "user", "content": "Run uname -a"},
243
+ ]
244
+
245
+ # Thinking is enabled by default when the server sets --default-chat-template-kwargs {"enable_thinking": True}
246
+ # When using the Poolside API (https://inference.poolside.ai/v1), this flag is set by default
247
+ response = client.chat.completions.create(
248
+ model=model,
249
+ messages=messages,
250
+ tools=tools,
251
+ stream=True,
252
+ )
253
+
254
+ reasoning, content, tool_calls = "", "", []
255
+ for chunk in response:
256
+ delta = chunk.choices[0].delta
257
+ if hasattr(delta, "reasoning_content") and delta.reasoning_content:
258
+ reasoning += delta.reasoning_content
259
+ if hasattr(delta, "content") and delta.content:
260
+ content += delta.content
261
+ if hasattr(delta, "tool_calls") and delta.tool_calls:
262
+ for tc in delta.tool_calls:
263
+ if tc.index >= len(tool_calls):
264
+ tool_calls.append({"id": tc.id, "function": {"name": "", "arguments": ""}})
265
+ if tc.function.name:
266
+ tool_calls[tc.index]["function"]["name"] = tc.function.name
267
+ if tc.function.arguments:
268
+ tool_calls[tc.index]["function"]["arguments"] += tc.function.arguments
269
+
270
+ print(f"Reasoning: {reasoning}\nContent: {content}\nTool calls: {tool_calls}\n")
271
+
272
+ # Return reasoning in the next request for best performance
273
+ messages.append({
274
+ "role": "assistant",
275
+ "content": content,
276
+ "reasoning_content": reasoning,
277
+ "tool_calls": [{"id": tc["id"], "type": "function", "function": tc["function"]} for tc in tool_calls]
278
+ })
279
+
280
+ messages.append({
281
+ "role": "tool",
282
+ "tool_call_id": tool_calls[0]["id"],
283
+ "content": json.dumps({"stdout": "Darwin arm64", "exit_code": "0"})
284
+ })
285
+
286
+ response = client.chat.completions.create(
287
+ model=model,
288
+ messages=messages,
289
+ tools=tools,
290
+ stream=True,
291
+ )
292
+
293
+ reasoning, content = "", ""
294
+ for chunk in response:
295
+ delta = chunk.choices[0].delta
296
+ if hasattr(delta, "reasoning_content") and delta.reasoning_content:
297
+ reasoning += delta.reasoning_content
298
+ if hasattr(delta, "content") and delta.content:
299
+ content += delta.content
300
+
301
+ print(f"Reasoning: {reasoning}\nContent: {content}")
302
  ```
303
 
304
+ </details>
305
+
306
+ ### Disabling reasoning
307
+
308
+ You can disable thinking by setting `enable_thinking` to `False` in a request or by not providing `--default-chat-template-kwargs {"enable_thinking": True}` or equivalent when starting the server.
309
+
310
+ <details>
311
+ <summary>Expand for example</summary>
312
+
313
+ ```python
314
+ from openai import OpenAI
315
+ client = OpenAI()
316
+
317
+ completion = client.chat.completions.create(
318
+ model="poolside/laguna-m.1",
319
+ messages=[
320
+ {"role": "user", "content": "Write a retry wrapper with exponential backoff."}
321
+ ],
322
+ extra_body={
323
+ "chat_template_kwargs": { "enable_thinking": False },
324
+ },
325
+ stream=True
326
+ )
327
+
328
+ for chunk in completion:
329
+ print(chunk.choices[0].delta)
330
+ ```
331
+
332
+ </details>
333
+
334
+ For agentic coding use cases, we recommend enabling thinking and preserving reasoning in message history as outlined in the [Controlling reasoning](#controlling-reasoning) section.
335
 
336
+ ## License
 
337
 
338
+ This model is licensed under the [Apache 2.0 License](https://huggingface.co/poolside/Laguna-M.1/blob/main/LICENSE.md).
339
 
340
+ ## Intended and Responsible Use
341
 
342
+ Laguna M.1 is designed for software engineering and agentic coding use cases, and you are responsible for confirming that it is appropriate for your intended application. Laguna M.1 is subject to the [Apache 2.0 License](https://huggingface.co/poolside/Laguna-M.1/blob/main/LICENSE.md), and should be used consistently with Poolside's [Acceptable Use Policy](https://poolside.ai/legal/acceptable-use-policy). We advise against circumventing Laguna M.1 safety guardrails without implementing substantially equivalent mitigations appropriate for your use case.
 
 
 
 
343
 
344
+ Please report security vulnerabilities or safety concerns to [security@poolside.ai](mailto:security@poolside.ai).