← 返回 Skills 市场
davidme6

Smart Model Switcher

作者 davidme6 · GitHub ↗ · v3.0.0 · MIT-0
cross-platform ⚠ suspicious
239
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install davidme6-smart-model-switcher-v3
功能描述
Universal Smart Model Switcher V3 - Multi-Provider, Multi-Model intelligent switching. Automatically selects the best model from ALL your purchased API plans...
使用说明 (SKILL.md)

🧠 Smart Model Switcher V3 (Universal Multi-Provider)

全平台多模型智能切换 • 零延迟 • 无需重启 • 自动 fallback

🎯 V3 核心升级

特性 V2 V3
支持 provider 仅 Bailian/Qwen 全平台 (Bailian/MiniMax/GLM/Kimi/等)
模型数量 ~5 个 50+ 个
API Key 验证 ❌ 无 ✅ 自动验证
套餐检测 ❌ 无 ✅ 自动检测已购套餐
跨 provider 切换 ❌ 不支持 ✅ 支持
成本优化 ❌ 无 ✅ 优先使用性价比高的模型
多 key 管理 ❌ 单 key ✅ 多 provider key 管理

支持的 Provider 和模型

百炼 (Bailian) - Qwen 系列

模型 适用场景 Context 优先级
qwen3.5-plus 写作/长文档/翻译 1M ⭐⭐⭐
qwen3-coder-plus 编程/Debug 100K ⭐⭐⭐
qwen3-max-2026-01-23 复杂推理/数学 100K ⭐⭐⭐
qwen3.5-397b-a17b 通用任务 262K ⭐⭐
qwen-plus 日常对话/快速任务 131K
qwen-turbo 简单任务/低成本 32K

MiniMax 系列

模型 适用场景 Context 优先级
MiniMax-M2.5 通用/对话 256K ⭐⭐⭐
MiniMax-Text-01 长文本处理 1M ⭐⭐

智谱 (GLM) 系列

模型 适用场景 Context 优先级
glm-5 通用/推理 128K ⭐⭐⭐
glm-4.7 快速任务 128K ⭐⭐

月之暗面 (Kimi) 系列

模型 适用场景 Context 优先级
kimi-k2.5 长文档/分析 200K+ ⭐⭐⭐

🚀 核心功能

1. 全平台模型支持

  • ✅ Bailian (Qwen 系列)
  • ✅ MiniMax
  • ✅ GLM (智谱)
  • ✅ Kimi (月之暗面)
  • ✅ 自动扩展新 provider

2. API Key 自动验证

启动时自动检测:
├── bailian API Key → ✅ 有效/❌ 无效
├── minimax API Key → ✅ 有效/❌ 无效
├── glm API Key → ✅ 有效/❌ 无效
└── kimi API Key → ✅ 有效/❌ 无效

3. 套餐检测

已购套餐检测:
├── Bailian → qwen3.5-plus, qwen3-coder-plus, ...
├── MiniMax → MiniMax-M2.5, ...
├── GLM → glm-5, glm-4.7, ...
└── Kimi → kimi-k2.5, ...

4. 智能任务分类 (增强版)

任务类型 关键词 首选模型 备选 1 备选 2
编程 代码/编程/python/js/函数/debug/bug qwen3-coder-plus glm-5 MiniMax-M2.5
写作 小说/故事/文章/写作/创作 qwen3.5-plus kimi-k2.5 qwen3.5-397b
推理 推理/数学/逻辑/证明/计算 qwen3-max glm-5 qwen3.5-plus
分析 分析/数据/报告/总结/对比 qwen3.5-plus kimi-k2.5 glm-5
翻译 翻译/英文/中文/语言 qwen3.5-plus glm-5 MiniMax-M2.5
长文档 长文档/万字/10 万/1M/长篇 qwen3.5-plus kimi-k2.5 MiniMax-Text-01
对话 聊天/你好/在吗/帮助 MiniMax-M2.5 qwen-plus glm-4.7
快速 简单/快速/马上/立刻 qwen-turbo qwen-plus glm-4.7

5. 成本优化策略

选择逻辑:
1. 任务匹配 → 找到最适合的模型
2. 可用性检查 → 确认 API Key 有效且有套餐
3. 成本优化 → 同等级别优先使用性价比高的
4. Fallback → 主模型不可用时自动降级

6. 零延迟切换

  • ⚡ 无需重启 gateway
  • ⚡ 运行时模型选择 (\x3C100ms)
  • ⚡ 连接池预加载
  • ⚡ 用户无感知切换

📊 架构图

