← Back to PRs

#16746: feat(extensions): add BlockRun LLM provider with ClawRouter integration

by 1bcMax open 2026-02-15 02:33 View on GitHub →
size: S
## Summary Adds BlockRun extension — a thin wrapper that re-exports `@blockrun/clawrouter` for smart LLM routing with x402 micropayments. ### Why BlockRun? | Feature | Benefit | |---------|---------| | **63% cost savings** | Smart router picks the cheapest model that can handle each request | | **30+ models** | OpenAI, Anthropic, Google, DeepSeek, xAI — all through one integration | | **Free models included** | Gemini Flash, DeepSeek, and more — $0 for simple queries | | **<1ms routing** | Hybrid rules-first classifier handles ~80% of requests instantly | | **No API keys needed** | Pay-per-request with USDC micropayments (x402 protocol) | | **Non-custodial** | Your wallet, your keys — no middleman holding funds | ### How It Works ``` User prompt → ClawRouter classifier → Best model for the job ↓ 80% handled by rules (<1ms) 20% use LLM fallback (~$0.00003) ``` ### Routing Examples | Prompt | Routed To | Why | |--------|-----------|-----| | "What's 2+2?" | Gemini Flash (free) | Simple math | | "Write a haiku" | DeepSeek | Creative, affordable | | "Debug this React code" | GPT-4o | Code expertise | | "Analyze this legal contract" | Claude Opus | Complex reasoning | ## Usage ```bash # Enable smart routing openclaw config set model blockrun/auto # Optional: set wallet key (auto-generated if not set) export BLOCKRUN_WALLET_KEY=0x... ``` ## Links - npm: [@blockrun/clawrouter](https://www.npmjs.com/package/@blockrun/clawrouter) - GitHub: [BlockRunAI/ClawRouter](https://github.com/BlockRunAI/ClawRouter) - x402: [x402.org](https://x402.org) ## Test plan - [ ] `pnpm install` in `extensions/blockrun` - [ ] Verify plugin loads with `openclaw extensions list` - [ ] Test routing with `blockrun/auto` model - [ ] Verify free model routing for simple queries <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds a new BlockRun extension that wraps the external `@blockrun/clawrouter` npm package to provide LLM routing with x402 micropayments. The extension is a thin re-export — all logic (provider registration, wallet management, routing, payments) lives in the external package. - **Supply chain concern**: This is the only provider extension in the repo that delegates 100% of its implementation to an external npm package. Other provider extensions (`copilot-proxy`, `google-gemini-cli-auth`, etc.) implement their `register()` logic in-repo. The external package handles sensitive operations (wallet private keys, LLM prompts, payment transactions) with no in-repo auditability. - **Config schema divergence risk**: The `configSchema` in `openclaw.plugin.json` defines `walletKey` and `routing` fields, but validation happens against the manifest while the external package consumes the config at runtime — these could drift out of sync on package updates. - **Missing `.github/labeler.yml` entry**: Per AGENTS.md line 18, new extensions must be added to the labeler config. This is missing. - **Credentials handling**: The `walletKey` field is correctly marked `sensitive: true` in `uiHints`, following established patterns (e.g., `voice-call`, `memory-lancedb`). <h3>Confidence Score: 2/5</h3> - This PR introduces a supply chain dependency that handles sensitive credentials with no in-repo code to review — warrants careful consideration before merging. - Score of 2 reflects: (1) the extension delegates all logic to an opaque external package that handles wallet private keys and LLM prompts, unique among all provider extensions; (2) the caret version range allows silent patch updates; (3) missing labeler.yml entry violates repo policy; (4) prior review threads identified lockfile, version sync, and schema issues that appear unaddressed. The extension structure itself is valid and follows manifest conventions correctly. - Pay close attention to `extensions/blockrun/index.ts` (sole re-export of external package) and `extensions/blockrun/package.json` (dependency version range and missing lockfile update) <sub>Last reviewed commit: 273b6fb</sub> <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs