Instructions to use Flubstar/LongCat-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Flubstar/LongCat-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Flubstar/LongCat-2.0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import LongcatCausalLM model = LongcatCausalLM.from_pretrained("Flubstar/LongCat-2.0", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Flubstar/LongCat-2.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Flubstar/LongCat-2.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Flubstar/LongCat-2.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Flubstar/LongCat-2.0
- SGLang
How to use Flubstar/LongCat-2.0 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 "Flubstar/LongCat-2.0" \ --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": "Flubstar/LongCat-2.0", "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 "Flubstar/LongCat-2.0" \ --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": "Flubstar/LongCat-2.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Flubstar/LongCat-2.0 with Docker Model Runner:
docker model run hf.co/Flubstar/LongCat-2.0
| { | |
| "architectures": [ | |
| "LongcatCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "vocab_size": 163840, | |
| "hidden_size": 8192, | |
| "ffn_hidden_size": 12288, | |
| "expert_ffn_hidden_size": 2048, | |
| "num_layers": 38, | |
| "num_attention_heads": 64, | |
| "kv_lora_rank": 512, | |
| "q_lora_rank": 1536, | |
| "qk_rope_head_dim": 64, | |
| "v_head_dim": 128, | |
| "qk_nope_head_dim": 128, | |
| "mla_scale_q_lora": true, | |
| "mla_scale_kv_lora": true, | |
| "routed_scaling_factor": 9, | |
| "n_routed_experts": 768, | |
| "max_position_embeddings": 262144, | |
| "rms_norm_eps": 1e-5, | |
| "use_cache": true, | |
| "bos_token_id": 1, | |
| "eos_token_id": 2, | |
| "rope_theta": 1000000.0, | |
| "rope_scaling": { | |
| "original_max_position_embeddings": 8192, | |
| "rope_type": "deepseek_yarn", | |
| "factor": 120, | |
| "beta_fast": 32, | |
| "beta_slow": 1, | |
| "mscale": 1, | |
| "mscale_all_dim": 1 | |
| }, | |
| "attention_method": "MLA", | |
| "zero_expert_num": 128, | |
| "zero_expert_type": "identity", | |
| "moe_topk": 12, | |
| "use_mla": 1, | |
| "moe_switch_token_num": 1024, | |
| "moe_impl": "mix", | |
| "oe_vocab_size_ratio": 100.567, | |
| "oe_neighbor_num": 5, | |
| "oe_split_num": 4, | |
| "mtp_num_layers": 3, | |
| "mtp_replicate_modules": true, | |
| "mtp_disable_over_tokenizer": true, | |
| "index_n_heads": 32, | |
| "index_head_dim": 128, | |
| "index_topk": 2048, | |
| "index_k_norm_type": "rms", | |
| "cli_factor": 2, | |
| "dsa_mtp_cli": true, | |
| "index_local_tokens": 1024, | |
| "index_init_tokens": 16 | |
| } | |