技能标识:iblai-router
Cost-optimizing model router for OpenClaw. Automatically routes each request to the cheapest capable Claude model (Haiku/Sonnet/Opus) using weighted scoring. Use when setting up smart model routing, reducing API costs, or configuring multi-tier LLM routing. Supports Anthropic models directly and OpenAI/Google models via OpenRouter.
一个零依赖代理,位于OpenClaw与Anthropic API之间,使用14维加权评分器(开销<1毫秒)将每个请求路由到最便宜的可用模型。
运行安装脚本以自动完成所有设置:
bash
bash $(dirname $0)/scripts/install.sh
此操作将:
安装完成后,iblai-router/auto可在任何OpenClaw接受模型ID的地方使用。
bash
curl -s http://127.0.0.1:8402/health | jq .
curl -s http://127.0.0.1:8402/stats | jq .
将iblai-router/auto设置为任何作用域的模型:
| 作用域 | 方法 |
|---|---|
| 定时任务 | 在任务配置中将model设置为iblai-router/auto |
| 子代理 |
提示: 将主要交互会话保留在固定模型上(例如Opus)。将路由器用于定时任务、子代理和后台任务,这些场景下成本节省会不断累积。
所有配置位于~/.openclaw/workspace/router/config.json,保存后热重载——无需重启。
按层级更改模型:
json
{
models: {
LIGHT: claude-3-5-haiku-20241022,
MEDIUM: claude-sonnet-4-20250514,
HEAVY: claude-opus-4-20250514
}
}
设置apiBaseUrl以通过OpenRouter路由:
json
{
models: {
LIGHT: openai/gpt-4.1-mini,
MEDIUM: openai/gpt-4.1,
HEAVY: openai/o3
},
apiBaseUrl: https://openrouter.ai/api/v1
}
切换提供商时更新systemd服务中的API密钥,然后执行systemctl daemon-reload && systemctl restart iblai-router。
关键词列表控制哪个层级处理请求:
在config.json中调整边界和权重以匹配您的工作负载。详情请参阅完整README。
bash
bash $(dirname $0)/scripts/uninstall.sh
停止服务,移除systemd单元,并删除路由器文件。提醒:请先将任何使用iblai-router/auto的工作负载切换回直接模型。
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 iblai-openclaw-router-1776420056 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 iblai-openclaw-router-1776420056 技能
skillhub install iblai-openclaw-router-1776420056
文件大小: 22.03 KB | 发布时间: 2026-4-17 19:50