File size: 2,154 Bytes
0355487 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | ---
language:
- en
license: apache-2.0
library_name: transformers
tags:
- text-classification
- intent-classification
- query-routing
- agent
- llm-router
pipeline_tag: text-classification
---
# β‘ AgentRouter
Ultra-fast intent classification for LLM query routing. Classifies user queries into 10 intent categories in **<5ms** on GPU.
Built on [MiniLM](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) (33M params) β small enough for CPU inference, fast enough for real-time routing.
## π Usage
```python
from transformers import pipeline
router = pipeline("text-classification", model="ENTUM-AI/AgentRouter")
router("Write a Python function to sort a list")
# [{'label': 'code_generation', 'score': 0.98}]
router("Why am I getting a TypeError?")
# [{'label': 'code_debugging', 'score': 0.97}]
router("Translate hello to Spanish")
# [{'label': 'translation', 'score': 0.99}]
router("What is quantum computing?")
# [{'label': 'information_retrieval', 'score': 0.96}]
```
## π·οΈ Intent Classes
| Intent | Description | Suggested Tools |
|--------|-------------|----------------|
| `code_generation` | Write new code | code_interpreter, file_editor |
| `code_debugging` | Fix bugs and errors | code_interpreter, debugger |
| `math_reasoning` | Solve math problems | calculator, wolfram_alpha |
| `creative_writing` | Write stories, poems, essays | β |
| `summarization` | Summarize text | file_reader |
| `translation` | Translate between languages | translator |
| `information_retrieval` | Answer questions, explain topics | knowledge_base |
| `data_analysis` | Analyze data, create charts | code_interpreter, data_visualizer |
| `web_search` | Search the web for current info | web_browser, search_engine |
| `general_chat` | Casual conversation | β |
## π Use Cases
- **LLM routing** β route queries to specialized models or tools
- **Agent frameworks** β decide which tool to invoke
- **Cost optimization** β use cheap models for simple intents, expensive for complex
- **Latency optimization** β skip heavy pipelines for general chat
## β οΈ Limitations
- English only
- 10 fixed intent categories
|