当前位置: 首页 > Skill >

SwitchBoard

SwitchBoard

SwitchBoard

根据任务复杂度将任务路由至合适的模型,以优化AI代理运营成本。使用时机:(1)决定任务使用哪个模型时...

1.0.2 2026.11.25 583
获取Skill文件查看使用说明
作 者:江景 许可证: 更新时间:2026.11.25
本文目录展开

SwitchBoard

Route tasks to the cheapest model that can handle them. Most agent work is routine.

Prerequisites

This skill requires an OpenRouter API key for model routing. Add it to your OpenClaw user config:

// ~/.openclaw/openclaw.json
{
  "openrouter_api_key": "sk-or-v1-..."
}

Without this key, /model switching and sessions_spawn with non-default models will fail. Get a key at openrouter.ai/keys.

Privacy Note: Some models listed in this skill (e.g., Aurora Alpha, Free Router) may log prompts and completions for provider training. Do not route sensitive data (API keys, passwords, private PII) through free or unmoderated models. Review model privacy policies at openrouter.ai/docs before use.

Core Principle

80% of agent tasks are janitorial. File reads, status checks, formatting, simple Q&A. These don't need expensive models. Reserve premium models for problems that actually require deep reasoning.

Model Tiers

For OpenRouter-specific pricing and models, see references/openrouter-models.md.

Tier 0: Free

Model Context Tools Best For
Aurora Alpha 128K ✅ Zero-cost reasoning, cloaked community model
Free Router 200K ✅ Auto-routes to best available free model
Step 3.5 Flash (free) 256K ✅ Long-context reasoning at zero cost

Free models have rate limits and variable availability. Good for non-critical background tasks.

Tier 1: Cheap ($0.02-0.50/M tokens)

Model Input Output Context Tools Best For
Qwen3 Coder Next $0.07 $0.30 262K ✅ Agentic coding, MoE 80B/3B active
Gemini 2.0 Flash Lite $0.07 $0.30 1M ✅ High volume, massive context
Gemini 2.0 Flash $0.10 $0.40 1M ✅ General routine with long context
GPT-4o-mini $0.15 $0.60 128K ✅ Quick responses, reliable tool use
DeepSeek Chat $0.30 $1.20 164K ✅ General routine work
Claude 3 Haiku $0.25 $1.25 200K ✅ Fast tool use, structured output
Kimi K2.5 $0.45 $2.20 262K ✅ Multimodal, visual coding, agentic

Tier 2: Mid ($1-5/M tokens)

Model Input Output Context Tools Best For
o3-mini $1.10 $4.40 200K ✅ Reasoning on a budget
Gemini 2.5 Pro $1.25 $10.00 1M ✅ Long context, large codebase work
GPT-4o $2.50 $10.00 128K ✅ Multimodal tasks
Claude Sonnet $3.00 $15.00 1M ✅ Balanced performance, agentic

Tier 3: Premium ($5+/M tokens)

Model Input Output Context Tools Best For
Claude Opus 4.6 $5.00 $25.00 1M ✅ Complex reasoning, deep context
o1 $15.00 $60.00 200K ✅ Multi-step reasoning
GPT-4.5 $75.00 $150.00 128K ✅ Frontier tasks

Prices as of Feb 2026. Check provider docs for current rates. Context = max context window. Tools = function calling support.

Task Classification

Before executing any task, classify it:

ROUTINE → Use Tier 1

Characteristics:

  • Single-step operations
  • Clear, unambiguous instructions
  • No judgment required
  • Deterministic output expected

Examples:

  • File read/write operations
  • Status checks and health monitoring
  • Simple lookups (time, weather, definitions)
  • Formatting and restructuring text
  • List operations (filter, sort, transform)
  • API calls with known parameters
  • Heartbeat and cron tasks
  • URL fetching and basic parsing

MODERATE → Use Tier 2

Characteristics:

  • Multi-step but well-defined
  • Some synthesis required
  • Standard patterns apply
  • Quality matters but isn't critical

Examples:

  • Code generation (standard patterns)
  • Summarization and synthesis
  • Draft writing (emails, docs, messages)
  • Data analysis and transformation
  • Multi-file operations
  • Tool orchestration
  • Code review (non-security)
  • Search and research tasks

