Skip to main content

hermes-plugin-clawrouter

ClawRouter for Hermes — 66 LLMs from 9 providers, x402 USDC micropayments, smart routing. One local proxy, one wallet, no API keys.

Current catalog headliners: Claude Fable 5 / Opus 4.8 / Sonnet 5, GPT-5.6 (Terra / Sol / Luna), Gemini 3.1 Pro / 3.5 Flash, Grok 4.5, DeepSeek V4 Pro, GLM-5.2, Kimi K2.7, MiniMax M3 — plus 8 free NVIDIA-hosted models that cost nothing to run. Image, video, and web-search tools bill through the same wallet.

Wraps the existing ClawRouter TypeScript proxy as a Hermes plugin. Wallet (BIP-39, Base + Solana), routing (15-dimension scorer), and x402 payment all stay in the canonical TS implementation — this is a thin Python adapter.

Install

Recommended one-command installer:

curl -fsSL https://raw.githubusercontent.com/BlockRunAI/ClawRouter-Hermes/main/scripts/install.sh | bash

The installer checks for Python, pip/venv support, pipx, and Node/npm/npx. On common Linux/macOS package managers it installs missing basics, avoids Debian/Ubuntu's externally-managed-environment / PEP 668 trap by installing the plugin into Hermes' own Python environment, then enables the plugin, runs setup, and prints doctor checks.

Manual install is still fine if you already know where Hermes' Python environment lives:

~/.hermes/hermes-agent/venv/bin/python -m pip install -U hermes-plugin-clawrouter
hermes plugins enable clawrouter
~/.hermes/hermes-agent/venv/bin/hermes-clawrouter setup
~/.hermes/hermes-agent/venv/bin/hermes-clawrouter doctor

If pip install hermes-plugin-clawrouter shows externally-managed-environment, do not use --break-system-packages. Use the installer above, or run pip from Hermes' venv as shown. If hermes says ~/.hermes/hermes-agent/venv/bin/hermes: No such file or directory, reinstall/repair Hermes first, then rerun the ClawRouter installer.

setup writes the model-provider plugin to ~/.hermes/plugins/model-providers/clawrouter/, seeds CLAWROUTER_API_KEY=clawrouter-local in ~/.hermes/.env, and registers ClawRouter in ~/.hermes/config.yaml so Hermes' /model picker can show the provider and curated BlockRun chat models.

Upgrading is just pip install -U. The materialized plugin is stamped with the version that wrote it, so the next Hermes start notices an older stamp and rewrites the plugin in place — no setup --force needed to pick up newly added models. (Before 0.3.16 that refresh never happened, which is why a plain upgrade could leave you on an old model list.)

CLAWROUTER_API_KEY is intentionally a non-secret placeholder. ClawRouter payments use the local wallet/proxy, but Hermes hides API-key-style providers from /model unless the configured key env var exists.

hermes-clawrouter is provided because some Hermes releases do not add plugin-defined top-level CLI commands before the plugin is enabled. Once the plugin is loaded, hermes clawrouter <setup|wallet|doctor|route|stats> may also be available.

If hermes-clawrouter --version shows an older version after updating, your shell may be finding an old ~/.local/bin/hermes-clawrouter from a previous pip --user install. Re-run the one-command installer; it refreshes that launcher to delegate to Hermes' current venv.

Usage

In a Hermes chat:

  • Set model to blockrun/auto to use ClawRouter's smart routing.
  • /clawrouter wallet — address + USDC balance
  • /clawrouter stats — proxy usage stats
  • /clawrouter status — proxy health
  • /clawrouter route <eco|auto|premium> — switch routing profile

Tools (callable from chat):

  • clawrouter_image_generate — 8 image models incl. GPT Image 2, Nano Banana / Pro, Seedream 5 Pro, Grok Imagine, CogView-4
  • clawrouter_video_generate — Seedance 1.5/2.0, Grok Imagine, Sora 2
  • clawrouter_web_search — Exa-powered

Auxiliary vision

Hermes' vision_analyze builds a separate OpenAI client for the configured auxiliary.vision provider. That path is fragile for remote custom endpoints (hermes-agent#38679: Connection error) and for OAuth providers (#38685: silent fallback to auto). Routing vision through ClawRouter sidesteps both — it's a single api_key provider on 127.0.0.1, so there's no OAuth branch to miss and no remote TLS handshake to mishandle. Add to ~/.hermes/config.yaml:

auxiliary:
  vision:
    provider: clawrouter
    model: blockrun/auto          # or google/gemini-2.5-pro, anthropic/claude-sonnet-4.6
    base_url: http://127.0.0.1:8402/v1
    api_key: clawrouter-local
    timeout: 120

setup does not write this automatically — it would overwrite an existing vision config — so add it by hand if you want vision through ClawRouter, then hermes gateway restart.

