Text Generation
Transformers
Safetensors
Chinese
English
qwen3
conversational
text-generation-inference
Instructions to use tencent/TCAndon-Router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/TCAndon-Router with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/TCAndon-Router") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("tencent/TCAndon-Router") model = AutoModelForMultimodalLM.from_pretrained("tencent/TCAndon-Router") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/TCAndon-Router with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/TCAndon-Router" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/TCAndon-Router", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/TCAndon-Router
- SGLang
How to use tencent/TCAndon-Router 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 "tencent/TCAndon-Router" \ --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": "tencent/TCAndon-Router", "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 "tencent/TCAndon-Router" \ --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": "tencent/TCAndon-Router", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/TCAndon-Router with Docker Model Runner:
docker model run hf.co/tencent/TCAndon-Router
| base_model: | |
| - Qwen/Qwen3-4B-Instruct-2507 | |
| language: | |
| - zh | |
| - en | |
| license: apache-2.0 | |
| metrics: | |
| - accuracy | |
| - f1 | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # TCAndon-Router | |
| <p align="center"> | |
| <img src="https://raw.githubusercontent.com/Tencent/TCAndon-Router/refs/heads/main/assets/router.png" width="500"/> | |
| </p> | |
| <p align="center"> | |
| <a href="https://github.com/Tencent/TCAndon-Router">Github</a> | π <a href="https://arxiv.org/pdf/2601.04544">Paper</a> | |
| </p> | |
| ## π Introduction | |
| In multi-agent systems, the ability to select the appropriate agent(s) to handle a user query is a key determinant of overall system performance. | |
| TCAndonRouter is a reasoning-centric multi-intent routing module whose primary role is to perform agent routing in multi-agent systems. | |
| Beyond agent routing, TCAndonRouter can be applied to any intent-routing scenario, including agent skill selection. | |
| The main advantages of TCAndonRouter include: | |
| + Designed specifically for real-world enterprise applications | |
| + Supports dynamic onboarding of new agents (intents) New agents can be added simply by appending their descriptions, without retraining | |
| + Provides transparent and interpretable routing decisions, improving explainability, robustness, and cross-domain generalization, and making post-deployment bad-case analysis easier | |
| + Effectively resolves agent conflicts caused by overlapping responsibilities, leading to higher-quality final responses. When multiple agents are applicable, TCAndonRouter preserves all relevant agents. Each downstream agent generates its own response, and a Refining Agent subsequently merges these outputs into a single final answer | |
| TCAndonRouter is trained using Supervised Fine-Tuning (SFT) followed by Reinforcement Learning (DAPO), and achieves state-of-the-art performance on large-scale, real-world enterprise datasets, including HWU64, MINDS14, SGD, and the Tencent Cloud ITSM dataset(QCloud). | |
| | **Models** | **CLINC150** | **HWU64** | **MINDS14** | **SGD** | **QCloud** | | |
| |------------------------|--------------|-----------|-------------|-----------|-----------------| | |
| | GPT-5.1 | 93.84 | 85.59 | 95.59 | 73.90 | 92.80/93.06 | | |
| | Claude-Sonnet-4.5 | **94.21** | 87.40 | 96.20 | 76.02 | 88.82/94.25 | | |
| | DeepSeek-v3.1-terminus | 88.29 | 88.10 | 95.72 | 79.70 | 94.09/91.89 | | |
| | ArcRouter | 62.98 | 69.33 | 91.79 | 65.59 | - | | |
| | Qwen3-Embedding-4B | 57.21 | 54.27 | 94.12 | 37.02 | - | | |
| | Qwen3-4B-Instruct-2507 | 70.12 | 80.29 | 90.08 | 58.74 | 82.23/79.44 | | |
| | **TCAndonRouter** | 91.25 | **91.63** | **96.70** | **91.58** | **95.21/92.78** | | |
| ## π§ How to use | |
| Please refer to [GitHub](https://github.com/Tencent/TCAndon-Router) for code usage. | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| from prompt import router_prompt | |
| from utils import load_config | |
| tokenizer = AutoTokenizer.from_pretrained("tencent/TCAndon-Router") | |
| model = AutoModelForCausalLM.from_pretrained("tencent/TCAndon-Router", device_map="auto") | |
| agents = load_config('config/hwu64_config.xml') | |
| query = "Can you recommend any pub in mg road" | |
| prompt = router_prompt.format(agents=agents) + 'user:' + query | |
| messages = [{"role": "user", "content": prompt}] | |
| encoding = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=True, | |
| add_generation_prompt=False, | |
| return_tensors="pt" | |
| ) | |
| outputs = model.generate(encoding.to(model.device), max_new_tokens=2048) | |
| output_text = tokenizer.decode(outputs[0]) | |
| ``` | |
| ### Generate Agent Descriptions | |
| If you want to use TCAndonRouter on your own dataset, you need to provide agent descriptions. The required format is defined in `config/xxx_config.xml`. | |
| You can generate agent descriptions using an LLM via generate_agent_desc.py, or write them manually. | |
| ```shell | |
| python generate_agent_desc.py --dataset hwu64 --limit 50 | |
| ``` | |
| ## π€ Citation | |
| If you use TCAndonRouter in your work, please cite our paper: | |
| ``` | |
| @article{zhao2026TCAndonRouter, | |
| title={TCAndonRouter: Adaptive Reasoning Router for Multi-Agent Collaboration}, | |
| author={Jiuzhou Zhao, Chunrong Chen, Chenqi Qiao, Lebin Zheng, Minqi Han, Yanchi Liu, Yongzhou Xu, Xiaochuan Xu, Min Zhang}, | |
| journal={arXiv preprint:2601.04544}, | |
| year={2026} | |
| } | |
| ``` |