┌─────────────────────────────────────────────────────────┐
│                   用户请求                               │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│           API Key 验证器 (启动时)                        │
│  • bailian API Key → 验证                                │
│  • minimax API Key → 验证                                │
│  • glm API Key → 验证                                    │
│  • kimi API Key → 验证                                   │
│  • 生成可用模型列表                                      │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│              任务分析器 (50ms)                           │
│  • 多语言关键词匹配                                     │
│  • 上下文分析                                           │
│  • 置信度评分                                           │
│  • 任务类型识别                                         │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│           可用模型注册表 (预加载)                        │
│  • bailian/qwen3.5-plus (Ready) ✅                       │
│  • bailian/qwen3-coder-plus (Ready) ✅                   │
│  • bailian/qwen3-max (Ready) ✅                          │
│  • bailian/MiniMax-M2.5 (Ready) ✅                       │
│  • bailian/glm-5 (Ready) ✅                              │
│  • bailian/kimi-k2.5 (Ready) ✅                          │
│  • ... (所有已购模型)                                    │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│          模型选择器 (30ms)                               │
│  • 根据任务类型选择最佳模型                              │
│  • 检查模型可用性 (API Key + 套餐)                       │
│  • 成本优化 (同等级别选性价比高的)                        │
│  • 应用 fallback 逻辑                                    │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│              模型 API 调用                                │
│  • 直接 API 调用 (无需改配置)                             │
│  • 连接池                                               │
│  • 自动重试                                             │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│                  响应                                    │
│  • 返回结果                                             │
│  • 记录性能                                             │
│  • 更新统计                                             │
└─────────────────────────────────────────────────────────┘

⚡ 性能指标

指标 V2 V3 提升
支持模型数 5 50+ 10x
支持 Provider 1 4+ 4x
切换时间 \x3C100ms \x3C80ms 20% 更快
API Key 验证 新功能
套餐检测 新功能
成本优化 新功能
内存占用 +20% +25% 可接受

🎯 使用示例

示例 1: 编程任务

用户:"帮我写个 Python 爬虫"
Agent: "🧠 已切换到 qwen3-coder-plus (最适合编程,Bailian)"
[完成任务]

示例 2: 写作任务

用户:"帮我写一本科幻小说"
Agent: "🧠 已切换到 qwen3.5-plus (最适合写作,1M 上下文)"
[完成任务]

示例 3: 跨 Provider 切换

用户:"这道数学题怎么做?"
Agent: "🧠 已切换到 qwen3-max (最适合推理,Bailian)"
[如果 qwen3-max 不可用]
Agent: "⚠️ qwen3-max 不可用,切换到 glm-5 (最佳备选)"
[完成任务]

示例 4: 长文档处理

用户:"帮我分析这个 10 万字的文档"
Agent: "🧠 已切换到 kimi-k2.5 (最适合长文档,200K+ 上下文)"
[完成任务]

示例 5: 成本优化

用户:"简单的问题,1+1 等于几"
Agent: "🧠 已切换到 qwen-turbo (快速任务,低成本)"
[完成任务]

🔧 配置

openclaw.json 配置

{
  "models": {
    "mode": "merge",
    "providers": {
      "bailian": {
        "baseUrl": "https://dashscope.aliyuncs.com/v1",
        "apiKey": "sk-bailian-xxx",
        "api": "openai-completions"
      },
      "minimax": {
        "baseUrl": "https://api.minimax.chat/v1",
        "apiKey": "sk-minimax-xxx",
        "api": "openai-completions"
      },
      "glm": {
        "baseUrl": "https://open.bigmodel.cn/api/paas/v4",
        "apiKey": "sk-glm-xxx",
        "api": "openai-completions"
      },
      "kimi": {
        "baseUrl": "https://api.moonshot.cn/v1",
        "apiKey": "sk-kimi-xxx",
        "api": "openai-completions"
      }
    }
  }
}

环境变量方式

# Bailian
export BAILIAN_API_KEY="sk-bailian-xxx"

# MiniMax
export MINIMAX_API_KEY="sk-minimax-xxx"

# GLM
export GLM_API_KEY="sk-glm-xxx"

# Kimi
export KIMI_API_KEY="sk-kimi-xxx"

📊 模型选择矩阵 (完整版)

