ClawRouter for Hermes — 55+ models, x402 USDC micropayments, smart routing
Project description
hermes-plugin-clawrouter
ClawRouter for Hermes — 55+ LLMs, x402 USDC micropayments, smart routing.
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
pip install hermes-plugin-clawrouter
hermes plugins enable clawrouter
hermes-clawrouter setup
hermes-clawrouter doctor
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.
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.
Usage
In a Hermes chat:
- Set model to
blockrun/autoto 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— 55+ models incl. DALL-E 3, Flux, Nano Bananaclawrouter_video_generate— Seedance, Grok Imagineclawrouter_web_search— Exa-powered
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. |
How it works
hermesstarts → the entry-point plugin is loaded →register(ctx)wires tools, slash commands, CLI, and the skill.hermes-clawrouter setupmaterializes~/.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.- Hermes'
providers/__init__.pydiscovers the materialized directory and registers theClawRouterProfile, pointingbase_urlathttp://127.0.0.1:<port>/v1. - First tool call or chat turn → the supervisor probes
:8402, spawnsnpx -y @blockrun/clawrouter --port <port>if needed, waits ≤30s for/v1/models, then forwards the request. - 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/byhermes clawrouter setup):ProviderProfileregistration.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_plugin_clawrouter-0.1.0.tar.gz.
File metadata
- Download URL: hermes_plugin_clawrouter-0.1.0.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe73b46abf5e2a676f98338e7d84fcf6afbddffff44266fcc3ebfff8f1ba1ae1
|
|
| MD5 |
3eac118b331e354fa71a3bc3d023cf25
|
|
| BLAKE2b-256 |
9c4c890466146ce057590934e1d1d25d255f42b72b4d05c2f197a59a159141ae
|
File details
Details for the file hermes_plugin_clawrouter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_plugin_clawrouter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd7779bf284cc3165079a329a2a861cb9c39b5cc2e3471c87ee128e9b3809556
|
|
| MD5 |
6f80440f5e2dc03d58ca512f073c0eef
|
|
| BLAKE2b-256 |
7ad267f1dcf202d9d4bde72f4aaa63ec9ccdda73c4c402f4040bed3498c1710b
|