Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
Prompt guide
MediaLongCat Flash Thinking

LongCat-Flash-Thinking-2601: Official Chat Template, Tool Calling, and Reasoning-History Configuration

Original source

Hugging Face

AuthorMeituan LongCat Team / model repository maintainers

Tabbit curation2026-08-19

Read original

One-sentence takeaway

When calling LongCat-Flash-Thinking-2601 locally with Transformers, use the repository's apply_chat_template, explicitly enable thinking, and pass tools as needed instead of hand-writing special tokens.

Use cases

  • Suitable tasks: Local Transformers inference, multi-turn deep reasoning, tool calling, and tool-result injection.

  • Unsuitable tasks: Applying this directly to a third-party API that does not implement this template; the model card does not provide field mappings for general-purpose service providers.

  • Applicable model version: meituan-longcat/LongCat-Flash-Thinking-2601.

  • Applicable client, Agent, or API: Hugging Face Transformers; the model card also mentions SGLang/vLLM, but the code on this page is a local tokenizer/model invocation example.

  • Recommended inference tier and parameters: The official example uses enable_thinking=True, add_generation_prompt=True, and max_new_tokens=32768; no fixed temperature is publicly disclosed, and the high-temperature recommendation for Heavy Thinking applies only to multi-trajectory exploration.

Ready-to-use content

The key invocation structure from the model card is retained below; replace model and tokenizer with locally loaded objects. Tool declarations and message fields must retain the OpenAI-style tools, tool_calls, and reasoning_content structure.

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "meituan-longcat/LongCat-Flash-Thinking-2601"
tokenizer = AutoTokenizer.from_pretrained(model_name)
# model = AutoModelForCausalLM.from_pretrained(model_name, ...)

tools = [{
    "type": "function",
    "function": {
        "name": "func_add",
        "description": "Calculate the sum of two numbers",
        "parameters": {
            "type": "object",
            "properties": {
                "x1": {"type": "number", "description": "The first addend"},
                "x2": {"type": "number", "description": "The second addend"}
            },
            "required": ["x1", "x2"]
        }
    }
}]

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Please tell me what is 125679 + 234519?"},
    {
        "role": "assistant",
        "reasoning_content": "This calculation requires precision; I will use the func_add tool.",
        "tool_calls": [{
            "type": "function",
            "function": {
                "name": "func_add",
                "arguments": {"x1": 125679, "x2": 234519}
            }
        }]
    },
    {"role": "tool", "name": "func_add", "content": '{"ans": 360198}'}
]

text = tokenizer.apply_chat_template(
    messages,
    tools=tools,
    tokenize=False,
    enable_thinking=True,
    add_generation_prompt=True,
    save_history_reasoning_content=False
)

model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
print(tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n"))

Test/workflow steps

  1. Register the tool schema and pass the tool list to apply_chat_template.

  2. Send the user task; when the model returns reasoning_content and tool_calls, execute the real tool using the call arguments.

  3. Append the tool result as a role=tool message, then call the template and model again.

  4. By default, use save_history_reasoning_content=False to discard historical reasoning and save context; switch it to True when historical reasoning must be retained, and monitor context length separately.

Original evidence and data

  • The model card directly provides tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, enable_thinking=True, add_generation_prompt=True, save_history_reasoning_content=False).

  • The official tool example uses func_add, the tool result is {"ans": 360198}, and the example sets the generation limit to max_new_tokens=32768.

  • The model card states that tool declarations appear at the beginning of the conversation; the default interleaved thinking mode retains the final answer and tool trajectory while discarding earlier reasoning.

Applicability boundaries

  • This is the local template for the 2601 weights, not the request format of every hosted API; an API gateway may rewrite reasoning_content or tool fields.

  • A model with 560B total parameters has demanding VRAM, parallelism, and quantization requirements; the code snippet on this page does not promise that it can run on consumer hardware.

  • max_new_tokens=32768 is the official example value, not the optimal value for every task; long reasoning substantially increases cost and latency.

  • The model card does not disclose fixed temperature, top-p, or Heavy Thinking trajectory counts, so no universal parameter set can be inferred from this example.

Source excerpt or observation (short quote for compliance only)

The page explicitly makes retaining reasoning history optional: disable save_history_reasoning_content to save tokens, and enable it when a complete review is needed.

Curated by Tabbit

Prompt material is summarized from public sources and Tabbit editorial notes. Check the original licensing and intended use before copying it.

LongCat Flash Thinking

Use in Tabbit

LongCat Flash Thinking

Related prompts

CommunityGitHub

LongCat-Flash-Thinking-2601: Official SGLang/vLLM Deployment and MTP Configuration

LongCat Flash Thinking

Related reviews

MediaarXiv

LongCat-Flash-Thinking-2601: Heavy Thinking, Environmental Noise, and Agent Benchmarks

MediaLongCat API Platform2025-09-22

LongCat-Flash-Thinking: API Alias Upgrade, Automatic Routing, and Service-Retirement Boundaries

CommunityReddit / r/LocalLLaMA

LongCat-Flash-Thinking-2601: Initial Reading and Deployment Observations from the LocalLLaMA Community