任务类型 首选 (Provider) 备选 1 (Provider) 备选 2 (Provider) 延迟
编程 qwen3-coder-plus (Bailian) glm-5 (GLM) MiniMax-M2.5 (MiniMax) \x3C50ms
写作 qwen3.5-plus (Bailian) kimi-k2.5 (Kimi) qwen3.5-397b (Bailian) \x3C50ms
推理 qwen3-max (Bailian) glm-5 (GLM) qwen3.5-plus (Bailian) \x3C50ms
分析 qwen3.5-plus (Bailian) kimi-k2.5 (Kimi) glm-5 (GLM) \x3C50ms
翻译 qwen3.5-plus (Bailian) glm-5 (GLM) MiniMax-M2.5 (MiniMax) \x3C30ms
长文档 qwen3.5-plus (Bailian) kimi-k2.5 (Kimi) MiniMax-Text-01 (MiniMax) \x3C50ms
对话 MiniMax-M2.5 (MiniMax) qwen-plus (Bailian) glm-4.7 (GLM) \x3C30ms
快速 qwen-turbo (Bailian) qwen-plus (Bailian) glm-4.7 (GLM) \x3C20ms

⚠️ 限制

限制 说明
套餐限制 仅使用已购套餐内的模型
API Key 有效 需要正确配置各 provider 的 API Key
网络要求 需要能访问各 provider API
内存 预加载占用约 25% 额外内存

🔍 技术细节

API Key 验证流程

1. 读取配置文件中的各 provider API Key
2. 对每个 provider 发送测试请求
3. 记录验证结果 (✅ 有效 / ❌ 无效)
4. 生成可用模型列表
5. 启动时完成,不影响运行时性能

套餐检测流程

1. 调用各 provider 的套餐查询 API
2. 解析返回的可用模型列表
3. 与本地模型注册表比对
4. 标记可用/不可用模型
5. 定期刷新 (默认 24h)

成本优化算法

1. 同任务类型有多个模型可选时
2. 比较各模型成本 (tokens/价格)
3. 选择性价比最高的
4. 用户可配置"优先质量"或"优先成本"

📈 优势

优势 影响
全平台支持 可使用所有已购模型
零延迟 无需重启,瞬间切换
智能 fallback 主模型不可用自动降级
成本优化 自动选择性价比高的模型
自动验证 启动时检查 API Key 有效性
套餐感知 仅使用已购套餐内模型

📝 安装

# 克隆仓库
git clone https://github.com/davidme6/openclaw.git

# 复制 skill 到工作区
cp -r openclaw/skills/smart-model-switcher-v3 ~/.openclaw/workspace/skills/

# 或使用 ClawHub
npx skills add davidme6/openclaw@smart-model-switcher-v3

# 重启 Gateway (一次性)
openclaw gateway restart

🔧 使用

无需额外配置!Skill 会自动:

  1. 检测配置的 API Keys
  2. 验证各 provider 连接
  3. 查询已购套餐
  4. 生成可用模型列表
  5. 运行时智能切换

🆘 故障排除

Q: 为什么没有切换到某模型? A: 检查日志,可能该模型的 API Key 无效或套餐未购买。

Q: 如何查看可用模型列表? A: 运行 node scripts/check-availability.js 查看。

Q: 如何手动覆盖选择? A: 直接指定模型名称,skill 会使用该模型。

Q: 如何切换优先模式? A: 配置 priority: "quality"priority: "cost"

📞 支持


版本: 3.0.0 (Universal Multi-Provider) 作者: davidme6 许可: MIT 发布日期: 2026-03-10

🌟 V3 核心亮点

  1. 全平台支持 - Bailian/MiniMax/GLM/Kimi 等所有 provider
  2. API Key 验证 - 启动时自动验证所有 key
  3. 套餐检测 - 仅使用已购套餐内模型
  4. 成本优化 - 自动选择性价比高的模型
  5. 50+ 模型 - 支持所有主流大模型
  6. 零延迟 - 80ms 切换,无需重启

升级到 V3,解锁全平台模型智能切换! 🚀

