@blockrun/clawrouter 0.12.69 → 0.12.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/cli.js +25 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.js +74 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -434,21 +434,27 @@ The first X analytics an agent can call. One function call = one intelligence re
|
|
|
434
434
|
## Frequently Asked Questions
|
|
435
435
|
|
|
436
436
|
### What is ClawRouter?
|
|
437
|
+
|
|
437
438
|
ClawRouter is an open-source (MIT licensed) smart LLM router built for autonomous AI agents. It analyzes each request across 15 dimensions and routes to the cheapest capable model in under 1ms, entirely locally — no external API calls needed for routing decisions.
|
|
438
439
|
|
|
439
440
|
### How much can ClawRouter save on LLM costs?
|
|
441
|
+
|
|
440
442
|
ClawRouter's blended average cost is $2.05 per million tokens compared to $25/M for Claude Opus, representing 92% savings. Actual savings depend on your workload — simple queries are routed to budget models (as low as $0/request with NVIDIA free tier), while complex tasks get premium models.
|
|
441
443
|
|
|
442
444
|
### How does ClawRouter compare to OpenRouter?
|
|
445
|
+
|
|
443
446
|
ClawRouter is open source and runs locally. It uses wallet-based authentication (no API keys) and USDC per-request payments (no credit cards or subscriptions). OpenRouter requires an account, API key, and credit card. ClawRouter also features smart routing — it automatically picks the best model for each request, while OpenRouter requires manual model selection.
|
|
444
447
|
|
|
445
448
|
### How does ClawRouter compare to LiteLLM?
|
|
449
|
+
|
|
446
450
|
Both are open source and run locally. But ClawRouter adds smart routing (automatic model selection), wallet-based auth, and USDC payments. LiteLLM requires you to bring your own API keys and manually choose models.
|
|
447
451
|
|
|
448
452
|
### What agents does ClawRouter work with?
|
|
453
|
+
|
|
449
454
|
ClawRouter integrates with OpenClaw (Claude Code), ElizaOS, and any agent that makes OpenAI-compatible API calls. It runs as a local proxy on port 8402.
|
|
450
455
|
|
|
451
456
|
### Is ClawRouter free?
|
|
457
|
+
|
|
452
458
|
ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it — and NVIDIA GPT-OSS models are completely free, so you can even use it at zero cost.
|
|
453
459
|
|
|
454
460
|
---
|
package/dist/cli.js
CHANGED
|
@@ -40307,7 +40307,12 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40307
40307
|
COMPLEX: {
|
|
40308
40308
|
primary: "google/gemini-3.1-flash-lite",
|
|
40309
40309
|
// $0.25/$1.50 — 1M context handles complexity
|
|
40310
|
-
fallback: [
|
|
40310
|
+
fallback: [
|
|
40311
|
+
"google/gemini-2.5-flash-lite",
|
|
40312
|
+
"xai/grok-4-0709",
|
|
40313
|
+
"google/gemini-2.5-flash",
|
|
40314
|
+
"deepseek/deepseek-chat"
|
|
40315
|
+
]
|
|
40311
40316
|
},
|
|
40312
40317
|
REASONING: {
|
|
40313
40318
|
primary: "xai/grok-4-1-fast-reasoning",
|
|
@@ -47254,11 +47259,20 @@ function estimateAmount(modelId, bodyLength, maxTokens) {
|
|
|
47254
47259
|
return amountMicros.toString();
|
|
47255
47260
|
}
|
|
47256
47261
|
var IMAGE_PRICING = {
|
|
47257
|
-
"openai/dall-e-3": {
|
|
47258
|
-
|
|
47262
|
+
"openai/dall-e-3": {
|
|
47263
|
+
default: 0.04,
|
|
47264
|
+
sizes: { "1024x1024": 0.04, "1792x1024": 0.08, "1024x1792": 0.08 }
|
|
47265
|
+
},
|
|
47266
|
+
"openai/gpt-image-1": {
|
|
47267
|
+
default: 0.02,
|
|
47268
|
+
sizes: { "1024x1024": 0.02, "1536x1024": 0.04, "1024x1536": 0.04 }
|
|
47269
|
+
},
|
|
47259
47270
|
"black-forest/flux-1.1-pro": { default: 0.04 },
|
|
47260
47271
|
"google/nano-banana": { default: 0.05 },
|
|
47261
|
-
"google/nano-banana-pro": {
|
|
47272
|
+
"google/nano-banana-pro": {
|
|
47273
|
+
default: 0.1,
|
|
47274
|
+
sizes: { "1024x1024": 0.1, "2048x2048": 0.1, "4096x4096": 0.15 }
|
|
47275
|
+
}
|
|
47262
47276
|
};
|
|
47263
47277
|
function estimateImageCost(model, size5, n = 1) {
|
|
47264
47278
|
const pricing = IMAGE_PRICING[model];
|
|
@@ -47814,7 +47828,13 @@ async function startProxy(options) {
|
|
|
47814
47828
|
}
|
|
47815
47829
|
if (req.url?.match(/^\/v1\/(?:x|partner)\//)) {
|
|
47816
47830
|
try {
|
|
47817
|
-
await proxyPartnerRequest(
|
|
47831
|
+
await proxyPartnerRequest(
|
|
47832
|
+
req,
|
|
47833
|
+
res,
|
|
47834
|
+
apiBase,
|
|
47835
|
+
payFetch,
|
|
47836
|
+
() => paymentStore.getStore()?.amountUsd ?? 0
|
|
47837
|
+
);
|
|
47818
47838
|
} catch (err) {
|
|
47819
47839
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
47820
47840
|
options.onError?.(error);
|