Instructions to use tiny-random/longcat-flash-lite-sparse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/longcat-flash-lite-sparse with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/longcat-flash-lite-sparse") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import LongcatCausalLM model = LongcatCausalLM.from_pretrained("tiny-random/longcat-flash-lite-sparse", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/longcat-flash-lite-sparse with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/longcat-flash-lite-sparse" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/longcat-flash-lite-sparse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiny-random/longcat-flash-lite-sparse
- SGLang
How to use tiny-random/longcat-flash-lite-sparse 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 "tiny-random/longcat-flash-lite-sparse" \ --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": "tiny-random/longcat-flash-lite-sparse", "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 "tiny-random/longcat-flash-lite-sparse" \ --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": "tiny-random/longcat-flash-lite-sparse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiny-random/longcat-flash-lite-sparse with Docker Model Runner:
docker model run hf.co/tiny-random/longcat-flash-lite-sparse
This is a randomly initialized tiny model based on meituan-longcat/LongCat-Flash-Lite-Sparse for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 69.11B BF16, 17.26M F32 | 11.72M BF16, 5.76K F32 |
| Safetensors weight files | 138.29 GB (26 files) | 23.53 MB (model.safetensors) |
| Logical layers (attention sublayers) | 14 (28) | 4 (8) |
| Hidden width / dense MLP / expert MLP | 3,072 / 6,144 / 1,024 | 8 / 64 / 32 |
| Q heads / MLA nope-rope-v head dims | 32 / 128-64-128 | 8 / 64-64-128 |
| MLA q-lora / kv-lora rank | 1,536 / 512 | 32 / 256 |
| Routed / identity zero experts, top-k | 256 / 128, 12 | 32 / 128, 12 |
| LSA index heads / head dim / top-k | 16 / 128 / 2,048 | Same |
| CLI factor / local + init tokens | 2 / 1,024 + 16 | Same |
| Over-embedding tables | 12 tables, ~10.22M rows each | 2 tables, ~524k rows |
| MTP/NextN draft layers | 1 (with LSA indexer) | Same |
| Attention / RoPE | LSA + deepseek-yarn, 1M context | Same |
| Vocabulary rows / tying | 131,072 / untied | Same |
| Routers / correction bias | FP32 | Same |
| Stored precision | BF16 | Same |
The source repo ships no model code and no Transformers implementation (config.json has no model_type or auto_map); SGLang recognizes its LongcatCausalLM architecture through its longcat_flash config parser and DSA indexer. The tiny tensors were generated directly against that loader's state-dict schema and key remapping, including the nested model.ngram_embeddings.{embedders,post_projs}.* over-embedding names (newer SGLang also accepts the source checkpoint's flattened oe_embed_tokens*.weight aliases) and the model.mtp.* NextN draft. The n-gram hash modulus is internal embedding machinery rather than an externally visible task space, so it follows the smaller tiny-random/longcat-flash-lite modulus; the 131,072 task vocabulary rows and token ids are unchanged. No local Transformers execution path exists; serve with SGLang (0.5.23.dev384 or newer, which includes LongCat LSA) using the command below.
Example usage
SGLang serving (โ verified)
LSA is implemented in SGLang (main branch; the LongCat Sparse adaptation landed via PR #32918). The checkpoint keeps the source's LongcatCausalLM architecture and serves text only, like the upstream deployment guide.
python3 -m sglang.launch_server \
--trust-remote-code \
--model scratch/longcat-flash-lite-sparse \
--host 0.0.0.0 \
--port 30000 \
--tp-size 4 \
--max-running-requests 64 \
--mem-fraction-static 0.93 \
--chunked-prefill-size 2048 \
--dsa-prefill-backend fa3 \
--kv-cache-dtype bfloat16
curl http://127.0.0.1:30000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"messages": [{"role": "user", "content": "Hello, world!"}], "max_tokens": 16}'
Creating this repo
- Code: .meta/create_model.py
- Model structure: .meta/model.log
- Environment: .meta/env.json
Change log
- 2026-11-03: Initial version. Direct SGLang-schema checkpoint: Transformers has no implementation for the LongCat Sparse Attention (LSA) repo (no model_type/auto_map), so tensors follow the pinned sgl-project/sglang main loader (
longcat_flash.pyplus the DSAIndexer). Four dual-sublayer logical layers (eight attention sublayers) keep the shortcut-MoE topology with 32 routed and 128 weightless identity zero experts at top-k 12, compressed MLA ranks (q 32 / kv 256, the Hopper FA3 compressed-latent q_v kernel floor; the source uses kv 512) with 8 Q heads, 64/64 nope/rope and the source 128 value head dim (qk 128 + v 128 matches the Hopper FA3 MHA/MLA head-dim windows), and LSA indexers with the source 16 heads / head dim 128 on every even physical attention layer (CLI factor 2). One MTP/NextN draft layer with its own indexer is serialized undermodel.mtp.*; over-embeddings use the loader-native nested ngram names and the sibling tiny modulus (ratio 4, 2 x 2 windows) instead of the source 10.2-million-row hash tables.
This repo is generated by GPT-6.1-Sol.
- Downloads last month
- -
Model tree for tiny-random/longcat-flash-lite-sparse
Base model
meituan-longcat/LongCat-Flash-Lite-Sparse