LongCat 2.0 · configuration
The official model card’s chat template and tool-call examples are converted into a local inference configuration check.
Hugging Face weights, tokenizer/template, inference engine, and a no-side-effect tool.
Pin the model version, inputs, and tool permissions; save returns, errors, and acceptance evidence after each round.
Deliver the artifact for “LongCat-2.0 Chat Template and Tool-Calling Configuration (Official Hugging Face Model Card)” and list assumptions not confirmed by the source or inputs.
Run the actual checks and record format, critical paths, tool state, and failed items.
Reproduce the smallest failing case, narrow the input, or fix configuration; do not treat model self-report as evidence.
The official model card’s chat template and tool-call examples are converted into a local inference configuration check.
The model card provides directly reusable chat-template invocation examples: how to enable or disable thinking mode (enable_thinking / save_reasoning_content), the function-calling format (arguments must be a dict rather than a string), and deployment commands for vLLM, SGLang, and Docker.
Suitable tasks: Self-host LongCat-2.0 (on GPU or NPU); correctly construct message sequences with tool calls in Transformers / vLLM / SGLang; control the thinking-mode switch
Unsuitable tasks: Quick trials outside a code environment (use the official web chat at https://longcat.ai or the API instead); quantized deployment instructions (see the separate model cards meituan-longcat/LongCat-2.0-FP8 and LongCat-2.0-INT8 for INT8/FP8)
Applicable model versions: LongCat-2.0 (including the FP8/INT8 quantized versions)
Applicable clients, Agents, or APIs: Transformers (LongcatCausalLM), vLLM, SGLang, Docker Model Runner
Recommended reasoning tier and parameters: The official source describes enabling thinking mode while retaining all reasoning content (enable_thinking=True, save_reasoning_content=True) as "for better performance"; disable thinking (enable_thinking=False) "for better token efficiency"
from transformers import LongcatCausalLM
model = LongcatCausalLM.from_pretrained("meituan-longcat/LongCat-2.0", device_map="auto")pip install vllm
vllm serve "meituan-longcat/LongCat-2.0"
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{"model": "meituan-longcat/LongCat-2.0",
"messages": [{"role": "user", "content": "What is the capital of France?"}]}'pip install sglang
python3 -m sglang.launch_server \
--model-path "meituan-longcat/LongCat-2.0" \
--host 0.0.0.0 \
--port 30000For NPU deployment, see SGLang-FluentLLM; the official source also provides a GPU deployment cookbook (the GitHub repository README points to it).
arguments is a dict)from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("meituan-longcat/LongCat-2.0", trust_remote_code=True)
tools = [
{"type": "function", "function": {
"name": "func_add", "description": "Calculate the sum of two numbers",
"parameters": {"type": "object", "properties": {
"x1": {"type": "number", "description": "The first number to add"},
"x2": {"type": "number", "description": "The second number to add"}},
"required": ["x1", "x2"]}}},
{"type": "function", "function": {
"name": "func_multiply", "description": "Calculate the product of two numbers",
"parameters": {"type": "object", "properties": {
"x1": {"type": "number", "description": "The first number to multiply"},
"x2": {"type": "number", "description": "The second number to multiply"}},
"required": ["x1", "x2"]}}},
]
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Calculate 1+1"},
{"role": "assistant", "reasoning_content": "Calling func_add to calculate 1+1",
# Note: Unlike the standard OpenAI format, the official requirement is for arguments to be a dict rather than a string
"tool_calls": [{"type": "function", "function": {"name": "func_add", "arguments": {"x1": 1, "x2": 1}}}]},
{"role": "tool", "name": "func_add", "content": '{"ans": 2}'},
{"role": "assistant", "reasoning_content": "The result is 2", "content": "2"},
{"role": "user", "content": "Check your answer, is it correct?"},
]
# Thinking mode on (recommended; retain all reasoning content)
prompt_full = tokenizer.apply_chat_template(
messages, tools=tools, tokenize=False,
enable_thinking=True, add_generation_prompt=True, save_reasoning_content=True)
# Thinking mode off (more token-efficient)
prompt_no_think = tokenizer.apply_chat_template(
messages, tools=tools, tokenize=False,
enable_thinking=False, add_generation_prompt=True)Official model card specifications: 1.6T total parameters and approximately 48B active parameters per token (HF metadata shows a model size of 1.8T, including N-gram Embedding and other components); native 1M context; MIT license.
Key features: LongCat Sparse Attention (three orthogonal optimizations, SI/CLI/HI), 3-step MTP speculative decoding, and 135B N-gram Embedding (n-gram size=5).
Community (r/LocalLLaMA) supplement: approximately 3.55TB for full BF16 weights and 2.05TB for FP8; the FP8/INT8 quantized model cards also provide vLLM/SGLang deployment commands.
Training data: 35T+ tokens and more than 50,000 Chinese-made compute chips, with no rollback (according to the official blog).
The self-hosting threshold is high: 3.55TB for full BF16 weights is impractical on personal devices; FP8 (2.05TB) still requires a multi-GPU cluster. The official deployment documentation targets multi-node SGLang (prefill-decode separation and KVP sharding).
The tool-calling format differs from standard OpenAI (arguments is a dict), so custom Agent integrations must adapt to this format; whether the official API and OpenRouter channel are fully consistent is not stated in the model card.
The model card benchmarks are official self-tests (using a unified harness); see the document in the reviews directory for third-party independent verification.
Hugging Face · Source date: 2026-06-30 · Edited: 2026-09-20
Read the original sourceLongCat 2.0
Run this guide in the environment listed above. Downloading does not transfer the template or establish model availability for your account.