返回顶部
i

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
541
下载量
0
收藏
概述
安装方式
版本历史

iblai-router

# 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 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 ```bash 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: | Scope | How | |---|---| | Cron job | Set `model` to `iblai-router/auto` in job config | | Subagents | `agents.defaults.subagents.model = "iblai-router/auto"` | | Per-session | `/model iblai-router/auto` | | All sessions | `agents.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: ```json { "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: ```json { "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](https://github.com/iblai/iblai-openclaw-router) for details. ## Uninstall ```bash 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.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 iblai-openclaw-router-1776420056 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 iblai-openclaw-router-1776420056 技能

通过命令行安装

skillhub install iblai-openclaw-router-1776420056

下载 Zip 包

⬇ 下载 iblai-router v1.0.0

文件大小: 22.03 KB | 发布时间: 2026-4-17 19:50

v1.0.0 最新 2026-4-17 19:50
- Initial release of iblai-router: a zero-dependency, cost-optimizing proxy for OpenClaw.
- Automatically routes requests to the cheapest capable Claude model (Haiku, Sonnet, Opus) using a weighted scoring system.
- Supports Anthropic models directly; OpenAI and Google models supported via OpenRouter integration.
- Easy installation, health verification, and customizable configuration without service restarts.
- Scoring algorithm leverages keyword lists to select appropriate model tier for each request.
- Includes simple uninstall script and guidance for safely switching workloads.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部