Wallet

The plugin reads the canonical wallet at ~/.openclaw/blockrun/mnemonic (24-word BIP-39 phrase, mode 0o600). To create one:

npx @blockrun/clawrouter setup

Then fund USDC on Base or Solana — $5 covers thousands of requests, non-custodial. The plugin never writes to the wallet.

Headless / CI

Set BLOCKRUN_WALLET_KEY=<0x raw EVM hex> to bypass the mnemonic file (EVM-only — Solana derivation unavailable).

Environment variables

Variable Effect
CLAWROUTER_PROXY_URL Point at an externally-managed proxy (e.g. https://my-host/v1). Skips local spawn entirely.
HERMES_CLAWROUTER_AUTOSPAWN=0 Disable lazy spawn; require npx @blockrun/clawrouter to be running already.
BLOCKRUN_WALLET_KEY Raw EVM hex private key — overrides the mnemonic file.
CLAWROUTER_ROUTING_PROFILE eco / auto / premium. Forwarded to the proxy on spawn.

Guides

Troubleshooting and how-to articles for common Hermes provider/vision setups. Each is a standalone problem→solution walkthrough:

Guide When you need it
vision_analyze "Connection error" on a custom provider Chat works but vision_analyze returns Connection error on a custom OpenAI-compatible endpoint (hermes-agent#38679)
Auxiliary vision falls back to "auto" with an OAuth provider auxiliary.vision.provider (e.g. minimax-oauth) logs unhandled auth_type and silently degrades (#38685)
Run GPT-5, Claude, Gemini & DeepSeek from one endpoint You want many models in Hermes without a separate provider/key block per model
Pay-per-call LLM access — no API keys You'd rather pay per request with USDC than manage and rotate provider API keys
Behind an HTTP proxy/VPN: timeouts, 500s, Premature close Small requests work but large agentic requests 500 or time out after payment — your proxy (mihomo/clash/corporate) isn't being used by ClawRouter's upstream traffic
Retry-and-repay loop: Invalid character in header content ["x-clawrouter-reasoning"] Non-English prompts (Cyrillic/CJK) on ClawRouter ≤ 0.12.207 crash response delivery after payment settles; Hermes retries and re-pays the same request

How it works

  1. hermes starts → the entry-point plugin is loaded → register(ctx) wires tools, slash commands, CLI, and the skill.
  2. hermes-clawrouter setup materializes ~/.hermes/plugins/model-providers/clawrouter/{plugin.yaml,__init__.py} from bundled package data and writes Hermes config/env hints needed by current Hermes provider and gateway model-picker paths.
  3. Hermes' providers/__init__.py discovers the materialized directory and registers the ClawRouterProfile, pointing base_url at http://127.0.0.1:<port>/v1.
  4. First tool call or chat turn → the supervisor probes :8402, spawns npx -y @blockrun/clawrouter --port <port> if needed, waits ≤30s for /v1/models, then forwards the request.
  5. A heartbeat thread restarts the subprocess on death (max 3 restarts/min).

Distribution

The Python package ships both logical plugins:

  • Standalone plugin (this PyPI entry point): tools, slash commands, CLI, skill.
  • Model-provider plugin (materialized into ~/.hermes/plugins/model-providers/clawrouter/ by hermes clawrouter setup): ProviderProfile registration.

This split is required because Hermes' PluginManager (hermes_cli/plugins.py) skips register(ctx) for kind: model-provider, and entry-point plugins always load as kind: standalone.

Development

pip install -e ".[dev]"
pytest

License

MIT. © BlockRun.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_plugin_clawrouter-0.3.17.tar.gz (53.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_plugin_clawrouter-0.3.17-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file hermes_plugin_clawrouter-0.3.17.tar.gz.

File metadata

File hashes

Hashes for hermes_plugin_clawrouter-0.3.17.tar.gz
Algorithm Hash digest
SHA256 b9da8a22bbc752a63ae93998a0c3b051478771f07845bacebd004d54fad87d09
MD5 e2821f0a88736c82e13adb6533e36c7e
BLAKE2b-256 b78bbb3a5150bc756b12bd0d652ef30b6fa152154282e47a28a715049132a016

See more details on using hashes here.

File details

Details for the file hermes_plugin_clawrouter-0.3.17-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_plugin_clawrouter-0.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf190a523e21026f24e8e8259cafa85471766a889669ccd5136476c6fab05e5
MD5 7f1f5f1f922cc1fa13491c896c192383
BLAKE2b-256 58faf7ead5b75ee6481b06db12092689f40d2c438a4bc7707994aa5f4b6943d5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.19

2 files

0.3.18

2 files

This release

0.3.17 This release

2 files

0.3.16

2 files

0.3.15

2 files

0.3.14

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page