{
  "schemaVersion": "1.0",
  "item": {
    "slug": "model-router",
    "name": "Model Router",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/digitaladaption/model-router",
    "canonicalUrl": "https://clawhub.ai/digitaladaption/model-router",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/model-router",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=model-router",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/USAGE_EXAMPLES.md",
      "references/model-specs.md",
      "scripts/classify_task.py",
      "scripts/setup-wizard.py"
    ],
    "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",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/model-router"
    },
    "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-router",
    "agentPageUrl": "https://openagent3.xyz/skills/model-router/agent",
    "manifestUrl": "https://openagent3.xyz/skills/model-router/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/model-router/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 Router",
        "body": "Intelligent AI model routing across multiple providers for optimal cost-performance balance.\n\nAutomatically select the best model for any task based on complexity, type, and your preferences. Support for 6 major AI providers with secure API key management and interactive configuration."
      },
      {
        "title": "🎯 What It Does",
        "body": "Analyzes tasks and classifies them by type (coding, research, creative, simple, etc.)\nRoutes to optimal models from your configured providers\nOptimizes costs by using cheaper models for simple tasks\nSecures API keys with file permissions (600) and isolated storage\nProvides recommendations with confidence scoring and reasoning"
      },
      {
        "title": "Step 1: Run the Setup Wizard",
        "body": "cd skills/model-router\npython3 scripts/setup-wizard.py\n\nThe wizard will guide you through:\n\nProvider setup - Add your API keys (Anthropic, OpenAI, Gemini, etc.)\nTask mappings - Choose which model for each task type\nPreferences - Set cost optimization level"
      },
      {
        "title": "Step 2: Use the Classifier",
        "body": "# Get model recommendation for a task\npython3 scripts/classify_task.py \"Build a React authentication system\"\n\n# Output:\n# Recommended Model: claude-sonnet\n# Confidence: 85%\n# Cost Level: medium\n# Reasoning: Matched 2 keywords: build, system"
      },
      {
        "title": "Step 3: Route Tasks with Sessions",
        "body": "# Spawn with recommended model\nsessions_spawn --task \"Debug this memory leak\" --model claude-sonnet\n\n# Use aliases for quick access\nsessions_spawn --task \"What's the weather?\" --model haiku"
      },
      {
        "title": "📊 Supported Providers",
        "body": "ProviderModelsBest ForKey FormatAnthropicclaude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5Coding, reasoning, creativesk-ant-...OpenAIgpt-4o, gpt-4o-mini, o1-mini, o1-previewTools, deep reasoningsk-proj-...Geminigemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flashMultimodal, huge context (2M)AIza...Moonshotmoonshot-v1-8k/32k/128kChinese languagesk-...Z.aiglm-4.5-air, glm-4.7Cheapest, fastVariousGLMglm-4-flash, glm-4-plus, glm-4-0520Chinese, codingID.secret"
      },
      {
        "title": "🎛️ Task Type Mappings",
        "body": "Default routing (customizable via wizard):\n\nTask TypeDefault ModelWhysimpleglm-4.5-airFastest, cheapest for quick queriescodingclaude-sonnet-4-5Excellent code understandingresearchclaude-sonnet-4-5Balanced depth and speedcreativeclaude-opus-4-5Maximum creativitymatho1-miniSpecialized reasoningvisiongemini-1.5-flashFast multimodalchineseglm-4.7Optimized for Chineselong_contextgemini-1.5-proUp to 2M tokens"
      },
      {
        "title": "Aggressive Mode",
        "body": "Always uses the cheapest capable model:\n\nSimple → glm-4.5-air (~10% cost)\nCoding → claude-haiku-4-5 (~25% cost)\nResearch → claude-sonnet-4-5 (~50% cost)\n\nSavings: 50-90% compared to always using premium models"
      },
      {
        "title": "Balanced Mode (Default)",
        "body": "Considers cost vs quality:\n\nSimple tasks → Cheap models\nCritical tasks → Premium models\nAutomatic escalation if cheap model fails"
      },
      {
        "title": "Quality Mode",
        "body": "Always uses the best model regardless of cost"
      },
      {
        "title": "API Key Storage",
        "body": "~/.model-router/\n├── config.json       # Model mappings (chmod 600)\n└── .api-keys         # API keys (chmod 600)\n\nFeatures:\n\nFile permissions restricted to owner (600)\nIsolated from version control\nEncrypted at rest (via OS filesystem encryption)\nNever logged or printed"
      },
      {
        "title": "Best Practices",
        "body": "Never commit .api-keys to version control\nUse environment variables for production deployments\nRotate keys regularly via the wizard\nAudit access with ls -la ~/.model-router/"
      },
      {
        "title": "Example 1: Cost-Optimized Workflow",
        "body": "# Classify task first\npython3 scripts/classify_task.py \"Extract prices from this CSV\"\n\n# Result: simple task → use glm-4.5-air\nsessions_spawn --task \"Extract prices\" --model glm-4.5-air\n\n# Then analyze with better model if needed\nsessions_spawn --task \"Analyze price trends\" --model claude-sonnet"
      },
      {
        "title": "Example 2: Progressive Escalation",
        "body": "# Try cheap model first (60s timeout)\nsessions_spawn --task \"Fix this bug\" --model glm-4.5-air --runTimeoutSeconds 60\n\n# If fails, escalate to premium\nsessions_spawn --task \"Fix complex architecture bug\" --model claude-opus"
      },
      {
        "title": "Example 3: Parallel Processing",
        "body": "# Batch simple tasks in parallel with cheap model\nsessions_spawn --task \"Summarize doc A\" --model glm-4.5-air &\nsessions_spawn --task \"Summarize doc B\" --model glm-4.5-air &\nsessions_spawn --task \"Summarize doc C\" --model glm-4.5-air &\nwait"
      },
      {
        "title": "Example 4: Multimodal with Gemini",
        "body": "# Vision task with 2M token context\nsessions_spawn --task \"Analyze these 100 images\" --model gemini-1.5-pro"
      },
      {
        "title": "~/.model-router/config.json",
        "body": "{\n  \"version\": \"1.1.0\",\n  \"providers\": {\n    \"anthropic\": {\n      \"configured\": true,\n      \"models\": [\"claude-opus-4-5\", \"claude-sonnet-4-5\", \"claude-haiku-4-5\"]\n    },\n    \"openai\": {\n      \"configured\": true,\n      \"models\": [\"gpt-4o\", \"gpt-4o-mini\", \"o1-mini\", \"o1-preview\"]\n    }\n  },\n  \"task_mappings\": {\n    \"simple\": \"glm-4.5-air\",\n    \"coding\": \"claude-sonnet-4-5\",\n    \"research\": \"claude-sonnet-4-5\",\n    \"creative\": \"claude-opus-4-5\"\n  },\n  \"preferences\": {\n    \"cost_optimization\": \"balanced\",\n    \"default_provider\": \"anthropic\"\n  }\n}"
      },
      {
        "title": "~/.model-router/.api-keys",
        "body": "# Generated by setup wizard - DO NOT edit manually\nANTHROPIC_API_KEY=sk-ant-...\nOPENAI_API_KEY=sk-proj-...\nGEMINI_API_KEY=AIza..."
      },
      {
        "title": "New Features",
        "body": "✅ Interactive setup wizard for guided configuration\n✅ Secure API key storage with file permissions\n✅ Task-to-model mapping customization\n✅ Multi-provider support (6 providers)\n✅ Cost optimization levels (aggressive/balanced/quality)"
      },
      {
        "title": "Improvements",
        "body": "✅ Better task classification with confidence scores\n✅ Provider-specific model recommendations\n✅ Enhanced security with isolated storage\n✅ Comprehensive documentation"
      },
      {
        "title": "Migration from 1.0",
        "body": "Run the setup wizard to reconfigure:\n\npython3 scripts/setup-wizard.py"
      },
      {
        "title": "Setup Wizard",
        "body": "python3 scripts/setup-wizard.py\n\nInteractive configuration of providers, mappings, and preferences."
      },
      {
        "title": "Task Classifier",
        "body": "python3 scripts/classify_task.py \"your task description\"\npython3 scripts/classify_task.py \"your task\" --format json\n\nGet model recommendation with reasoning."
      },
      {
        "title": "List Models",
        "body": "python3 scripts/setup-wizard.py --list\n\nShow all available models and their status."
      },
      {
        "title": "🤝 Integration with Other Skills",
        "body": "SkillIntegrationmodel-usageTrack cost per provider to optimize routingsessions_spawnPrimary tool for model delegationsession_statusCheck current model and usage"
      },
      {
        "title": "⚡ Performance Tips",
        "body": "Start simple - Try cheap models first\nBatch tasks - Combine multiple simple tasks\nUse cleanup - Delete sessions after one-off tasks\nSet timeouts - Prevent runaway sub-agents\nMonitor usage - Track costs per provider"
      },
      {
        "title": "\"No suitable model found\"",
        "body": "Run setup wizard to configure providers\nCheck API keys are valid\nVerify permissions on .api-keys file"
      },
      {
        "title": "\"Module not found\"",
        "body": "pip3 install -r requirements.txt  # if needed"
      },
      {
        "title": "Wrong model selected",
        "body": "Customize task mappings via wizard\nUse explicit model in sessions_spawn --model\nAdjust cost optimization preference"
      },
      {
        "title": "📖 Additional Resources",
        "body": "Provider Docs:\n\nAnthropic\nOpenAI\nGemini\nMoonshot\nZ.ai\nGLM\n\n\n\nSetup: Run python3 scripts/setup-wizard.py\n\n\nSupport: Check references/ folder for detailed guides"
      }
    ],
    "body": "Model Router\n\nIntelligent AI model routing across multiple providers for optimal cost-performance balance.\n\nAutomatically select the best model for any task based on complexity, type, and your preferences. Support for 6 major AI providers with secure API key management and interactive configuration.\n\n🎯 What It Does\nAnalyzes tasks and classifies them by type (coding, research, creative, simple, etc.)\nRoutes to optimal models from your configured providers\nOptimizes costs by using cheaper models for simple tasks\nSecures API keys with file permissions (600) and isolated storage\nProvides recommendations with confidence scoring and reasoning\n🚀 Quick Start\nStep 1: Run the Setup Wizard\ncd skills/model-router\npython3 scripts/setup-wizard.py\n\n\nThe wizard will guide you through:\n\nProvider setup - Add your API keys (Anthropic, OpenAI, Gemini, etc.)\nTask mappings - Choose which model for each task type\nPreferences - Set cost optimization level\nStep 2: Use the Classifier\n# Get model recommendation for a task\npython3 scripts/classify_task.py \"Build a React authentication system\"\n\n# Output:\n# Recommended Model: claude-sonnet\n# Confidence: 85%\n# Cost Level: medium\n# Reasoning: Matched 2 keywords: build, system\n\nStep 3: Route Tasks with Sessions\n# Spawn with recommended model\nsessions_spawn --task \"Debug this memory leak\" --model claude-sonnet\n\n# Use aliases for quick access\nsessions_spawn --task \"What's the weather?\" --model haiku\n\n📊 Supported Providers\nProvider\tModels\tBest For\tKey Format\nAnthropic\tclaude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5\tCoding, reasoning, creative\tsk-ant-...\nOpenAI\tgpt-4o, gpt-4o-mini, o1-mini, o1-preview\tTools, deep reasoning\tsk-proj-...\nGemini\tgemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash\tMultimodal, huge context (2M)\tAIza...\nMoonshot\tmoonshot-v1-8k/32k/128k\tChinese language\tsk-...\nZ.ai\tglm-4.5-air, glm-4.7\tCheapest, fast\tVarious\nGLM\tglm-4-flash, glm-4-plus, glm-4-0520\tChinese, coding\tID.secret\n🎛️ Task Type Mappings\n\nDefault routing (customizable via wizard):\n\nTask Type\tDefault Model\tWhy\nsimple\tglm-4.5-air\tFastest, cheapest for quick queries\ncoding\tclaude-sonnet-4-5\tExcellent code understanding\nresearch\tclaude-sonnet-4-5\tBalanced depth and speed\ncreative\tclaude-opus-4-5\tMaximum creativity\nmath\to1-mini\tSpecialized reasoning\nvision\tgemini-1.5-flash\tFast multimodal\nchinese\tglm-4.7\tOptimized for Chinese\nlong_context\tgemini-1.5-pro\tUp to 2M tokens\n💰 Cost Optimization\nAggressive Mode\n\nAlways uses the cheapest capable model:\n\nSimple → glm-4.5-air (~10% cost)\nCoding → claude-haiku-4-5 (~25% cost)\nResearch → claude-sonnet-4-5 (~50% cost)\n\nSavings: 50-90% compared to always using premium models\n\nBalanced Mode (Default)\n\nConsiders cost vs quality:\n\nSimple tasks → Cheap models\nCritical tasks → Premium models\nAutomatic escalation if cheap model fails\nQuality Mode\n\nAlways uses the best model regardless of cost\n\n🔒 Security\nAPI Key Storage\n~/.model-router/\n├── config.json       # Model mappings (chmod 600)\n└── .api-keys         # API keys (chmod 600)\n\n\nFeatures:\n\nFile permissions restricted to owner (600)\nIsolated from version control\nEncrypted at rest (via OS filesystem encryption)\nNever logged or printed\nBest Practices\nNever commit .api-keys to version control\nUse environment variables for production deployments\nRotate keys regularly via the wizard\nAudit access with ls -la ~/.model-router/\n📖 Usage Examples\nExample 1: Cost-Optimized Workflow\n# Classify task first\npython3 scripts/classify_task.py \"Extract prices from this CSV\"\n\n# Result: simple task → use glm-4.5-air\nsessions_spawn --task \"Extract prices\" --model glm-4.5-air\n\n# Then analyze with better model if needed\nsessions_spawn --task \"Analyze price trends\" --model claude-sonnet\n\nExample 2: Progressive Escalation\n# Try cheap model first (60s timeout)\nsessions_spawn --task \"Fix this bug\" --model glm-4.5-air --runTimeoutSeconds 60\n\n# If fails, escalate to premium\nsessions_spawn --task \"Fix complex architecture bug\" --model claude-opus\n\nExample 3: Parallel Processing\n# Batch simple tasks in parallel with cheap model\nsessions_spawn --task \"Summarize doc A\" --model glm-4.5-air &\nsessions_spawn --task \"Summarize doc B\" --model glm-4.5-air &\nsessions_spawn --task \"Summarize doc C\" --model glm-4.5-air &\nwait\n\nExample 4: Multimodal with Gemini\n# Vision task with 2M token context\nsessions_spawn --task \"Analyze these 100 images\" --model gemini-1.5-pro\n\n🛠️ Configuration Files\n~/.model-router/config.json\n{\n  \"version\": \"1.1.0\",\n  \"providers\": {\n    \"anthropic\": {\n      \"configured\": true,\n      \"models\": [\"claude-opus-4-5\", \"claude-sonnet-4-5\", \"claude-haiku-4-5\"]\n    },\n    \"openai\": {\n      \"configured\": true,\n      \"models\": [\"gpt-4o\", \"gpt-4o-mini\", \"o1-mini\", \"o1-preview\"]\n    }\n  },\n  \"task_mappings\": {\n    \"simple\": \"glm-4.5-air\",\n    \"coding\": \"claude-sonnet-4-5\",\n    \"research\": \"claude-sonnet-4-5\",\n    \"creative\": \"claude-opus-4-5\"\n  },\n  \"preferences\": {\n    \"cost_optimization\": \"balanced\",\n    \"default_provider\": \"anthropic\"\n  }\n}\n\n~/.model-router/.api-keys\n# Generated by setup wizard - DO NOT edit manually\nANTHROPIC_API_KEY=sk-ant-...\nOPENAI_API_KEY=sk-proj-...\nGEMINI_API_KEY=AIza...\n\n🔄 Version 1.1 Changes\nNew Features\n✅ Interactive setup wizard for guided configuration\n✅ Secure API key storage with file permissions\n✅ Task-to-model mapping customization\n✅ Multi-provider support (6 providers)\n✅ Cost optimization levels (aggressive/balanced/quality)\nImprovements\n✅ Better task classification with confidence scores\n✅ Provider-specific model recommendations\n✅ Enhanced security with isolated storage\n✅ Comprehensive documentation\nMigration from 1.0\n\nRun the setup wizard to reconfigure:\n\npython3 scripts/setup-wizard.py\n\n📚 Command Reference\nSetup Wizard\npython3 scripts/setup-wizard.py\n\n\nInteractive configuration of providers, mappings, and preferences.\n\nTask Classifier\npython3 scripts/classify_task.py \"your task description\"\npython3 scripts/classify_task.py \"your task\" --format json\n\n\nGet model recommendation with reasoning.\n\nList Models\npython3 scripts/setup-wizard.py --list\n\n\nShow all available models and their status.\n\n🤝 Integration with Other Skills\nSkill\tIntegration\nmodel-usage\tTrack cost per provider to optimize routing\nsessions_spawn\tPrimary tool for model delegation\nsession_status\tCheck current model and usage\n⚡ Performance Tips\nStart simple - Try cheap models first\nBatch tasks - Combine multiple simple tasks\nUse cleanup - Delete sessions after one-off tasks\nSet timeouts - Prevent runaway sub-agents\nMonitor usage - Track costs per provider\n🐛 Troubleshooting\n\"No suitable model found\"\nRun setup wizard to configure providers\nCheck API keys are valid\nVerify permissions on .api-keys file\n\"Module not found\"\npip3 install -r requirements.txt  # if needed\n\nWrong model selected\nCustomize task mappings via wizard\nUse explicit model in sessions_spawn --model\nAdjust cost optimization preference\n📖 Additional Resources\n\nProvider Docs:\n\nAnthropic\nOpenAI\nGemini\nMoonshot\nZ.ai\nGLM\n\nSetup: Run python3 scripts/setup-wizard.py\n\nSupport: Check references/ folder for detailed guides"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/digitaladaption/model-router",
    "publisherUrl": "https://clawhub.ai/digitaladaption/model-router",
    "owner": "digitaladaption",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/model-router",
    "downloadUrl": "https://openagent3.xyz/downloads/model-router",
    "agentUrl": "https://openagent3.xyz/skills/model-router/agent",
    "manifestUrl": "https://openagent3.xyz/skills/model-router/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/model-router/agent.md"
  }
}