millibus

Smart Model Switching

AI 智能体v1.0.0
作者:millibus更新于 2026-05-11smart-model-switching@clawhub_millibus/smart-model-switching
任务自动化工作流编排工具调用#Debugging

据 AlphaMoat 统计,截至 2026-10,Smart Model Switching 累计下载 18,593 次、获 25 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 1,516 位,在「AI 智能体」分类(1,632 个)中排名第 214 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
1.9万
星标
25
全站下载量排名
#1,516
全站前 14% · 「AI 智能体」前 14%
平台累计下载星标评论
ClawHub ↗6,98321-
SkillHub ↗1.9万25—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

把请求分成低成本、通用与高能力三档,简单问答、快速查询与状态检查留在最低档,需要较多思考时才升级。目标是从便宜的开始、只在必要时升级;源文也提醒不要默认使用最强模型。 分档模型路由只是建议,不应仅为节省成本而降低超出任务要求的质量标准。

资料发布于 2026-10-27

可以用来做什么

  • 为日常问答选择最省的模型档位
  • 判断某个任务是否需要升级到更强模型

什么时候用

  • 要控制调用成本时
  • 不确定任务该用哪档模型时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

这个任务需要升级模型吗,给我判断依据
帮我把这周的请求按档位分一下类

月度数据趋势

累计下载1.9万
5,6571.3万2.0万2026-03 · 累计下载 7,8692026-05 · 累计下载 9,0562026-06 · 累计下载 9,3172026-07 · 累计下载 6,6152026-08 · 累计下载 9,7392026-09 · 累计下载 1.1万2026-10 · 累计下载 1.9万26-0326-0926-10
星标25
2123252026-03 · 星标 212026-05 · 星标 242026-06 · 星标 242026-07 · 星标 212026-08 · 星标 252026-09 · 星标 252026-10 · 星标 2526-0326-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-101.9万—25
2026-091.1万—25
2026-089,739+47.2%25
2026-076,615-29.0%21
2026-069,317+2.9%24
2026-059,056—24
2026-037,869—21

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

7.1 KB · ClawHub v1.0.0
---
name: smart-model-switching
description: >-
  Auto-route tasks to the cheapest Claude model that works correctly.
  Three-tier progression: Haiku → Sonnet → Opus. Classify before responding.
  HAIKU (default): factual Q&A, greetings, reminders, status checks, lookups,
  simple file ops, heartbeats, casual chat, 1-2 sentence tasks.
  ESCALATE TO SONNET: code >10 lines, analysis, comparisons, planning, reports,
  multi-step reasoning, tables, long writing >3 paragraphs, summarization,
  research synthesis, most user conversations.
展开全部(共 191 行)
  ESCALATE TO OPUS: architecture decisions, complex debugging, multi-file
  refactoring, strategic planning, nuanced judgment, deep research, critical
  production decisions. Rule: If a human needs >30 seconds of focused thinking,
  escalate. If Sonnet struggles with complexity, go to Opus. Save 50-90% on
  API costs by starting cheap and escalating only when needed.
author: "OpenClaw Community"
version: 1.0.0
homepage: https://clawhub.com
metadata:
  openclaw:
    emoji: "💰"
---

# Smart Model Switching

**Three-tier Claude routing: Haiku → Sonnet → Opus**

Start with the cheapest model. Escalate only when needed. Save 50-90% on API costs.

## The Golden Rule

> If a human would need more than 30 seconds of focused thinking, escalate from Haiku to Sonnet.
> If the task involves architecture, complex tradeoffs, or deep reasoning, escalate to Opus.

## Cost Reality

| Model | Input | Output | Relative Cost |
|-------|-------|--------|---------------|
| Haiku | \$0.25/M | \$1.25/M | 1x (baseline) |
| Sonnet | \$3.00/M | \$15.00/M | 12x |
| Opus | \$15.00/M | \$75.00/M | 60x |

**Bottom line:** Wrong model selection wastes money OR time. Haiku for simple, Sonnet for standard, Opus for complex.

---

## 💚 HAIKU — Default for Simple Tasks

