当前位置: 首页 > Skill >

Smart Router

Smart Router

Smart Router

智能多模型路由器 —— 根据任务类型(视觉、图像生成、视频生成、音频、推理等)自动选择最佳AI模型。

1.0.0 2026.11.13 587
获取Skill文件查看使用说明
作 者:陆安 许可证: 更新时间:2026.11.13
本文目录展开

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.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
PHP集成RabbitMQ实现消息队列的完整步骤

使用 php-amqplib 库,通过建立连接、声明交换机与队列并绑定,即可在 PHP 中实现消息的发送与消费。

2026.05.24 1,001
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,001
Linux内核提权风险待核实,先查版本与补丁

CVE-2026-78901在摘要中被称为Linux内核ext4本地提权漏洞,CVSS评分7.8,但上游正文暂未核实。本文提供通用只读排查命令,帮运维和开发者核对当前运行内核、发行版补丁及升级生效状态。

2026.12.02 1,000
Skill 文件
  • SKILL.md
    • Smart Router — Intelligent Model Router
    • Setup
    • @ Alias Shortcuts
      • Alias Table
    • Auto-Classification Rules
    • Usage
      • 1. Read Model Config
      • 2. Select Model
      • 3. Call Model
        • Chat (vision / reasoning / code / general)
        • Image Generation
        • Async Tasks (video / audio)
        • TTS
      • 4. Return Results
    • Model Recommendations
    • Fallback
    • Customization
  • 项目或源文件

相关 Skill

更多
Swap Integration Swap Integration Integrate PancakeSwap swaps into applications. Use when user says "integrate swaps", "pancakeswap", "smart router", "add swap functionality", "build a swap f...
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...