BinbinWatermelon commited on
Commit
6c5a76c
·
verified ·
1 Parent(s): 64afd0a

Add files using upload-large-folder tool

Browse files
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Meituan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,3 +1,355 @@
1
  ---
2
  license: mit
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ library_name: LongCat-2.0
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - transformers
7
  ---
8
+
9
+ # LongCat-2.0
10
+
11
+ <div align="center">
12
+ <img src="figures/longcat_logo.svg" width="45%" alt="LongCat-2.0" />
13
+ </div>
14
+ <hr>
15
+
16
+ <div align="center" style="line-height: 1;">
17
+ <!-- <a href="https://longcat.ai/" target="_blank" style="margin: 2px;">
18
+ <img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-LongCat--Flash--Chat-ADFF2F?color=29E154&logoColor=white" fill-opacity="1" style="display: inline-block; vertical-align: middle;"/>
19
+ </a> -->
20
+ <a href="https://huggingface.co/meituan-longcat" target="_blank" style="margin: 2px;">
21
+ <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-LongCat-ffc107?color=ffc107&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
22
+ </a>
23
+ <a href="https://www.modelscope.cn/models/meituan-longcat/LongCat-2.0" target="_blank" style="margin: 2px;">
24
+ <img alt="ModelScope" src="https://img.shields.io/badge/%F0%9F%A4%96%20ModelScope-LongCat-624AFF?logo=modelscope&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
25
+ </a>
26
+ </div>
27
+
28
+ <div align="center" style="line-height: 1;">
29
+ <a href="https://github.com/meituan-longcat/LongCat-2.0/blob/main/figures/wechat_official_accounts.png" target="_blank" style="margin: 2px;">
30
+ <img alt="Wechat" src="https://img.shields.io/badge/WeChat-LongCat-brightgreen?logo=wechat&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
31
+ </a>
32
+ <a href="https://discord.com/invite/jmuv5TQzKU" target="_blank" style="margin: 2px;">
33
+ <img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
34
+ </a>
35
+ <a href="https://x.com/Meituan_LongCat" target="_blank" style="margin: 2px;">
36
+ <img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-LongCat-white?logo=x&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
37
+ </a>
38
+ </div>
39
+
40
+ <div align="center" style="line-height: 1;">
41
+ <a href="LICENSE" style="margin: 2px;">
42
+ <img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
43
+ </a>
44
+ </div>
45
+
46
+ <p align="center">
47
+ <a href="https://longcat.chat/blog/longcat-2.0"><b>Tech Blog</b>&nbsp;📄</a>
48
+ </p>
49
+
50
+ ## Model Introduction
51
+ We introduce LongCat-2.0, a large-scale MoE language model with **1.6 trillion total parameters** and ~48 billion activated per token — a substantial step up from previous LongCat models, accompanied by several architectural improvements.
52
+
53
+ Both the full training run and the large-scale deployment are built entirely on **AI ASIC superpods**. Pretraining spans millions of accelerator-days across more than 35 trillion tokens, with no rollbacks or irrecoverable loss spikes — demonstrating that we have the capability to conduct frontier-scale training on alternative hardware platforms.
54
+
55
+ To strengthen the model on long-horizon tasks, we introduce LongCat Sparse Attention and train LongCat-2.0 on hundreds of billions of tokens of **1M-context** data. Together with dedicated post-training, this gives LongCat-2.0 strong performance on coding and agentic tasks.
56
+
57
+ LongCat-2.0 is deeply integrated with mainstream harnesses such as Claude Code, OpenClaw, and Hermes, delivering strong performance across code understanding, repository-level edits, automated task execution, and agentic workflows — providing developers with a more stable and efficient collaborative experience.
58
+
59
+ <div align="center">
60
+ <img src="figures/longcat-pro-benchmark-charts-2026-06-29.svg" width="100%" alt="LongCat-2.0 Benchmark Charts" />
61
+ </div>
62
+
63
+ ### Key Features
64
+
65
+ #### 🌟 LongCat Sparse Attention
66
+ To address the output discontinuity and quadratic scoring bottleneck of the Lightning Indexer in [DSA](https://huggingface.co/deepseek-ai/DeepSeek-V3.2-Exp), we introduce LongCat Sparse Attention (LSA). LSA features three orthogonal improvements:
67
+
68
+ - Streaming-aware Indexing (SI) reshapes the token selection budget to combine hardware-aligned contiguous access with dynamic random selection. This turns fragmented memory access into predictable sequential reads, achieving coalesced HBM access and high effective bandwidth.
69
+ - Cross-Layer Indexing (CLI) leverages the empirical stability of attention saliency across adjacent layers to amortize indexing cost: a single indexing pass serves several consecutive layers at inference time, made possible by cross-layer distillation during training.
70
+ - Hierarchical Indexing (HI) uses a coarse-to-fine, two-stage scoring scheme — first a coarse recall via block-level approximate scoring, then fine-grained token selection within the recalled candidates — shrinking the candidate space the indexer must process per query.
71
+
72
+ All strategies seamlessly extend to the 3-step Multi-Token Prediction module for speculative decoding. For CLI, the target model shares an index every 2 layers, while all 3 MTP draft steps share a single pass.
73
+
74
+ #### 🌟 N-gram Embedding
75
+ LongCat-2.0 inherits N-gram Embedding from [LongCat-Flash-Lite](https://huggingface.co/meituan-longcat/LongCat-Flash-Lite), improving parameter utilization efficiency by expanding parameters in sparse dimensions orthogonal to MoE. 135B N-gram Embedding parameters are included in the model, which adheres to the following scaling principles:
76
+
77
+ - The sparsity of MoE has crossed the sweet spot.
78
+ - The proportion of N-gram Embedding is constrained within an optimal range.
79
+
80
+ These two principles guarantee the robust superiority of N-gram Embedding compared to equivalent-sized pure MoE models.
81
+
82
+ **For more details please refer to our [blog](https://longcat.chat/blog/longcat-2.0/).**
83
+
84
+ ## Evaluation Results
85
+ We evaluate LongCat-2.0 against leading proprietary models across agentic, coding, search, productivity and foundational capabilities. Unless noted with `*`, all scores are measured in-house under a unified harness.
86
+
87
+ <table>
88
+ <thead>
89
+ <tr>
90
+ <th align="center"><div align="center">Benchmark</div></th>
91
+ <th align="center"><div align="center">LongCat-2.0</div></th>
92
+ <th align="center"><div align="center">Gemini 3.1 Pro</div></th>
93
+ <th align="center"><div align="center">GPT-5.5</div></th>
94
+ <th align="center"><div align="center">Claude Opus 4.6</div></th>
95
+ <th align="center"><div align="center">Claude Opus 4.7</div></th>
96
+ <th align="center"><div align="center">Claude Opus 4.8</div></th>
97
+ </tr>
98
+ </thead>
99
+ <tbody>
100
+ <tr><td colspan="7"><div align="center"><strong>Code Agent</strong></div></td></tr>
101
+ <tr>
102
+ <td align="center"><div align="center">Terminal-Bench 2.1</div></td>
103
+ <td align="center"><div align="center">70.8</div></td>
104
+ <td align="center"><div align="center">70.7*</div></td>
105
+ <td align="center"><div align="center">73.8*</div></td>
106
+ <td align="center"><div align="center">-</div></td>
107
+ <td align="center"><div align="center">71.7*</div></td>
108
+ <td align="center"><div align="center">78.9*</div></td>
109
+ </tr>
110
+ <tr>
111
+ <td align="center"><div align="center">SWE-bench Pro</div></td>
112
+ <td align="center"><div align="center">59.5</div></td>
113
+ <td align="center"><div align="center">54.2*</div></td>
114
+ <td align="center"><div align="center">58.6*</div></td>
115
+ <td align="center"><div align="center">57.3*</div></td>
116
+ <td align="center"><div align="center">64.3*</div></td>
117
+ <td align="center"><div align="center">69.2*</div></td>
118
+ </tr>
119
+ <tr>
120
+ <td align="center"><div align="center">SWE-bench Multilingual</div></td>
121
+ <td align="center"><div align="center">77.3</div></td>
122
+ <td align="center"><div align="center">76.9*</div></td>
123
+ <td align="center"><div align="center">-</div></td>
124
+ <td align="center"><div align="center">77.8*</div></td>
125
+ <td align="center"><div align="center">80.5*</div></td>
126
+ <td align="center"><div align="center">84.8*</div></td>
127
+ </tr>
128
+ <tr><td colspan="7"><div align="center"><strong>General Agent</strong></div></td></tr>
129
+ <tr>
130
+ <td align="center"><div align="center">FORTE <a href="https://github.com/AGI-Eval-Official/FORTE">↗</a></div></td>
131
+ <td align="center"><div align="center">73.2</div></td>
132
+ <td align="center"><div align="center">70.3</div></td>
133
+ <td align="center"><div align="center">77.8</div></td>
134
+ <td align="center"><div align="center">73.2</div></td>
135
+ <td align="center"><div align="center">77.6</div></td>
136
+ <td align="center"><div align="center">77.2</div></td>
137
+ </tr>
138
+ <tr>
139
+ <td align="center"><div align="center">BrowseComp</div></td>
140
+ <td align="center"><div align="center">79.9</div></td>
141
+ <td align="center"><div align="center">85.9*</div></td>
142
+ <td align="center"><div align="center">84.4*</div></td>
143
+ <td align="center"><div align="center">84.0*</div></td>
144
+ <td align="center"><div align="center">79.3*</div></td>
145
+ <td align="center"><div align="center">84.3*</div></td>
146
+ </tr>
147
+ <tr>
148
+ <td align="center"><div align="center">RWSearch <a href="https://github.com/AGI-Eval-Official/RW-Search">↗</a></div></td>
149
+ <td align="center"><div align="center">78.8</div></td>
150
+ <td align="center"><div align="center">76.3</div></td>
151
+ <td align="center"><div align="center">85.3</div></td>
152
+ <td align="center"><div align="center">81.3</div></td>
153
+ <td align="center"><div align="center">79.3</div></td>
154
+ <td align="center"><div align="center">77.3</div></td>
155
+ </tr>
156
+ <tr><td colspan="7"><div align="center"><strong>Foundational</strong></div></td></tr>
157
+ <tr>
158
+ <td align="center"><div align="center">IFEval</div></td>
159
+ <td align="center"><div align="center">90.0</div></td>
160
+ <td align="center"><div align="center">96.1</div></td>
161
+ <td align="center"><div align="center">95.0</div></td>
162
+ <td align="center"><div align="center">92.2</div></td>
163
+ <td align="center"><div align="center">88.7</div></td>
164
+ <td align="center"><div align="center">86.0</div></td>
165
+ </tr>
166
+ <tr>
167
+ <td align="center"><div align="center">Writing Bench</div></td>
168
+ <td align="center"><div align="center">83.8</div></td>
169
+ <td align="center"><div align="center">83.7</div></td>
170
+ <td align="center"><div align="center">84.7</div></td>
171
+ <td align="center"><div align="center">-</div></td>
172
+ <td align="center"><div align="center">85.3</div></td>
173
+ <td align="center"><div align="center">85.2</div></td>
174
+ </tr>
175
+ <tr>
176
+ <td align="center"><div align="center">IMO-AnswerBench</div></td>
177
+ <td align="center"><div align="center">81.8</div></td>
178
+ <td align="center"><div align="center">90.0</div></td>
179
+ <td align="center"><div align="center">79.5</div></td>
180
+ <td align="center"><div align="center">75.3*</div></td>
181
+ <td align="center"><div align="center">81.8</div></td>
182
+ <td align="center"><div align="center">75.3</div></td>
183
+ </tr>
184
+ <tr>
185
+ <td align="center"><div align="center">GPQA-diamond</div></td>
186
+ <td align="center"><div align="center">88.9</div></td>
187
+ <td align="center"><div align="center">94.3*</div></td>
188
+ <td align="center"><div align="center">93.6*</div></td>
189
+ <td align="center"><div align="center">91.3*</div></td>
190
+ <td align="center"><div align="center">94.2*</div></td>
191
+ <td align="center"><div align="center">92.4</div></td>
192
+ </tr>
193
+ </tbody>
194
+ </table>
195
+
196
+ Notes: `*` — cited from the model's official report; `-` — no comparable public score.
197
+
198
+ ## Chat Website
199
+ You can chat with LongCat-2.0 on our official website: [https://longcat.ai/](https://longcat.ai/).
200
+
201
+ ## Deployment
202
+
203
+ LongCat-2.0 can be deployed on both **GPU** and **NPU** platforms.
204
+
205
+ ### GPU
206
+
207
+ We have implemented adaptations in SGLang ([PR](https://github.com/sgl-project/sglang/pull/30042)) to support the deployment of LongCat-2.0. Hierarchical indexing is not supported for simplicity.
208
+
209
+ We recommend deploying with 16x H20 using a combination of Tensor Parallelism and Expert Parallelism.
210
+
211
+ Compile and update sgl-kernel first.
212
+
213
+ ```shell
214
+ cd sgl-kernel
215
+ python3 -m uv build --wheel --color=always --no-build-isolation \
216
+ -Ccmake.define.SGL_KERNEL_ENABLE_SM90A=1 \
217
+ -Ccmake.define.CMAKE_POLICY_VERSION_MINIMUM=3.5 \
218
+ -Cbuild-dir=build .
219
+ pip3 install dist/sgl_kernel-0.3.21-cp310-abi3-linux_x86_64.whl --force-reinstall
220
+ ```
221
+
222
+ Then launch the server.
223
+
224
+ ```py
225
+ python -m sglang.launch_server \
226
+ --model meituan-longcat/LongCat-2.0-FP8 \
227
+ --trust-remote-code \
228
+ --host 0.0.0.0 \
229
+ --port 13423 \
230
+ --tp 16 \
231
+ --ep 16 \
232
+ --max-running-requests 64 \
233
+ --mem-fraction-static 0.92 \
234
+ --chunked-prefill-size 2048 \
235
+ --nsa-prefill-backend fa3 \
236
+ --kv-cache-dtype bfloat16 \
237
+ --nnodes 2 \
238
+ --node-rank 0 \
239
+ --dist-init-addr 33.32.48.42:20000 \
240
+ 2>&1 | tee sgl.log
241
+ ```
242
+
243
+ ### NPU
244
+
245
+ For NPU deployment, please refer to [SGLang-FluentLLM](https://github.com/meituan-longcat/SGLang-FluentLLM/blob/npu/npu_test/ReadMe.md).
246
+
247
+ ## Chat Template
248
+
249
+ We provide a chat template for LongCat-2.0 in the `tokenizer_config.json` file, which can be used to encode a list of messages into a single string for model input.
250
+
251
+ Here is a brief example of how to use the template:
252
+
253
+ ```python
254
+ from transformers import AutoTokenizer
255
+
256
+ tokenizer = AutoTokenizer.from_pretrained("meituan-longcat/LongCat-2.0", trust_remote_code=True)
257
+
258
+ tools = [
259
+ {
260
+ "type": "function",
261
+ "function": {
262
+ "name": "func_add",
263
+ "description": "Calculate the sum of two numbers",
264
+ "parameters": {
265
+ "type": "object",
266
+ "properties": {
267
+ "x1": {"type": "number", "description": "The first number to add"},
268
+ "x2": {"type": "number", "description": "The second number to add"},
269
+ },
270
+ "required": ["x1", "x2"],
271
+ },
272
+ },
273
+ },
274
+ {
275
+ "type": "function",
276
+ "function": {
277
+ "name": "func_multiply",
278
+ "description": "Calculate the product of two numbers",
279
+ "parameters": {
280
+ "type": "object",
281
+ "properties": {
282
+ "x1": {"type": "number", "description": "The first number to multiply"},
283
+ "x2": {"type": "number", "description": "The second number to multiply"},
284
+ },
285
+ "required": ["x1", "x2"],
286
+ },
287
+ },
288
+ },
289
+ ]
290
+
291
+ messages = [
292
+ {"role": "system", "content": "You are a helpful assistant."},
293
+ {"role": "user", "content": "Calculate 1+1"},
294
+ {
295
+ "role": "assistant",
296
+ "reasoning_content": "Calling func_add to calculate 1+1",
297
+ # Note: unlike the standard OpenAI format, we expect `arguments` to be a dict rather than a string.
298
+ "tool_calls": [
299
+ {"type": "function", "function": {"name": "func_add", "arguments": {"x1": 1, "x2": 1}}},
300
+ ],
301
+ },
302
+ {"role": "tool", "name": "func_add", "content": '{"ans": 2}'},
303
+ {"role": "assistant", "reasoning_content": "The result is 2", "content": "2"},
304
+ {"role": "user", "content": "Check your answer, is it correct?"},
305
+ ]
306
+
307
+ # thinking mode on
308
+ prompt_think = tokenizer.apply_chat_template(
309
+ messages,
310
+ tools=tools,
311
+ tokenize=False,
312
+ enable_thinking=True,
313
+ add_generation_prompt=True
314
+ )
315
+
316
+ # thinking mode on, keeping all reasoning content for better performance
317
+ prompt_full = tokenizer.apply_chat_template(
318
+ messages,
319
+ tools=tools,
320
+ tokenize=False,
321
+ enable_thinking=True,
322
+ add_generation_prompt=True,
323
+ save_reasoning_content=True
324
+ )
325
+
326
+ # thinking mode off, for better token efficiency
327
+ prompt_no_think = tokenizer.apply_chat_template(
328
+ messages,
329
+ tools=tools,
330
+ tokenize=False,
331
+ enable_thinking=False,
332
+ add_generation_prompt=True
333
+ )
334
+ ```
335
+
336
+ ## License Agreement
337
+
338
+ The **model weights** are released under the **MIT License**.
339
+
340
+ Any contributions to this repository are licensed under the MIT License, unless otherwise stated. This license does not grant any rights to use Meituan trademarks or patents.
341
+
342
+ See the [LICENSE](LICENSE) file for the full license text.
343
+
344
+ ## Usage Considerations
345
+ This model has not been specifically designed or comprehensively evaluated for every possible downstream application.
346
+
347
+ Developers should take into account the known limitations of large language models, including performance variations across different languages, and carefully assess accuracy, safety, and fairness before deploying the model in sensitive or high-risk scenarios.
348
+ It is the responsibility of developers and downstream users to understand and comply with all applicable laws and regulations relevant to their use case, including but not limited to data protection, privacy, and content safety requirements.
349
+
350
+ Nothing in this Model Card should be interpreted as altering or restricting the terms of the MIT License under which the model is released.
351
+
352
+ ## Contact
353
+ Please contact us at <a href="mailto:longcat-team@meituan.com">longcat-team@meituan.com</a> or open an issue if you have any questions.
354
+
355
+ ---
figures/longcat-pro-benchmark-charts-2026-06-29.svg ADDED
figures/longcat_logo.svg ADDED
figures/wechat_official_accounts.png ADDED