← 返回
AI智能 中文

Iblai Openclaw Router

Cost-optimizing model router for OpenClaw. Automatically routes each request to the cheapest capable Claude model (Haiku/Sonnet/Opus) using weighted scoring....
OpenClaw的成本优化模型路由器。利用加权评分自动将每个请求路由至最具成本效益且胜任的Claude模型(Haiku/Sonnet/Opus)。
neuralshift1
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 915
下载
💾 19
安装
1
版本
#latest

概述

iblai-router

A zero-dependency proxy that sits between OpenClaw and the Anthropic API, routing each request to the cheapest capable model using a 14-dimension weighted scorer (<1ms overhead).

Install

Run the install script to set up everything automatically:

bash "$(dirname "$0")/scripts/install.sh"

This will:

  1. Copy server.js and config.json to ~/.openclaw/workspace/router/
  2. Create and start a systemd service (iblai-router) on port 8402
  3. Register iblai-router/auto as an OpenClaw model provider

After install, iblai-router/auto is available anywhere OpenClaw accepts a model ID.

Verify

curl -s http://127.0.0.1:8402/health | jq .
curl -s http://127.0.0.1:8402/stats | jq .

Use

Set iblai-router/auto as the model for any scope:

ScopeHow
------
Cron jobSet model to iblai-router/auto in job config
Subagentsagents.defaults.subagents.model = "iblai-router/auto"
Per-session/model iblai-router/auto
All sessionsagents.defaults.model.primary = "iblai-router/auto"

Tip: Keep the main interactive session on a fixed model (e.g. Opus). Use the router for cron jobs, subagents, and background tasks where cost savings compound.

Customize

All config lives in ~/.openclaw/workspace/router/config.json and hot-reloads on save — no restart needed.

Models

Change the models per tier:

{
  "models": {
    "LIGHT":  "claude-3-5-haiku-20241022",
    "MEDIUM": "claude-sonnet-4-20250514",
    "HEAVY":  "claude-opus-4-20250514"
  }
}

Non-Anthropic models (OpenAI, Google)

Set apiBaseUrl to route through OpenRouter:

{
  "models": {
    "LIGHT":  "openai/gpt-4.1-mini",
    "MEDIUM": "openai/gpt-4.1",
    "HEAVY":  "openai/o3"
  },
  "apiBaseUrl": "https://openrouter.ai/api/v1"
}

Update the API key in the systemd service when switching providers, then systemctl daemon-reload && systemctl restart iblai-router.

Scoring

Keyword lists control which tier handles a request:

  • simpleKeywords, relayKeywords → push toward LIGHT (cheap)
  • imperativeVerbs, codeKeywords, agenticKeywords → push toward MEDIUM
  • technicalKeywords, reasoningKeywords, domainKeywords → push toward HEAVY (capable)

Tune boundaries and weights in config.json to match your workload. See the full README for details.

Uninstall

bash "$(dirname "$0")/scripts/uninstall.sh"

Stops the service, removes the systemd unit, and deletes router files. Reminder: switch any workloads using iblai-router/auto back to a direct model first.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 10:17 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Gmail Last5

neuralshift1
使用 gog 获取并显示 Gmail 收件箱中最近 5 封唯一邮件的发件人、主题和日期。
★ 0 📥 231
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,684
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,354 📥 317,971