← 返回
内容创作 Key 中文

Smart Router

Intelligent multi-model router — automatically selects the best AI model based on task type (vision, image generation, video generation, audio, reasoning, co...
智能多模型路由器 —— 根据任务类型(视觉、图像生成、视频生成、音频、推理等)自动选择最佳AI模型。
samstone908
内容创作 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 776
下载
💾 45
安装
1
版本
#latest

概述

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

AliasModel IDCategory
---------------------------
Vision
@gpt4ochatgpt-4o-latestvision
@qwen-vlqwen3-vl-235b-a22b-instructvision
@qwen-vl-maxqwen-vl-max-2025-08-13vision
@llama-vlllama-3.2-90b-vision-instructvision
@qwen-vl-32bqwen3-vl-32b-instructvision
Image Gen
@imagengoogle/imagen-4-ultraimage_gen
@fluxblack-forest-labs/flux-1.1-pro-ultraimage_gen
@flux-kontextblack-forest-labs/flux-kontext-maximage_gen
@dalledall-e-3image_gen
@flux2flux-2-proimage_gen
Video Gen
@sorasora-2-pro-allvideo_gen
@veoveo3.1-pro-4kvideo_gen
@viduviduq3-provideo_gen
@klingkling-videovideo_gen
@runwayrunwayml-gen4_turbo-10video_gen
Audio
@sunosuno_musicaudio
@ttsgemini-2.5-pro-preview-ttsaudio
@tts-hdtts-1-hdaudio
@kling-audiokling-audioaudio
@vidu-ttsvidu-ttsaudio
Reasoning
@o3o3reasoning
@o3-proo3-proreasoning
@o4-minio4-minireasoning
@deepseekdeepseek-r1reasoning
@gemini-thinkgemini-2.5-pro-thinkingreasoning
@claude-thinkclaude-sonnet-4-5-20250929-thinkingreasoning
Code
@claudeclaude-opus-4-6code
@codexgpt-5.1-codex-maxcode
@claude-sonnetclaude-sonnet-4-6code
@qwen-coderqwen3-coder-480b-a35b-instructcode
@qwen-coder-plusqwen3-coder-pluscode
@gpt4tgpt-4-turbocode
General
@gpt52 / @gpt5gpt-5.2-chat-latestgeneral
@geminigemini-2.5-progeneral
@deepseekv3deepseek-v3.2general
@qwenqwen3-maxgeneral
@claude-chatclaude-opus-4-6general

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:

CategoryTrigger
-------------------
visionUser sends image/URL, asks to analyze, describe, OCR, understand image content
image_genRequests to draw, generate image, design poster, create illustration
video_genRequests to generate video, animation, text-to-video, image-to-video
audioRequests for music generation, TTS, sound effects
reasoningComplex math, logic puzzles, proofs, deep analysis, long-chain reasoning
codeCode generation, debugging, refactoring, review (when external model needed)
generalEveryday 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 个版本

  • v1.0.0 当前
    2026-03-29 21:16 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,662
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,173
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,464