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 ↗698321-
SkillHub ↗1.9萬25—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

把請求分成低成本、通用與高能力三檔,簡單問答、快速查詢與狀態檢查留在最低檔,需要較多思考時才升級。目標是從便宜的開始、只在必要時升級;源文也提醒不要預設使用最強模型。 分級模型路由僅為建議,不應只為節省成本而降低超出任務要求的品質標準。

資料釋出於 2026-10-27

可以用來做什麼

  • 為日常問答選擇最省的模型方案
  • 判斷某個任務是否需要升級到更強模型

什麼時候用

  • 要控制呼叫成本時
  • 不確定任務該用哪檔模型時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

這個任務需要升級模型嗎,給我判斷依據
幫我把這周的請求按方案分一下類

月度資料趨勢

累計下載1.9萬
56571.3萬2萬2026-03 · 累計下載 78692026-05 · 累計下載 90562026-06 · 累計下載 93172026-07 · 累計下載 66152026-08 · 累計下載 97392026-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-089739+47.2%25
2026-076615-29.0%21
2026-069317+2.9%24
2026-059056—24
2026-037869—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),按月更新。口徑說明見資料方法。