**Stay on Haiku for:**
- Factual Q&A — "what is X", "who is Y", "when did Z"
- Quick lookups — definitions, unit conversions, short translations
- Status checks — calendar, file reads, session monitoring
- Heartbeats — periodic checks, HEARTBEAT_OK responses
- Memory & reminders — "remember this", "remind me to..."
- Casual conversation — greetings, small talk, acknowledgments
- Simple file ops — read, list, basic writes
- One-liner tasks — anything answerable in 1-2 sentences

### NEVER do these on Haiku
- ❌ Write code longer than 10 lines
- ❌ Create comparison tables
- ❌ Write more than 3 paragraphs
- ❌ Do multi-step analysis
- ❌ Write reports or proposals

---

## 💛 SONNET — Standard Work (The Workhorse)

**Escalate to Sonnet for:**

### Code & Technical
- Code generation — write functions, build features, scripts
- Code review — PR reviews, quality checks
- Debugging — standard bug investigation
- Documentation — README, comments, user guides

### Analysis & Planning  
- Analysis & evaluation — compare options, assess trade-offs
- Planning — project plans, roadmaps, task breakdowns
- Research synthesis — combining multiple sources
- Multi-step reasoning — "first... then... finally"

### Writing & Content
- Long-form writing — reports, proposals, articles (>3 paragraphs)
- Creative writing — blog posts, descriptions, copy
- Summarization — long documents, transcripts
- Structured output — tables, outlines, formatted docs

---

## ❤️ OPUS — Complex Reasoning Only

**Escalate to Opus for:**

### Architecture & Design
- System architecture decisions
- Major codebase refactoring
- Design pattern selection with tradeoffs
- Database schema design

### Deep Analysis
- Complex debugging (multi-file, race conditions)
- Security reviews
- Performance optimization strategy
- Root cause analysis of subtle bugs

### Strategic & Creative
- Strategic planning — business decisions, roadmaps
- Nuanced judgment — ethics, ambiguity, competing values
- Deep research — comprehensive multi-source analysis

---

## 🔄 Implementation

### For Subagents
\`\`\`javascript
// Routine monitoring
sessions_spawn(task="Check backup status", model="haiku")

// Standard code work  
sessions_spawn(task="Build the REST API endpoint", model="sonnet")

// Architecture decisions
sessions_spawn(task="Design the database schema for multi-tenancy", model="opus")
\`\`\`

### For Cron Jobs
\`\`\`json
{
  "payload": {
    "kind": "agentTurn",
    "model": "haiku"
  }
}
\`\`\`
Always use Haiku for cron unless the task genuinely needs reasoning.

---

## 📊 Quick Decision Tree

\`\`\`
Is it a greeting, lookup, status check, or 1-2 sentence answer?
  YES → HAIKU
  NO ↓

Is it code, analysis, planning, writing, or multi-step?
  YES → SONNET  
  NO ↓

Is it architecture, deep reasoning, or critical decision?
  YES → OPUS
  NO → Default to SONNET, escalate if struggling
\`\`\`

---

## 📋 Quick Reference Card

\`\`\`
┌─────────────────────────────────────────────────────────────┐
│                  SMART MODEL SWITCHING                      │
│                  Haiku → Sonnet → Opus                      │
├─────────────────────────────────────────────────────────────┤
│  💚 HAIKU (cheapest)                                        │
│  • Greetings, status checks, quick lookups                  │
│  • Factual Q&A, definitions, reminders                      │
│  • Simple file ops, 1-2 sentence answers                    │
├─────────────────────────────────────────────────────────────┤
│  💛 SONNET (standard)                                       │
│  • Code > 10 lines, debugging                               │
│  • Analysis, comparisons, planning                          │
│  • Reports, proposals, long writing                         │
├─────────────────────────────────────────────────────────────┤
│  ❤️ OPUS (complex)                                          │
│  • Architecture decisions                                   │
│  • Complex debugging, multi-file refactoring                │
│  • Strategic planning, deep research                        │
├─────────────────────────────────────────────────────────────┤
│  💡 RULE: If a human needs > 30 sec thinking → escalate     │
│  💰 COST: Haiku 1x → Sonnet 12x → Opus 60x                  │
└─────────────────────────────────────────────────────────────┘
\`\`\`

---

*Built for Claude-only setups with Haiku, Sonnet, and Opus.*
*Inspired by save-money skill, extended with three-tier progression.*

「AI 智能体」分类下的热门技能

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。