Task Router v4
Query classifier for AI agents
2 min readupdated
Task Router v4 is a 322-million-parameter model built to answer ten questions about an incoming prompt in a single pass for multi-agent systems. It determines task type, complexity, required tools, and the right executor to route prompts inside the PugPort desktop app. Built on the mmBERT-base (ModernBERT) encoder using the Laya framework, it supports both English and Chinese. This release is ideal for multi-agent system developers who need fast, efficient on-the-fly query classification.
Key features
- 322M parameters: A compact classifier based on mmBERT-base with ten specialized decision heads.
- Ten questions per pass: Identifies task type, complexity, required tools (web search, document reading, etc.), modality, and executor.
- Synthetic training: Trained on the pugport-routing-synthetic-v1 dataset using soft cross-entropy.
- Laya framework: Fully compatible with the Laya library for easy loading and service deployment.
What you can do
- Deploy a local microservice: Spin up a REST API using the provided script to classify prompts.
- Route tasks: Distribute incoming user prompts across agents in multi-agent setups.
- Set up integrations: Use the OpenAPI specification to connect the router to existing desktop apps.
Example
git clone [https://github.com/Waytrine/task-router.git](https://github.com/Waytrine/task-router.git) && cd task-router
python -m pip install -r service/requirements.txt
python -c "from huggingface_hub import snapshot_download as d; d('Waytrine/task-router', local_dir='models/task-router-v4')"
TASK_ROUTER_CHECKPOINT=models/task-router-v4 TASK_ROUTER_DEVICE=cpu python service/app.pyRead more
DetailsArchitecture: Laya on jhu-clsp/mmBERT-base encoder (22 layers, hidden size 768)
Parameters: 321,908,998, saved in FP16
Accuracy: 72.0% on 30 held-out real-world prompts
Limitations: Small real-world test sample, synthetic-to-real data gap










Comments