安全使用建议
Do not install or provide API keys yet. Steps to take before trusting or installing this skill: 1) Confirm the missing runtime files: the README/SKILL.md reference scripts (scripts/runtime-switch.ps1, auto-monitor.ps1) but the package contains none — ask the author to publish the complete release or provide the scripts for review. 2) Inspect any runtime scripts before running them; they will have access to your API keys and network. 3) Verify where the skill reads credentials (~/.openclaw/openclaw.json or env vars) and ensure the registry metadata reflects those config paths and required env vars. 4) If you must test, do so in a sandboxed environment or VM with dummy API keys, not your real production keys. 5) The unicode-control-chars finding could indicate obfuscation or prompt-injection; request a clean, minimal SKILL.md and a full source package on a trusted host (e.g., a tagged GitHub release) before proceeding. 6) Prefer skills that declare required credentials/config in metadata and include the actual runtime code in the published bundle so you can audit it.
功能分析
Type: OpenClaw Skill Name: davidme6-smart-model-switcher-v3 Version: 3.0.0 The skill bundle describes a multi-provider model switcher that requires sensitive API keys for several LLM services (Bailian, MiniMax, GLM, Kimi). While the documentation (SKILL.md, README.md) claims to perform 'API Key validation' and 'Plan detection,' the actual implementation scripts (e.g., scripts/runtime-switch.ps1 and scripts/auto-monitor.ps1) are missing from the provided files. This lack of transparency regarding how credentials are handled, combined with the request for high-value secrets and the execution of background monitoring services, presents a potential risk for data exfiltration or unauthorized access.
能力评估
Purpose & Capability
The README/SKILL.md claim automatic API-key validation, package detection, connection pooling, and runtime switching across many providers. Those capabilities legitimately require access to provider API keys, provider APIs, and executable scripts/components to run. However the registry metadata lists no required env vars or config paths and no binaries, and the package contains no code or the runtime scripts it references. The missing scripts/config-declaration is not coherent with the claimed capabilities.
Instruction Scope
SKILL.md explicitly tells the agent/user to read ~/.openclaw/openclaw.json, environment variables (BAILIAN_API_KEY, MINIMAX_API_KEY, GLM_API_KEY, KIMI_API_KEY), validate keys against provider endpoints, check purchased plans, and run scripts (./scripts/runtime-switch.ps1, auto-monitor.ps1). Those are sensitive operations (reading API keys and contacting external provider APIs). The skill metadata did not declare these config paths or env vars, and the referenced scripts are not present — the runtime instructions therefore overreach the actual package contents and grant broad discretion without evidence the skill can implement them.
Install Mechanism
The package is instruction-only (no install spec), which is low-risk in itself. But the README instructs installation via npx or manual cloning and references scripts under scripts/ that are absent from the archive. This inconsistency suggests the published bundle is incomplete or mispackaged; installing by following these instructions could lead a user to copy files or run commands from external locations (git clone, npx) without the guarantee that the promised runtime artifacts are included, which increases risk.
Credentials
Functionally, requesting API keys for each provider (Bailian, MiniMax, GLM, Kimi) is proportionate to multi-provider switching. However the skill's registry metadata declares no required env vars or config paths while the README/SKILL.md instructs storing keys in ~/.openclaw/openclaw.json or BAILIAN_API_KEY / MINIMAX_API_KEY / GLM_API_KEY / KIMI_API_KEY. That mismatch (sensitive keys needed but not declared) is a red flag because it hides the credential access surface from the registry metadata.
Persistence & Privilege
The skill does not set always:true and uses the normal agent invocation model. The README instructs copying the skill into the OpenClaw skills directory and restarting the gateway (normal for installation). There is no explicit request to modify other skills or system-wide settings. Still, because the skill's instructions imply ongoing runtime behavior (auto-monitor service, connection pool, key validation) you should be aware that installing it would introduce a component that could run continuously — and the package currently lacks the referenced scripts to inspect before granting that persistence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install davidme6-smart-model-switcher-v3
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /davidme6-smart-model-switcher-v3 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.0.0
Version 3.0.0 — Major update: Now supports universal, intelligent model switching across 4+ AI providers and 50+ models. - Added support for Bailian/Qwen, MiniMax, GLM, and Kimi model series with fully automatic multi-provider integration. - Introduced advanced API key validation and automatic detection of purchased API plans for all providers. - Enabled multi-key management and zero-latency runtime model switching for seamless transition between models. - Enhanced task classification with intelligent model selection, fallback logic, and cost optimization based on task type and credits. - Streamlined configuration via both environment variables and JSON for easy provider/API integration. - Improved real-time performance and user experience with preloading, connection pooling, and runtime choice (<100ms switch). - Detailed architecture, model/task matrix, and use cases included in the new documentation.
元数据
Slug davidme6-smart-model-switcher-v3
版本 3.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Smart Model Switcher 是什么?

Universal Smart Model Switcher V3 - Multi-Provider, Multi-Model intelligent switching. Automatically selects the best model from ALL your purchased API plans... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 239 次。

如何安装 Smart Model Switcher?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install davidme6-smart-model-switcher-v3」即可一键安装,无需额外配置。

Smart Model Switcher 是免费的吗?

是的,Smart Model Switcher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Smart Model Switcher 支持哪些平台?

Smart Model Switcher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Smart Model Switcher?

由 davidme6(@davidme6)开发并维护,当前版本 v3.0.0。

💬 留言讨论