COMPLEX → Use Tier 3

Characteristics:

  • Novel problem solving required
  • Multiple valid approaches
  • Nuanced judgment calls
  • High stakes or irreversible
  • Previous attempts failed

Examples:

  • Multi-step debugging
  • Architecture and design decisions
  • Security-sensitive code review
  • Tasks where cheaper model already failed
  • Ambiguous requirements needing interpretation
  • Long-context reasoning (>50K tokens)
  • Creative work requiring originality
  • Adversarial or edge-case handling

Decision Algorithm

function selectModel(task):
  # Rule 1: Escalation override
  if task.previousAttemptFailed:
    return nextTierUp(task.previousModel)

  # Rule 2: Hard constraints (filter before cost)
  candidates = ALL_MODELS
  if task.requiresToolUse:
    candidates = candidates.filter(m => m.supportsTools)
  if task.estimatedTokens > 128_000:
    candidates = candidates.filter(m => m.contextWindow >= task.estimatedTokens)
  if task.requiresMultimodal:
    candidates = candidates.filter(m => m.supportsImages)

  # Rule 3: Latency constraint
  if task.isRealTime or task.inAgentLoop:
    candidates = candidates.filter(m => m.latencyTier <= "fast")

  # Rule 4: Complexity classification
  if task.hasSignal("debug", "architect", "design", "security"):
    return cheapestIn(candidates, TIER_3)
  if task.hasSignal("summarize", "analyze", "refactor"):
    return cheapestIn(candidates, TIER_2)

  complexity = classifyTask(task)
  if complexity == ROUTINE:
    return cheapestIn(candidates, TIER_1)
  elif complexity == MODERATE:
    return cheapestIn(candidates, TIER_2)
  else:
    return cheapestIn(candidates, TIER_3)

Note: "write", "read", "code" alone are poor routing signals — "write a file" is Tier 1: work, not Tier 2. Classify based on the task structure, not individual keywords.

Latency Considerations

Cost isn't the only axis. For real-time agent loops, latency matters:

Tier Typical TTFT Throughput Use When
Free 1-5s Variable Background tasks, not time-sensitive
Tier 1 200-800ms 50-100 tok/s Agent loops, real-time pipelines
Tier 2 500ms-2s 30-80 tok/s Interactive sessions, async work
Tier 3 1-10s 10-40 tok/s One-shot complex tasks, async only

TTFT = Time To First Token. Reasoning models (o1, o3-mini) have high TTFT due to thinking time but are worth it for hard problems.

Rule of thumb: If the agent is waiting in a loop for a response before the next action, use Tier 1. If the task is fire-and-forget, cost matters more than speed.

Behavioral Rules

For Main Session

  1. Default to Tier 2 for interactive work
  2. Suggest downgrade when doing routine work: "This is routine - I can handle this on a cheaper model or spawn a sub-agent."
  3. Request upgrade when stuck: "This needs more reasoning power. Switching to [premium model]."

For Sub-Agents

  1. Default to Tier 1 unless task is clearly moderate+
  2. Batch similar tasks to amortize overhead
  3. Report failures back to parent for escalation
  4. Check context window limits before dispatching — don't send 200K tokens to a 32K model

For Automated Tasks

  1. Heartbeats/monitoring → Always Tier 1 (or Free if available)
  2. Scheduled reports → Tier 1 or 2 based on complexity
  3. Alert responses → Start Tier 2, escalate if needed
  4. Background data fetching → Free tier when non-critical

Communication Patterns

When suggesting model changes, use clear language:

Downgrade suggestion:

"This looks like routine file work. Want me to spawn a sub-agent on DeepSeek for this? Same result, fraction of the cost."

Upgrade request:

"I'm hitting the limits of what I can figure out here. This needs Opus-level reasoning. Switching up."

Explaining hierarchy:

"I'm running the heavy analysis on Sonnet while sub-agents fetch the data on DeepSeek. Keeps costs down without sacrificing quality where it matters."

Cost Impact

Assuming 100K tokens/day average usage:

