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, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/TCAndon-Router") model = AutoModelForCausalLM.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
- 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
Create README.md
Browse files# TCAndon-Router
<p align="center">
<img src="https://raw.githubusercontent.com/Tencent/TCAndon-Router/refs/heads/main/assets/router.png?raw=true" width="500"/>
</p>
<p align="center">
<a href="https://github.com/Tencent/TCAndon-Router">Github</a> | 📑 <a href="https://arxiv.org/abs/TCAndonRouter">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 strong performance on large-scale and real-world datasets, including CLINC150, HWU64, MINDS14, SGD, and Tencent Cloud ITSM (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
```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")
agents = load_config('config/hwu64_config.xml')
query = "Can you recommend any pub in mg road"
prompt = router_prompt.format(agents=agents) + 'user:' + query
response = model.generate(prompt)
print(response)
```
## 🤝 Citation
If you use TCAndonRouter in your work, please cite our paper:
```
@article {zhao2025TCAndonRouter,
title={TCAndonRouter: Adaptive Reasoning Router for Multi-Agent Collaboration},
author={Jiuzhou Zhao et al.},
journal={arXiv},
year={2025}
}
```