360 Secure SkillHub
360 安全技能中心

Smart Model Router

面向 OpenClaw 的模型路由 Skill:对每条实质性请求调用本地 Python 脚本按 12 个维度打分,返回 full_id、tier、confidence,再由宿主 session_status 切换模型后作答;跳过问候与极短消息,首次需运行 --setup 生成 models.json,仅依赖 Python 标准库。

bevanding
bevanding
热度 43.22
最近更新 2026-05-11 17:45:37
分类:自动化依赖:代码执行 / 读写文件应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add model-router-pro
Metadata
name
smart-model-router
description
Route every substantive user request to the optimal LLM model. Trigger on EVERY substantive request. Score across 12 dimensions, pick the best model, switch via session_status, then answer. Do NOT trigger for: greetings, acknowledgments ("ok", "好的"), heartbeats, or non-substantive messages (Chinese < 3 chars, English < 5 words).
metadata
{"openclaw":{"configPaths":["~/.openclaw/openclaw.json"],"access":[{"path":"~/.openclaw/openclaw.json","reason":"Reads available model list to filter unavailable models during routing"}]}}

Smart Model Router

Every Substantive Request

  1. Score: python3 <skill_path>/scripts/router.py --task "<user message>"
  2. Parse JSON → get full_id, tier, confidence
  3. If full_id is fallback/default: do NOT switch. Tell the user to run --setup.
  4. If full_id differs from current model: session_status(model=<full_id>)
  5. Answer the user. Do not volunteer routing details, but disclose when asked.

Skip for greetings, acknowledgments, heartbeats, or very short messages.

First-Time Setup

python3 <skill_path>/scripts/router.py --setup

Recommended: Reinforce in AGENTS.md

Add the following line to your agent's AGENTS.md for reliable auto-trigger:

Always follow smart-model-router SKILL.md instructions on every substantive request.

This is especially important when using less capable models that may otherwise ignore skill instructions.

CLI

--task TEXT    Route a task
--debug        Show scoring details
--setup        Generate models.json