Strategy Monthly Cost Notes
Pure Opus 4.6 ~$75 Maximum capability, lower than old Opus
Pure Sonnet ~$45 Good default for most work
Pure DeepSeek ~$9 Cheap but limited on hard problems
Pure Qwen3 Coder ~$2 Cheapest viable for coding agents
Hierarchy (80/15/5) ~$12 Best of all worlds
With Free tier (85/10/4/1) ~$8 Aggressive optimization

The 80/15/5 split:

  • 80% routine tasks on Tier 1 (~$4)
  • 15% moderate tasks on Tier 2 (~$5)
  • 5% complex tasks on Tier 3 (~$3)

Result: 6-10x cost reduction vs pure premium, with equivalent quality on complex tasks.

OpenClaw Integration

Session Model Switching

# config.yml - set your default session model
model: anthropic/claude-sonnet-4

# Mid-session, switch down for routine work
/model deepseek/deepseek-chat

# Switch up when you hit a wall
/model anthropic/claude-opus-4

Spawning Sub-Agents

# Batch routine tasks on cheap models
sessions_spawn:
  task: "Fetch and parse these 50 URLs"
  model: deepseek/deepseek-chat

# Use Qwen3 Coder for file-heavy agent work
sessions_spawn:
  task: "Refactor these test files to use the new helper"
  model: qwen/qwen3-coder-next

# Free tier for non-critical background jobs
sessions_spawn:
  task: "Check health of all endpoints and log status"
  model: openrouter/free

Recommended OpenClaw Defaults

Task Type Model Why
Main interactive session claude-sonnet-4 Best balance of quality and cost
File ops, fetches, formatting deepseek/deepseek-chat Cheap, reliable
Agentic coding sub-tasks qwen/qwen3-coder-next $0.07/M, 262K context, tool use
Background monitoring openrouter/free Zero cost
Stuck / complex debugging anthropic/claude-opus-4 Escalate only when needed

Anti-Patterns

DON'T:

  • Leave your session on Opus when the task is clearly routine — /model deepseek exists for a reason
  • Spawn sub-agents without specifying a model — they inherit the session model, which is usually Tier 2
  • Use Tier 3 for sessions_spawn tasks like file parsing, URL fetching, or status checks
  • Forget context window limits — spawning a 200K-token task on a 32K model will silently truncate
  • Run recurring or scheduled tasks on anything above Tier 1

DO:

  • Set model: anthropic/claude-sonnet-4 as your config.yml default — good baseline
  • Always set an explicit model field in sessions_spawn — default to deepseek/deepseek-chat or qwen/qwen3-coder-next
  • /model switch down the moment you realize the current task is janitorial
  • /model switch up the moment you're stuck — don't waste tokens retrying on a weak model
  • Use openrouter/free for fire-and-forget background checks

Extending This Skill

Optimize your switchboard over time:

  1. Track your actual spend — review your OpenRouter dashboard weekly to see which models are burning tokens
  2. Add your own routing signals — if your workflow has domain terms (e.g., "settlement", "pricing", "vault"), map them to tiers
  3. Tune the 80/15/5 split — if you find yourself escalating more than 5% of tasks, your classification may be too aggressive
  4. Pin model versions — when a cheap model works well for you, pin the version (e.g., deepseek/deepseek-chat-v3.1) so provider updates don't break your flow
  5. Set OpenRouter budget alerts — catch runaway premium usage before it compounds

推荐文章

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

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

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

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

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

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

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

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • SwitchBoard
    • Prerequisites
    • Core Principle
    • Model Tiers
      • Tier 0: Free
      • Tier 1: Cheap ($0.02-0.50/M tokens)
      • Tier 2: Mid ($1-5/M tokens)
      • Tier 3: Premium ($5+/M tokens)
    • Task Classification
      • ROUTINE → Use Tier 1
      • MODERATE → Use Tier 2
      • COMPLEX → Use Tier 3
    • Decision Algorithm
    • Latency Considerations
    • Behavioral Rules
      • For Main Session
      • For Sub-Agents
      • For Automated Tasks
    • Communication Patterns
    • Cost Impact
    • OpenClaw Integration
      • Session Model Switching
      • Spawning Sub-Agents
      • Recommended OpenClaw Defaults
    • Anti-Patterns
    • Extending This Skill
  • 项目或源文件

相关 Skill

更多
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...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期