← 返回 Skills 市场
larios613-hub

Model Routing Middleware

作者 larios613-hub · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ pending
50
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install model-routing-middleware
功能描述
Intelligent model selection middleware for AI agents. Route tasks to the best model, manage context, and cut API costs 40-70%.
使用说明 (SKILL.md)

Model Routing — Intelligent Model Selection Middleware

Automatically select the best LLM model and think mode based on task type, context size, and response confidence. Cut API costs 40-70% by routing simple tasks to fast models and complex tasks to capable ones.

How It Works

User message → Task Classifier → Model Router → Best Model → Response
                                     ↓
                          Low confidence? → Escalate to stronger model

Quick Start

# config.yaml
models:
  casual_chat:
    model: qwen3-14b
    think: false
  coding:
    model: qwen-coder
    think: true
  reasoning:
    model: deepseek-r1
    think: true
  long_context:
    model: glm-5.1
    think: false
from router import get_router

router = get_router()
result = await router.route("Write a Python web scraper")
# → Routes to qwen-coder with think=True

Features

  • Task-type classification (coding, reasoning, chat, summarization)
  • Per-model think mode configuration
  • Confidence-based escalation (retry with stronger model)
  • Context management and compaction at 55% threshold
  • Hot-reload configuration (no restart needed)
  • 83 tests passing

Cost Savings

Task Type Without Routing With Routing Savings
Casual chat GPT-4 ($0.03/1K) Qwen3-14B (local) ~100%
Coding GPT-4 ($0.03/1K) Qwen-Coder (local) ~95%
Hard reasoning GPT-4 ($0.03/1K) DeepSeek-R1 (local) ~90%

License

MIT

如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install model-routing-middleware
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /model-routing-middleware 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - intelligent model selection, cost optimization, confidence escalation
元数据
Slug model-routing-middleware
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Model Routing Middleware 是什么?

Intelligent model selection middleware for AI agents. Route tasks to the best model, manage context, and cut API costs 40-70%. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 50 次。

如何安装 Model Routing Middleware?

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

Model Routing Middleware 是免费的吗?

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

Model Routing Middleware 支持哪些平台?

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

谁开发了 Model Routing Middleware?

由 larios613-hub(@larios613-hub)开发并维护,当前版本 v1.0.0。

💬 留言讨论