Smart Router — Intelligent Model Router
Route tasks to the best model automatically, via any OpenAI-compatible API.
Author: whatevername2023@proton.me
Setup
Models and provider are configured in models.json. Set two environment variables:
SMART_ROUTER_BASE_URL — OpenAI-compatible API base URL (e.g. https://api.openai.com/v1)
SMART_ROUTER_API_KEY — API key for the provider
Edit models.json to customize categories, models, and defaults for your provider.
@ Alias Shortcuts
Prefix a message with @alias to skip auto-classification and call a specific model directly.
Format: @alias your question or prompt here
Alias Table
| Alias |
Model ID |
Category |
| Vision |
|
|
@gpt4o |
chatgpt-4o-latest |
vision |
@qwen-vl |
qwen3-vl-235b-a22b-instruct |
vision |
@qwen-vl-max |
qwen-vl-max-2025-08-13 |
vision |
@llama-vl |
llama-3.2-90b-vision-instruct |
vision |
@qwen-vl-32b |
qwen3-vl-32b-instruct |
vision |
| Image Gen |
|
|
@imagen |
google/imagen-4-ultra |
image_gen |
@flux |
black-forest-labs/flux-1.1-pro-ultra |
image_gen |
@flux-kontext |
black-forest-labs/flux-kontext-max |
image_gen |
@dalle |
dall-e-3 |
image_gen |
@flux2 |
flux-2-pro |
image_gen |
| Video Gen |
|
|
@sora |
sora-2-pro-all |
video_gen |
@veo |
veo3.1-pro-4k |
video_gen |
@vidu |
viduq3-pro |
video_gen |
@kling |
kling-video |
video_gen |
@runway |
runwayml-gen4_turbo-10 |
video_gen |
| Audio |
|
|
@suno |
suno_music |
audio |
@tts |
gemini-2.5-pro-preview-tts |
audio |
@tts-hd |
tts-1-hd |
audio |
@kling-audio |
kling-audio |
audio |
@vidu-tts |
vidu-tts |
audio |
| Reasoning |
|
|
@o3 |
o3 |
reasoning |
@o3-pro |
o3-pro |
reasoning |
@o4-mini |
o4-mini |
reasoning |
@deepseek |
deepseek-r1 |
reasoning |
@gemini-think |
gemini-2.5-pro-thinking |
reasoning |
@claude-think |
claude-sonnet-4-5-20250929-thinking |
reasoning |
| Code |
|
|
@claude |
claude-opus-4-6 |
code |
@codex |
gpt-5.1-codex-max |
code |
@claude-sonnet |
claude-sonnet-4-6 |
code |
@qwen-coder |
qwen3-coder-480b-a35b-instruct |
code |
@qwen-coder-plus |
qwen3-coder-plus |
code |
@gpt4t |
gpt-4-turbo |
code |
| General |
|
|
@gpt52 / @gpt5 |
gpt-5.2-chat-latest |
general |
@gemini |
gemini-2.5-pro |
general |
@deepseekv3 |
deepseek-v3.2 |
general |
@qwen |
qwen3-max |
general |
@claude-chat |
claude-opus-4-6 |
general |
Aliases are case-insensitive. If no alias matches, attempt fuzzy match on model name/ID. If still no match, prompt the user.
Auto-Classification Rules
When no @alias is specified, classify the task automatically:
| Category |
Trigger |
vision |
User sends image/URL, asks to analyze, describe, OCR, understand image content |
image_gen |
Requests to draw, generate image, design poster, create illustration |
video_gen |
Requests to generate video, animation, text-to-video, image-to-video |
audio |
Requests for music generation, TTS, sound effects |
reasoning |
Complex math, logic puzzles, proofs, deep analysis, long-chain reasoning |
code |
Code generation, debugging, refactoring, review (when external model needed) |
general |
Everyday chat, translation, summarization, writing, Q&A |
Usage
1. Read Model Config
cat "$(dirname "$0")/../models.json"
2. Select Model
- Determine
category based on classification rules above
- Use the first model with
"default": true in each category
- If user specifies a model via
@alias, use that model directly
- For cost-sensitive tasks, pick a smaller model in the same category
3. Call Model
Chat (vision / reasoning / code / general)
scripts/call-model.sh --model "MODEL_ID" --prompt "user request" --type chat
With image (vision):
scripts/call-model.sh --model "MODEL_ID" --prompt "request" --type chat --image "IMAGE_URL"
Image Generation
scripts/call-model.sh --model "MODEL_ID" --prompt "image description" --type image
Async Tasks (video / audio)
scripts/call-model.sh --model "MODEL_ID" --prompt "task description" --type async
TTS
scripts/call-model.sh --model "MODEL_ID" --prompt "text to speak" --type tts --voice alloy
4. Return Results
- Chat: return the model's text reply directly
- Image: return the generated image URL in markdown format
- Video/Audio: return task status and result URL
Model Recommendations
- Vision:
qwen3-vl-235b-a22b-instruct (strongest visual understanding)
- Image gen:
google/imagen-4-ultra (highest quality)
- Video:
sora-2-pro-all (best results)
- Music:
suno_music / TTS: tts-1-hd or gemini-2.5-pro-preview-tts
- Reasoning:
o3 (strongest reasoning)
- Code:
gpt-5.1-codex-max
- General:
claude-opus-4-6
Fallback
If a model call fails, automatically fall back to the next model in the same category.
Customization
Edit models.json to:
- Add/remove models in any category
- Change default models
- Add new categories
- Update aliases in SKILL.md to match
The scripts/sync-models.sh script lists all available models from your provider to help discover new ones.
1---
2name: smart-router
3description: >
4 Intelligent multi-model router — automatically selects the best AI model based on task type
5 (vision, image generation, video generation, audio, reasoning, code, general chat) via any
6 OpenAI-compatible API endpoint. Supports 35+ models across 7 categories with @alias shortcuts.
7 Use when: user sends an image for analysis, requests image/video/audio generation, needs deep
8 reasoning or math proofs, wants to use a specific model, or prefixes message with @alias
9 (e.g. @gpt52, @o3, @sora, @imagen).
10author: whatevername2023@proton.me
11read_when:
12 - User sends an image for analysis or understanding
13 - Requests to generate images, draw, paint, design
14 - Requests to generate video
15 - Requests for music generation, TTS, sound effects
16 - Needs deep reasoning, math proofs, complex logic
17 - Needs code generation, debugging, review (via external model)
18 - Wants to use a specific AI model
19 - User explicitly requests a particular model
20 - Message starts with @alias (e.g. @gpt52, @o3, @sora)
21metadata:
22 source: https://skillmd.com/skills/modbender/smart-router
23 clawdbot:
24 emoji: 🧭
25allowed-tools: Bash(smart-router:*)
26---
27
28# Smart Router — Intelligent Model Router
29
30Route tasks to the best model automatically, via any OpenAI-compatible API.
31
32Author: whatevername2023@proton.me
33
34## Setup
35
36Models and provider are configured in `models.json`. Set two environment variables:
37
38- `SMART_ROUTER_BASE_URL` — OpenAI-compatible API base URL (e.g. `https://api.openai.com/v1`)
39- `SMART_ROUTER_API_KEY` — API key for the provider
40
41Edit `models.json` to customize categories, models, and defaults for your provider.
42
43## @ Alias Shortcuts
44
45Prefix a message with `@alias` to skip auto-classification and call a specific model directly.
46
47Format: `@alias your question or prompt here`
48
49### Alias Table
50
51| Alias | Model ID | Category |
52|-------|----------|----------|
53| **Vision** | | |
54| `@gpt4o` | chatgpt-4o-latest | vision |
55| `@qwen-vl` | qwen3-vl-235b-a22b-instruct | vision |
56| `@qwen-vl-max` | qwen-vl-max-2025-08-13 | vision |
57| `@llama-vl` | llama-3.2-90b-vision-instruct | vision |
58| `@qwen-vl-32b` | qwen3-vl-32b-instruct | vision |
59| **Image Gen** | | |
60| `@imagen` | google/imagen-4-ultra | image_gen |
61| `@flux` | black-forest-labs/flux-1.1-pro-ultra | image_gen |
62| `@flux-kontext` | black-forest-labs/flux-kontext-max | image_gen |
63| `@dalle` | dall-e-3 | image_gen |
64| `@flux2` | flux-2-pro | image_gen |
65| **Video Gen** | | |
66| `@sora` | sora-2-pro-all | video_gen |
67| `@veo` | veo3.1-pro-4k | video_gen |
68| `@vidu` | viduq3-pro | video_gen |
69| `@kling` | kling-video | video_gen |
70| `@runway` | runwayml-gen4_turbo-10 | video_gen |
71| **Audio** | | |
72| `@suno` | suno_music | audio |
73| `@tts` | gemini-2.5-pro-preview-tts | audio |
74| `@tts-hd` | tts-1-hd | audio |
75| `@kling-audio` | kling-audio | audio |
76| `@vidu-tts` | vidu-tts | audio |
77| **Reasoning** | | |
78| `@o3` | o3 | reasoning |
79| `@o3-pro` | o3-pro | reasoning |
80| `@o4-mini` | o4-mini | reasoning |
81| `@deepseek` | deepseek-r1 | reasoning |
82| `@gemini-think` | gemini-2.5-pro-thinking | reasoning |
83| `@claude-think` | claude-sonnet-4-5-20250929-thinking | reasoning |
84| **Code** | | |
85| `@claude` | claude-opus-4-6 | code |
86| `@codex` | gpt-5.1-codex-max | code |
87| `@claude-sonnet` | claude-sonnet-4-6 | code |
88| `@qwen-coder` | qwen3-coder-480b-a35b-instruct | code |
89| `@qwen-coder-plus` | qwen3-coder-plus | code |
90| `@gpt4t` | gpt-4-turbo | code |
91| **General** | | |
92| `@gpt52` / `@gpt5` | gpt-5.2-chat-latest | general |
93| `@gemini` | gemini-2.5-pro | general |
94| `@deepseekv3` | deepseek-v3.2 | general |
95| `@qwen` | qwen3-max | general |
96| `@claude-chat` | claude-opus-4-6 | general |
97
98Aliases are case-insensitive. If no alias matches, attempt fuzzy match on model name/ID. If still no match, prompt the user.
99
100## Auto-Classification Rules
101
102When no `@alias` is specified, classify the task automatically:
103
104| Category | Trigger |
105|----------|---------|
106| `vision` | User sends image/URL, asks to analyze, describe, OCR, understand image content |
107| `image_gen` | Requests to draw, generate image, design poster, create illustration |
108| `video_gen` | Requests to generate video, animation, text-to-video, image-to-video |
109| `audio` | Requests for music generation, TTS, sound effects |
110| `reasoning` | Complex math, logic puzzles, proofs, deep analysis, long-chain reasoning |
111| `code` | Code generation, debugging, refactoring, review (when external model needed) |
112| `general` | Everyday chat, translation, summarization, writing, Q&A |
113
114## Usage
115
116### 1. Read Model Config
117
118```bash
119cat "$(dirname "$0")/../models.json"
120```
121
122### 2. Select Model
123
124- Determine `category` based on classification rules above
125- Use the first model with `"default": true` in each category
126- If user specifies a model via `@alias`, use that model directly
127- For cost-sensitive tasks, pick a smaller model in the same category
128
129### 3. Call Model
130
131#### Chat (vision / reasoning / code / general)
132
133```bash
134scripts/call-model.sh --model "MODEL_ID" --prompt "user request" --type chat
135```
136
137With image (vision):
138
139```bash
140scripts/call-model.sh --model "MODEL_ID" --prompt "request" --type chat --image "IMAGE_URL"
141```
142
143#### Image Generation
144
145```bash
146scripts/call-model.sh --model "MODEL_ID" --prompt "image description" --type image
147```
148
149#### Async Tasks (video / audio)
150
151```bash
152scripts/call-model.sh --model "MODEL_ID" --prompt "task description" --type async
153```
154
155#### TTS
156
157```bash
158scripts/call-model.sh --model "MODEL_ID" --prompt "text to speak" --type tts --voice alloy
159```
160
161### 4. Return Results
162
163- Chat: return the model's text reply directly
164- Image: return the generated image URL in markdown format
165- Video/Audio: return task status and result URL
166
167## Model Recommendations
168
169- Vision: `qwen3-vl-235b-a22b-instruct` (strongest visual understanding)
170- Image gen: `google/imagen-4-ultra` (highest quality)
171- Video: `sora-2-pro-all` (best results)
172- Music: `suno_music` / TTS: `tts-1-hd` or `gemini-2.5-pro-preview-tts`
173- Reasoning: `o3` (strongest reasoning)
174- Code: `gpt-5.1-codex-max`
175- General: `claude-opus-4-6`
176
177## Fallback
178
179If a model call fails, automatically fall back to the next model in the same category.
180
181## Customization
182
183Edit `models.json` to:
184- Add/remove models in any category
185- Change default models
186- Add new categories
187- Update aliases in SKILL.md to match
188
189The `scripts/sync-models.sh` script lists all available models from your provider to help discover new ones.