Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计提醒

model-fallback模型回退

Agent Skill

model-fallback 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

15,947

周安装

678

GitHub Stars

公开资料未说明

下载量

5,587
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:model-fallback(模型回退)
来源仓库:https://github.com/azure5100/model-fallback
安装命令:
openclaw skills install model-fallback
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install model-fallback

简介

自动监控主模型状态并在故障时切换备用源。

  • 适用于关键业务需保证连续性的场景。model-fallback 属于效率类 Skill,可作为该场景下的辅助能力补充。
  • 支持 MiniMax 等多厂商模型作为后备选项。
  • 配置前请规划清晰的优先级与切换策略。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 建议定期演练故障转移流程确保实效性。

SKILL.md

name
model-fallback
description
>-
tags
[model, fallback, multi-model, cost-optimization, reliability]

Model Fallback Skill

Multi-model automatic fallback system for AI agents

Overview

This skill provides automatic model fallback functionality for OpenClaw agents. When the primary model fails (unavailable, slow, or rate-limited), it automatically switches to backup models in a predefined priority order.

Features

  • Automatic Fallback: Seamlessly switch to backup models on failure
  • Configurable Priority: Define your own model fallback order
  • Health Monitoring: Track model availability and response times
  • Cost Optimization: Use cheaper models for simple tasks
  • Logging: Full audit trail of fallback events

Supported Models

ProviderModelContextUse Case
MiniMaxM2.5200KPrimary (reasoning)
MiniMaxM2.1200KBackup
KimiK2.5256KLong documents
KimiK2128KStandard
ZhipuGLM-4-Air128KLow cost
ZhipuGLM-4-Flash1MHigh volume

Configuration

Default Fallback Chain

{
  "fallback_chain": [
    {
      "provider": "minimax-portal",
      "model": "MiniMax-M2.5",
      "priority": 1,
      "timeout": 30,
      "max_retries": 3
    },
    {
      "provider": "moonshot",
      "model": "kimi-k2.5",
      "priority": 2,
      "timeout": 30,
      "max_retries": 2
    },
    {
      "provider": "zhipu",
      "model": "glm-4-air",
      "priority": 3,
      "timeout": 20,
      "max_retries": 2
    }
  ]
}

Environment Variables

VariableRequiredDescription
MODEL_FALLBACK_ENABLEDNoEnable/disable fallback (default: true)
MODEL_FALLBACK_LOG_LEVELNoLog level: debug, info, warn, error

Usage

Basic Usage

The skill automatically handles model failures. No explicit calls needed.

# Trigger a model call (fallback happens automatically on failure)

Manual Fallback

# Force fallback to next model
/scripts/model-fallback.sh --force-next

# Check current model status
/scripts/model-fallback.sh --status

# Reset to primary model
/scripts/model-fallback.sh --reset

Configuration

Edit config.json to customize the fallback chain:

{
  "fallback_chain": [
    {"provider": "...", "model": "...", "priority": 1}
  ],
  "health_check": {
    "enabled": true,
    "interval_seconds": 300
  }
}

How It Works

1. User makes request with primary model
2. Model call fails (error, timeout, rate limit)
3. Skill detects failure
4. Wait 3 seconds (debounce)
5. Switch to next model in chain
6. Retry request with new model
7. If successful, return result
8. If failed, repeat steps 4-7
9. If all models fail, return error with details

Fallback Triggers

TriggerConditionAction
API UnavailableConnection timeoutFallback
Rate Limit429 responseFallback + wait
Slow Response> timeout secondsFallback
Invalid ResponseParse errorFallback
Auth Error401/403 responseLog + stop

Logging

Logs are written to:

  • ~/.openclaw/logs/model-fallback.log

Log Format

[2026-02-27 14:00:00] [INFO] Primary model MiniMax-M2.5 called
[2026-02-27 14:00:05] [WARN] Model failed: rate limit exceeded
[2026-02-27 14:00:05] [INFO] Falling back to Kimi K2.5
[2026-02-27 14:00:10] [INFO] Fallback successful

Cost Optimization

Use cheaper models for simple tasks:

{
  "task_routing": {
    "simple_query": ["glm-4-air", "glm-4-flash"],
    "complex_reasoning": ["MiniMax-M2.5", "kimi-k2.5"],
    "long_context": ["kimi-k2.5", "MiniMax-M2.1"]
  }
}

Integration

OpenClaw Configuration

Add to openclaw.json:

{
  "models": {
    "mode": "merge",
    "fallback": {
      "enabled": true,
      "config": "~/.openclaw/skills/model-fallback/config.json"
    }
  }
}

Health Check

Integrate with system health monitoring:

# Check model health
curl http://localhost:18789/api/models/health

Troubleshooting

Fallback Not Working

  1. Check if fallback is enabled: echo $MODEL_FALLBACK_ENABLED
  2. Verify config exists: ls ~/.openclaw/skills/model-fallback/config.json
  3. Check logs: tail -f ~/.openclaw/logs/model-fallback.log

Models Always Failing

  1. Check API keys are valid
  2. Verify network connectivity
  3. Check rate limits on provider dashboard

Examples

Example 1: Simple Fallback

User: "Hello"
System: Using MiniMax-M2.5...
System: Rate limited, switching to Kimi K2.5...
System: Response from Kimi K2.5: "Hello! How can I help?"

Example 2: Cost Optimization

User: "What is 2+2?"
System: Routing to glm-4-air (low cost)...
System: Response: "2+2=4"

Example 3: Long Document

User: "Summarize this 100-page PDF"
System: Detected long context requirement
System: Routing to Kimi K2.5 (256K context)...
System: Processing...

License

MIT

Author

CC (AI Assistant)

Version

1.0.0

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

73.52%
按下载量换算4,108

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills