Auto Model Switcher
Intelligently selects the optimal model from available providers based on task characteristics.
When to Use
- - Task requires specific capabilities (coding, analysis, multimodal, writing, research)
- Need optimal performance/cost balance
- Working with long context or complex reasoning
- User doesn't specify a model preference
Available Models Analysis
Qwen Series (bailian provider)
| Model | Context | Multimodal | Best For | Cost |
|---|
| qwen3.5-plus | 1M | ✅ Text+Image | General tasks, creative writing, balanced performance | Low |
| qwen3-max |
262K | ❌ Text only | Complex reasoning, deep analysis, research | High |
|
qwen3-coder-plus | 1M | ❌ Text only | Code generation, debugging | Medium |
Third-party Models (bailian provider)
| Model | Context | Multimodal | Best For |
|---|
| glm-5 | 1M | ✅ Text+Image | Multimodal tasks, Chinese optimization |
| kimi-k2.5 |
200K | ✅ Text+Image | Multimodal, research-oriented |
|
MiniMax-M2.5 | 1M | ✅ Text+Image | Long context multimodal |
Selection Logic
Task Type Detection
Code Tasks → bailian/qwen3-coder-plus
- - Keywords: code, programming, debug, fix, implement, develop, coding, script
- File extensions: .py, .js, .ts, .java, .cpp, etc.
- Commands: git, npm, docker, build, compile
Complex Analysis → bailian/qwen3-max
- - Keywords: analyze, research, compare, evaluate, strategy, deep dive, business analysis
- Tasks requiring multi-step reasoning
- Financial/strategic analysis
Research Tasks → bailian/qwen3-max
- - Keywords: research, investigate, study, survey, academic, literature review
- Complex information synthesis
- Multi-source analysis and comparison
Writing/Copywriting Tasks → bailian/qwen3.5-plus
- - Keywords: write, draft, copywriting, content, article, blog, email, proposal, creative
- Marketing copy, social media content
- Creative writing and storytelling
Multimodal Tasks → bailian/glm-5
- - Image analysis, OCR, visual understanding
- Audio processing (when supported)
- Mixed text+image inputs
Long Context → bailian/qwen3.5-plus
- - Document processing > 200K tokens
- Summarization of large documents
- Historical context analysis
General Tasks → bailian/qwen3.5-plus (default)
- - Chat, simple queries, basic tasks
- When no specific requirements detected
Fallback Strategy
- 1. Primary model selection based on task type
- If primary model fails, fallback to INLINECODE7
- If still failing, use current session model
Usage Examples
Automatic Selection
CODEBLOCK0
Manual Override
Users can always specify models directly:
Implementation Notes
- - Always check if target model is available before switching
- Preserve current session context when switching
- Log model selections for learning and optimization
- Respect user's explicit model preferences
Security Considerations
- - Only switch between pre-configured models in openclaw.json
- Never attempt to use unconfigured or unknown models
- Validate model names against available list before switching
Performance Metrics
Track these metrics for continuous improvement:
- - Task completion success rate by model
- Response time by model and task type
- User satisfaction feedback
- Cost per task type
This skill enables intelligent model routing without user intervention while maintaining full control when needed.
Iteration Support
- - Skills can be updated via INLINECODE10
- Version updates maintain backward compatibility
- New task types can be added without breaking existing functionality
自动模型切换器
根据任务特征智能地从可用提供商中选择最优模型。
使用场景
- - 任务需要特定能力(编码、分析、多模态、写作、研究)
- 需要最佳性能/成本平衡
- 处理长上下文或复杂推理
- 用户未指定模型偏好
可用模型分析
Qwen系列(bailian提供商)
| 模型 | 上下文 | 多模态 | 最佳用途 | 成本 |
|---|
| qwen3.5-plus | 1M | ✅ 文本+图像 | 通用任务、创意写作、均衡性能 | 低 |
| qwen3-max |
262K | ❌ 仅文本 | 复杂推理、深度分析、研究 | 高 |
|
qwen3-coder-plus | 1M | ❌ 仅文本 | 代码生成、调试 | 中 |
第三方模型(bailian提供商)
| 模型 | 上下文 | 多模态 | 最佳用途 |
|---|
| glm-5 | 1M | ✅ 文本+图像 | 多模态任务、中文优化 |
| kimi-k2.5 |
200K | ✅ 文本+图像 | 多模态、研究导向 |
|
MiniMax-M2.5 | 1M | ✅ 文本+图像 | 长上下文多模态 |
选择逻辑
任务类型检测
代码任务 → bailian/qwen3-coder-plus
- - 关键词:代码、编程、调试、修复、实现、开发、编码、脚本
- 文件扩展名:.py、.js、.ts、.java、.cpp等
- 命令:git、npm、docker、构建、编译
复杂分析 → bailian/qwen3-max
- - 关键词:分析、研究、比较、评估、策略、深度探究、商业分析
- 需要多步推理的任务
- 财务/战略分析
研究任务 → bailian/qwen3-max
- - 关键词:研究、调查、学习、调研、学术、文献综述
- 复杂信息综合
- 多源分析与比较
写作/文案任务 → bailian/qwen3.5-plus
- - 关键词:撰写、草稿、文案、内容、文章、博客、邮件、提案、创意
- 营销文案、社交媒体内容
- 创意写作与故事叙述
多模态任务 → bailian/glm-5
- - 图像分析、OCR、视觉理解
- 音频处理(支持时)
- 文本+图像混合输入
长上下文 → bailian/qwen3.5-plus
- - 文档处理超过200K tokens
- 大型文档摘要
- 历史上下文分析
通用任务 → bailian/qwen3.5-plus(默认)
回退策略
- 1. 基于任务类型的主要模型选择
- 如果主要模型失败,回退到qwen3.5-plus
- 如果仍然失败,使用当前会话模型
使用示例
自动选择
用户:帮我调试这段Python代码
→ 模型:bailian/qwen3-coder-plus
用户:分析我们第四季度与竞争对手的财务表现
→ 模型:bailian/qwen3-max
用户:研究营销领域的最新AI趋势
→ 模型:bailian/qwen3-max
用户:为我们的新服务撰写引人入胜的产品描述
→ 模型:bailian/qwen3.5-plus
用户:这张图片里有什么?
→ 模型:bailian/glm-5
用户:总结这份500页的文档
→ 模型:bailian/qwen3.5-plus
手动覆盖
用户始终可以直接指定模型:
- - /model bailian/qwen3-max
- 为此任务使用coder模型
实现说明
- - 切换前始终检查目标模型是否可用
- 切换时保留当前会话上下文
- 记录模型选择用于学习和优化
- 尊重用户的显式模型偏好
安全考虑
- - 仅在openclaw.json中预配置的模型之间切换
- 绝不尝试使用未配置或未知的模型
- 切换前根据可用列表验证模型名称
性能指标
跟踪以下指标以持续改进:
- - 按模型划分的任务完成成功率
- 按模型和任务类型划分的响应时间
- 用户满意度反馈
- 按任务类型划分的成本
此技能实现了智能模型路由,无需用户干预,同时在需要时保持完全控制。
迭代支持
- - 技能可通过clawhub sync --all更新
- 版本更新保持向后兼容性
- 可添加新任务类型而不破坏现有功能