ClawRouter  by BlockRunAI

Smart LLM routing for cost optimization

Created 2 months ago
6,181 stars

Top 8.2% on SourcePulse

GitHubView on GitHub
Project Summary

This project addresses the high cost of Large Language Model (LLM) inference by providing an intelligent, automated routing system. It targets developers building LLM-powered agents and applications, enabling significant cost savings (up to 96%) and simplifying API key management through a unified wallet and per-request payment system.

How It Works

The core of ClawRouter is its client-side, 14-dimension weighted scoring engine that analyzes prompts in under 1ms. This engine evaluates factors like reasoning markers, code presence, technical terms, and prompt complexity to predict the most cost-effective LLM capable of handling the request. Requests are then routed to one of four tiers (SIMPLE, MEDIUM, COMPLEX, REASONING), each mapped to specific models, ensuring optimal cost-performance balance without external API calls for routing decisions.

Quick Start & Requirements

  • Install: Use the openclaw plugin manager: openclaw plugin install @blockrun/clawrouter.
  • Prerequisites: Node.js (>=20), TypeScript (5.7), openclaw CLI, and USDC on the Base network for funding.
  • Funding: Approximately $5 USDC on Base is sufficient for thousands of requests.
  • Enable Smart Routing: Configure openclaw with openclaw config set model blockrun/auto.
  • Links: Docs, Models

Highlighted Details

  • Achieves up to 96% cost savings on LLM inference by intelligently routing requests to the cheapest capable model.
  • Integrates over 30 models from major providers including OpenAI, Anthropic, Google, DeepSeek, and xAI, accessible through a single wallet.
  • Employs a novel x402 micropayment system using USDC on the Base network, eliminating the need for traditional API keys and enabling non-custodial, per-request payments.
  • Features a fully inspectable, open-source routing logic and a 100% local execution model, ensuring privacy and <1ms routing latency.

Maintenance & Community

Community engagement is facilitated via Telegram and X. The project is developed by BlockRun AI.

Licensing & Compatibility

The project is licensed under the MIT license, permitting commercial use and integration within closed-source applications without significant restrictions.

Limitations & Caveats

Features such as cascade routing (escalating to more expensive models if quality is insufficient) and granular spend controls are listed on the roadmap and not yet implemented. Users must fund a wallet on the Base network to utilize the service.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
32
Issues (30d)
18
Star History
1,495 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera).

LLMRouter by ulab-uiuc

2.2%
2k
Optimize LLM inference with intelligent routing
Created 6 months ago
Updated 3 weeks ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
10 more.

RouteLLM by lm-sys

0.5%
5k
Framework for LLM routing and cost reduction (research paper)
Created 1 year ago
Updated 1 year ago
Feedback? Help us improve.