RepoOpenBMB (MiniCPM)OpenBMB (MiniCPM)published Mar 27, 2026seen 5d

OpenBMB/ClawXRouter

TypeScript

Open original ↗

Captured source

source ↗
published Mar 27, 2026seen 5dcaptured 12hhttp 200method plain

OpenBMB/ClawXRouter

Language: TypeScript

Stars: 187

Forks: 23

Open issues: 3

Created: 2026-03-27T07:49:24Z

Pushed: 2026-03-31T08:35:42Z

Default branch: main

Fork: no

Archived: no

README:

Secure · Efficient · Balanced

Edge-Cloud Collaborative AI Agent Routing Plugin

ClawXRouter: Automatically route every request through the best path

【中文 | English】

---

What's New 🔥

  • [2026.03.25] 🎉 ClawXRouter is now open source — Edge-Cloud Collaborative AI Agent Routing

---

📑 Table of Contents

  • [💡 About ClawXRouter](#-about-clawxrouter)
  • [🎬 Demo](#-demo)
  • [📦 Quick Start](#-quick-start)
  • [📈 Cost-Effective Routing: Beat Sonnet at 40% of the Price!](#-cost-effective-routing-beat-sonnet-at-40-of-the-price)
  • [🔧 Custom Configuration](#-custom-configuration)
  • [🔌 Supported Edge Providers](#-supported-edge-providers)
  • [🔒 Three-Level Privacy Routing](#-three-level-privacy-routing)
  • [💰 Cost-Aware Routing](#-cost-aware-routing)
  • [🚀 Composable Routing Pipeline](#-composable-routing-pipeline)
  • [🏗️ Code Structure](#️-code-structure)
  • [🤝 Contributing](#-contributing)
  • [📖 References](#-references)

---

💡 About ClawXRouter

ClawXRouter is an Edge-Cloud Collaborative AI Agent Routing Plugin, jointly developed by THUNLP (Tsinghua University), Renmin University of China, AI9Stars, ModelBest, and OpenBMB, built on top of OpenClaw, based on EdgeClaw.

AI Agents are profoundly changing how developers work every day. However, during real-world deployment, the current Agent usage patterns expose three major problems: "afraid to use" the cloud (privacy leakage), "can't afford" the cloud (even simple tasks burn expensive tokens), and "can't rely on" the edge (local models can't handle hard tasks).

To address these three pain points, ClawXRouter provides corresponding solutions:

  • 🔒 Afraid to use → Three-Level Privacy Routing: Automatically identifies sensitive data. Confidential information (S3) is physically isolated locally, processed offline by edge models, and completely invisible to the cloud — fundamentally eliminating leakage risk so users can use it with confidence. When code review encounters an API Key, the request never leaves the machine.
  • 💰 Can't afford → Cost-Aware Routing: An edge-side small model acts as LLM-as-Judge, classifying tasks into five complexity levels and routing them to cloud models at different price tiers — saving 58% in costs while scoring 6.3% higher on PinchBench, so users can afford to use it. Grepping a function name goes to a cheap model instead of an expensive top-tier one.
  • 🔗 Can't rely on → Smart Redaction & Forwarding: For complex tasks involving sensitive information where edge models fall short, there's no need to struggle — for scenarios like multi-file complex data analysis, data is automatically redacted before forwarding to the cloud (S2), protecting privacy while leveraging cloud expertise, so users can use it effectively.
  • 🎛️ Personalization → Composable Pipeline & Dashboard: Privacy routing and cost-aware routing work together in the same pipeline through weighting and short-circuit strategies, complemented by a visual Dashboard that supports rule customization, instant configuration changes, and real-time testing, allowing every user to flexibly adjust according to their own needs.

Both routing systems run in the same composable pipeline: the edge-side dual engine (rule detection ~0ms + local LLM semantic detection ~1-2s) evaluates the sensitivity and complexity of each request in real-time, with security-first short-circuiting and cost optimization applied as needed. Developers don't need to modify business logic to achieve seamless edge-cloud collaboration: "public data to the cloud, sensitive data redacted, confidential data stays local".

---

🎬 Demo

---

📦 Quick Start

Installation

# Prerequisites: OpenClaw is already installed, and you are in the OpenClaw path

# Install via npm (recommended)
node openclaw.mjs plugins install @openbmb/clawxrouter

# Or install from ClawHub
openclaw plugins install clawhub:clawxrouter

# (Optional) Install local inference backend
ollama pull openbmb/minicpm4.1
ollama serve

Launch

openclaw gateway
# ClawXRouter Ready! Dashboard → http://127.0.0.1:18789/plugins/clawxrouter/stats

Done. Every request now automatically takes the optimal path.

---

📈 Cost-Effective Routing: Beat Sonnet at 40% of the Price!

Routing effectiveness validated using PinchBench (23 OpenClaw Agent benchmarks).

Five-Level Classification & Model Configuration

| Level | Description | Default Model | |-------|-------------|---------------| | SIMPLE | Summarization, rewriting, simple Q&A, greetings | glm-4.5-air | | MEDIUM | Writing emails, scripts, data analysis, project scaffolding | minimax-m2.5 | | COMPLEX | Batch email sorting, multi-file creation, structured data extraction | deepseek-v3.2 | | RESEARCH | Long-form writing, multi-source integration workflows | glm-5 | | REASONING | Deep PDF analysis, mathematical proofs, experiment design | kimi-k2.5 |

Results

| Approach | PinchBench Score (Best / Avg) | Cost | |----------|-------------------------------|------| | ClawX Routing (5-model mix) | 93.2% / 89.6% | $2.36 | | All Sonnet 4.6 | 86.9% / 79.2% | $5.63 |

> 58% cost savings with 6.3% higher scores.

---

🔧 Custom Configuration

All configuration supports two modification methods: Dashboard real-time editing (recommended) or JSON file (suitable for scripted deployments).

Dashboard Configuration (Recommended)

Open http://127.0.0.1:18789/plugins/clawxrouter/stats — all changes take effect immediately without restart.

Detection Rules

Router Rules Tab → Expand Privacy Router card:

1. Keywords — Directly add/remove S2, S3 keyword tags

  • Left column S2 — Sensitive (Redact → Cloud): Type and click Add, e.g., password, api_key
  • Right column S3 — Confidential (Local Model Only): e.g., ssh, private_key, .pem

2. Expand Advanced ConfigurationDetection Rules (Regex & Tool Filters):

  • Regex Patterns: Add regex, e.g.,…

Excerpt shown — open the source for the full document.

Notability

notability 5.0/10

New repo, decent stars, not major.