← 返回 Skills 市场
neuralshift1

Iblai Openclaw Router

作者 Neuralshift1 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
602
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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....
使用说明 (SKILL.md)

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 (\x3C1ms 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:

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:

{
  "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.

安全使用建议
This package implements a local proxy and will install a systemd service and modify your OpenClaw config. Before installing: 1) Inspect server.js and config.json yourself to confirm behavior and upstream URLs. 2) Edit scripts/install.sh to avoid auto-extracting your API key (the script greps ~/.openclaw/agents/main/agent/auth-profiles.json) — do not allow the installer to embed secrets into /etc/systemd/system/*.service. Prefer using an EnvironmentFile with restricted permissions or systemd secret mechanisms, or export ANTHROPIC_API_KEY at runtime instead. 3) Back up ~/.openclaw/openclaw.json and test registration manually rather than letting the installer modify it automatically. 4) If you must run it, run in an isolated environment (container or VM) first and verify that the router only forwards to your configured LLM provider. 5) After install, check /etc/systemd/system/iblai-router.service for embedded secrets and remove/rotate any secret that was written there. The inconsistencies (metadata claiming no env vars / instruction-only vs included code that needs a key and writes configs) are likely sloppy engineering but could expose secrets if installed without care.
功能分析
Type: OpenClaw Skill Name: iblai-openclaw-router Version: 1.0.0 The skill bundle is classified as suspicious due to two primary vulnerabilities, despite its stated benign purpose of cost-optimizing model routing. First, the `scripts/install.sh` script reads the sensitive `~/.openclaw/agents/main/agent/auth-profiles.json` file to auto-detect the Anthropic API key. While this key is intended for local use by the systemd service, accessing this credential file is a high-risk operation. Second, the `server.js` proxy allows the `apiBaseUrl` to be configured in `config.json` to an arbitrary endpoint. If an attacker could manipulate `config.json` (e.g., via prompt injection against the agent), this could lead to the exfiltration of the API key and all LLM prompt/response data to an attacker-controlled server. While the documentation suggests legitimate use with OpenRouter, the underlying capability is a significant vulnerability. These are risky capabilities without clear evidence of intentional malicious exploitation within the provided files, hence 'suspicious' rather than 'malicious'.
能力评估
Purpose & Capability
The code and README implement a local Anthropic/OpenRouter proxy which matches the stated purpose. However the registry metadata declared 'no required env vars' and 'instruction-only' while the package includes server.js and install scripts that require an ANTHROPIC_API_KEY and create a systemd service — an incoherence between claims and actual requirements.
Instruction Scope
SKILL.md and README instruct running scripts that will copy files to ~/.openclaw/workspace/router, create/enable a systemd service, and modify ~/.openclaw/openclaw.json to register the provider. The installer also attempts to auto-detect an Anthropic key by grepping ~/.openclaw/agents/main/agent/auth-profiles.json. Reading/writing other agent config and extracting API keys is outside a purely 'instruction-only' description and broadens scope.
Install Mechanism
Install is local (no external downloads) and just copies files and creates a systemd unit. That itself is reasonable for a local proxy, but the installer writes the detected Anthropic API key directly into the systemd unit (Environment=ANTHROPIC_API_KEY=...). Embedding secrets into unit files can expose them to other users/processes and is poor secret management.
Credentials
The package metadata declares no required env vars, but server.js requires ANTHROPIC_API_KEY and the install script actively searches for the user's Anthropic key and places it into the unit file. The README also suggests configuring 'apiKey passthrough' in OpenClaw, but the router ignores incoming x-api-key and uses the environment key — this mismatch is confusing and potentially leads to unexpected key usage/exposure.
Persistence & Privilege
The installer creates a persistent systemd service (Restart=always) and registers a model provider in OpenClaw config. Persistent local services and config changes are expected for this functionality, but combined with the secret-handling behavior above this persistence increases the blast radius if misconfigured.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install iblai-openclaw-router
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /iblai-openclaw-router 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 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.
元数据
Slug iblai-openclaw-router
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 602 次。

如何安装 Iblai Openclaw Router?

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

Iblai Openclaw Router 是免费的吗?

是的,Iblai Openclaw Router 完全免费(开源免费),可自由下载、安装和使用。

Iblai Openclaw Router 支持哪些平台?

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

谁开发了 Iblai Openclaw Router?

由 Neuralshift1(@neuralshift1)开发并维护,当前版本 v1.0.0。

💬 留言讨论