{
  "schemaVersion": "1.0",
  "item": {
    "slug": "model-fallback",
    "name": "Multi-model automatic fallback system",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/azure5100/model-fallback",
    "canonicalUrl": "https://clawhub.ai/azure5100/model-fallback",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/model-fallback",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=model-fallback",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "model-fallback",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T15:41:38.190Z",
      "expiresAt": "2026-05-09T15:41:38.190Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=model-fallback",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=model-fallback",
        "contentDisposition": "attachment; filename=\"model-fallback-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "model-fallback"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/model-fallback"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/model-fallback",
    "agentPageUrl": "https://openagent3.xyz/skills/model-fallback/agent",
    "manifestUrl": "https://openagent3.xyz/skills/model-fallback/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/model-fallback/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Model Fallback Skill",
        "body": "Multi-model automatic fallback system for AI agents"
      },
      {
        "title": "Overview",
        "body": "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."
      },
      {
        "title": "Features",
        "body": "Automatic Fallback: Seamlessly switch to backup models on failure\nConfigurable Priority: Define your own model fallback order\nHealth Monitoring: Track model availability and response times\nCost Optimization: Use cheaper models for simple tasks\nLogging: Full audit trail of fallback events"
      },
      {
        "title": "Supported Models",
        "body": "ProviderModelContextUse CaseMiniMaxM2.5200KPrimary (reasoning)MiniMaxM2.1200KBackupKimiK2.5256KLong documentsKimiK2128KStandardZhipuGLM-4-Air128KLow costZhipuGLM-4-Flash1MHigh volume"
      },
      {
        "title": "Default Fallback Chain",
        "body": "{\n  \"fallback_chain\": [\n    {\n      \"provider\": \"minimax-portal\",\n      \"model\": \"MiniMax-M2.5\",\n      \"priority\": 1,\n      \"timeout\": 30,\n      \"max_retries\": 3\n    },\n    {\n      \"provider\": \"moonshot\",\n      \"model\": \"kimi-k2.5\",\n      \"priority\": 2,\n      \"timeout\": 30,\n      \"max_retries\": 2\n    },\n    {\n      \"provider\": \"zhipu\",\n      \"model\": \"glm-4-air\",\n      \"priority\": 3,\n      \"timeout\": 20,\n      \"max_retries\": 2\n    }\n  ]\n}"
      },
      {
        "title": "Environment Variables",
        "body": "VariableRequiredDescriptionMODEL_FALLBACK_ENABLEDNoEnable/disable fallback (default: true)MODEL_FALLBACK_LOG_LEVELNoLog level: debug, info, warn, error"
      },
      {
        "title": "Basic Usage",
        "body": "The skill automatically handles model failures. No explicit calls needed.\n\n# Trigger a model call (fallback happens automatically on failure)"
      },
      {
        "title": "Manual Fallback",
        "body": "# Force fallback to next model\n/scripts/model-fallback.sh --force-next\n\n# Check current model status\n/scripts/model-fallback.sh --status\n\n# Reset to primary model\n/scripts/model-fallback.sh --reset"
      },
      {
        "title": "Configuration",
        "body": "Edit config.json to customize the fallback chain:\n\n{\n  \"fallback_chain\": [\n    {\"provider\": \"...\", \"model\": \"...\", \"priority\": 1}\n  ],\n  \"health_check\": {\n    \"enabled\": true,\n    \"interval_seconds\": 300\n  }\n}"
      },
      {
        "title": "How It Works",
        "body": "1. User makes request with primary model\n2. Model call fails (error, timeout, rate limit)\n3. Skill detects failure\n4. Wait 3 seconds (debounce)\n5. Switch to next model in chain\n6. Retry request with new model\n7. If successful, return result\n8. If failed, repeat steps 4-7\n9. If all models fail, return error with details"
      },
      {
        "title": "Fallback Triggers",
        "body": "TriggerConditionActionAPI UnavailableConnection timeoutFallbackRate Limit429 responseFallback + waitSlow Response> timeout secondsFallbackInvalid ResponseParse errorFallbackAuth Error401/403 responseLog + stop"
      },
      {
        "title": "Logging",
        "body": "Logs are written to:\n\n~/.openclaw/logs/model-fallback.log"
      },
      {
        "title": "Log Format",
        "body": "[2026-02-27 14:00:00] [INFO] Primary model MiniMax-M2.5 called\n[2026-02-27 14:00:05] [WARN] Model failed: rate limit exceeded\n[2026-02-27 14:00:05] [INFO] Falling back to Kimi K2.5\n[2026-02-27 14:00:10] [INFO] Fallback successful"
      },
      {
        "title": "Cost Optimization",
        "body": "Use cheaper models for simple tasks:\n\n{\n  \"task_routing\": {\n    \"simple_query\": [\"glm-4-air\", \"glm-4-flash\"],\n    \"complex_reasoning\": [\"MiniMax-M2.5\", \"kimi-k2.5\"],\n    \"long_context\": [\"kimi-k2.5\", \"MiniMax-M2.1\"]\n  }\n}"
      },
      {
        "title": "OpenClaw Configuration",
        "body": "Add to openclaw.json:\n\n{\n  \"models\": {\n    \"mode\": \"merge\",\n    \"fallback\": {\n      \"enabled\": true,\n      \"config\": \"~/.openclaw/skills/model-fallback/config.json\"\n    }\n  }\n}"
      },
      {
        "title": "Health Check",
        "body": "Integrate with system health monitoring:\n\n# Check model health\ncurl http://localhost:18789/api/models/health"
      },
      {
        "title": "Fallback Not Working",
        "body": "Check if fallback is enabled: echo $MODEL_FALLBACK_ENABLED\nVerify config exists: ls ~/.openclaw/skills/model-fallback/config.json\nCheck logs: tail -f ~/.openclaw/logs/model-fallback.log"
      },
      {
        "title": "Models Always Failing",
        "body": "Check API keys are valid\nVerify network connectivity\nCheck rate limits on provider dashboard"
      },
      {
        "title": "Example 1: Simple Fallback",
        "body": "User: \"Hello\"\nSystem: Using MiniMax-M2.5...\nSystem: Rate limited, switching to Kimi K2.5...\nSystem: Response from Kimi K2.5: \"Hello! How can I help?\""
      },
      {
        "title": "Example 2: Cost Optimization",
        "body": "User: \"What is 2+2?\"\nSystem: Routing to glm-4-air (low cost)...\nSystem: Response: \"2+2=4\""
      },
      {
        "title": "Example 3: Long Document",
        "body": "User: \"Summarize this 100-page PDF\"\nSystem: Detected long context requirement\nSystem: Routing to Kimi K2.5 (256K context)...\nSystem: Processing..."
      },
      {
        "title": "License",
        "body": "MIT"
      },
      {
        "title": "Author",
        "body": "CC (AI Assistant)"
      },
      {
        "title": "Version",
        "body": "1.0.0"
      }
    ],
    "body": "Model Fallback Skill\n\nMulti-model automatic fallback system for AI agents\n\nOverview\n\nThis 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.\n\nFeatures\nAutomatic Fallback: Seamlessly switch to backup models on failure\nConfigurable Priority: Define your own model fallback order\nHealth Monitoring: Track model availability and response times\nCost Optimization: Use cheaper models for simple tasks\nLogging: Full audit trail of fallback events\nSupported Models\nProvider\tModel\tContext\tUse Case\nMiniMax\tM2.5\t200K\tPrimary (reasoning)\nMiniMax\tM2.1\t200K\tBackup\nKimi\tK2.5\t256K\tLong documents\nKimi\tK2\t128K\tStandard\nZhipu\tGLM-4-Air\t128K\tLow cost\nZhipu\tGLM-4-Flash\t1M\tHigh volume\nConfiguration\nDefault Fallback Chain\n{\n  \"fallback_chain\": [\n    {\n      \"provider\": \"minimax-portal\",\n      \"model\": \"MiniMax-M2.5\",\n      \"priority\": 1,\n      \"timeout\": 30,\n      \"max_retries\": 3\n    },\n    {\n      \"provider\": \"moonshot\",\n      \"model\": \"kimi-k2.5\",\n      \"priority\": 2,\n      \"timeout\": 30,\n      \"max_retries\": 2\n    },\n    {\n      \"provider\": \"zhipu\",\n      \"model\": \"glm-4-air\",\n      \"priority\": 3,\n      \"timeout\": 20,\n      \"max_retries\": 2\n    }\n  ]\n}\n\nEnvironment Variables\nVariable\tRequired\tDescription\nMODEL_FALLBACK_ENABLED\tNo\tEnable/disable fallback (default: true)\nMODEL_FALLBACK_LOG_LEVEL\tNo\tLog level: debug, info, warn, error\nUsage\nBasic Usage\n\nThe skill automatically handles model failures. No explicit calls needed.\n\n# Trigger a model call (fallback happens automatically on failure)\n\nManual Fallback\n# Force fallback to next model\n/scripts/model-fallback.sh --force-next\n\n# Check current model status\n/scripts/model-fallback.sh --status\n\n# Reset to primary model\n/scripts/model-fallback.sh --reset\n\nConfiguration\n\nEdit config.json to customize the fallback chain:\n\n{\n  \"fallback_chain\": [\n    {\"provider\": \"...\", \"model\": \"...\", \"priority\": 1}\n  ],\n  \"health_check\": {\n    \"enabled\": true,\n    \"interval_seconds\": 300\n  }\n}\n\nHow It Works\n1. User makes request with primary model\n2. Model call fails (error, timeout, rate limit)\n3. Skill detects failure\n4. Wait 3 seconds (debounce)\n5. Switch to next model in chain\n6. Retry request with new model\n7. If successful, return result\n8. If failed, repeat steps 4-7\n9. If all models fail, return error with details\n\nFallback Triggers\nTrigger\tCondition\tAction\nAPI Unavailable\tConnection timeout\tFallback\nRate Limit\t429 response\tFallback + wait\nSlow Response\t> timeout seconds\tFallback\nInvalid Response\tParse error\tFallback\nAuth Error\t401/403 response\tLog + stop\nLogging\n\nLogs are written to:\n\n~/.openclaw/logs/model-fallback.log\nLog Format\n[2026-02-27 14:00:00] [INFO] Primary model MiniMax-M2.5 called\n[2026-02-27 14:00:05] [WARN] Model failed: rate limit exceeded\n[2026-02-27 14:00:05] [INFO] Falling back to Kimi K2.5\n[2026-02-27 14:00:10] [INFO] Fallback successful\n\nCost Optimization\n\nUse cheaper models for simple tasks:\n\n{\n  \"task_routing\": {\n    \"simple_query\": [\"glm-4-air\", \"glm-4-flash\"],\n    \"complex_reasoning\": [\"MiniMax-M2.5\", \"kimi-k2.5\"],\n    \"long_context\": [\"kimi-k2.5\", \"MiniMax-M2.1\"]\n  }\n}\n\nIntegration\nOpenClaw Configuration\n\nAdd to openclaw.json:\n\n{\n  \"models\": {\n    \"mode\": \"merge\",\n    \"fallback\": {\n      \"enabled\": true,\n      \"config\": \"~/.openclaw/skills/model-fallback/config.json\"\n    }\n  }\n}\n\nHealth Check\n\nIntegrate with system health monitoring:\n\n# Check model health\ncurl http://localhost:18789/api/models/health\n\nTroubleshooting\nFallback Not Working\nCheck if fallback is enabled: echo $MODEL_FALLBACK_ENABLED\nVerify config exists: ls ~/.openclaw/skills/model-fallback/config.json\nCheck logs: tail -f ~/.openclaw/logs/model-fallback.log\nModels Always Failing\nCheck API keys are valid\nVerify network connectivity\nCheck rate limits on provider dashboard\nExamples\nExample 1: Simple Fallback\nUser: \"Hello\"\nSystem: Using MiniMax-M2.5...\nSystem: Rate limited, switching to Kimi K2.5...\nSystem: Response from Kimi K2.5: \"Hello! How can I help?\"\n\nExample 2: Cost Optimization\nUser: \"What is 2+2?\"\nSystem: Routing to glm-4-air (low cost)...\nSystem: Response: \"2+2=4\"\n\nExample 3: Long Document\nUser: \"Summarize this 100-page PDF\"\nSystem: Detected long context requirement\nSystem: Routing to Kimi K2.5 (256K context)...\nSystem: Processing...\n\nLicense\n\nMIT\n\nAuthor\n\nCC (AI Assistant)\n\nVersion\n\n1.0.0"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/azure5100/model-fallback",
    "publisherUrl": "https://clawhub.ai/azure5100/model-fallback",
    "owner": "azure5100",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/model-fallback",
    "downloadUrl": "https://openagent3.xyz/downloads/model-fallback",
    "agentUrl": "https://openagent3.xyz/skills/model-fallback/agent",
    "manifestUrl": "https://openagent3.xyz/skills/model-fallback/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/model-fallback/agent.md"
  }
}