@blockrun/clawrouter 0.12.78 → 0.12.80
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 +8 -9
- package/dist/cli.js +83 -194
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +95 -207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/reinstall.sh +6 -6
- package/scripts/update.sh +5 -5
package/README.md
CHANGED
|
@@ -96,7 +96,6 @@ Choose your routing strategy with `/model <profile>`:
|
|
|
96
96
|
| `/model auto` | Balanced (default) | 74-100% | General use |
|
|
97
97
|
| `/model eco` | Cheapest possible | 95-100% | Maximum savings |
|
|
98
98
|
| `/model premium` | Best quality | 0% | Mission-critical |
|
|
99
|
-
| `/model free` | 11 free NVIDIA models | 100% | Zero cost |
|
|
100
99
|
|
|
101
100
|
**Shortcuts:** `/model grok`, `/model br-sonnet`, `/model gpt5`, `/model o3`
|
|
102
101
|
|
|
@@ -110,12 +109,12 @@ Choose your routing strategy with `/model <profile>`:
|
|
|
110
109
|
Request → Weighted Scorer (15 dimensions) → Tier → Best Model → Response
|
|
111
110
|
```
|
|
112
111
|
|
|
113
|
-
| Tier | ECO Model
|
|
114
|
-
| --------- |
|
|
115
|
-
| SIMPLE | nvidia/gpt-oss-120b (**FREE**)
|
|
116
|
-
| MEDIUM |
|
|
117
|
-
| COMPLEX |
|
|
118
|
-
| REASONING | grok-4-1-fast ($0.20/$0.50)
|
|
112
|
+
| Tier | ECO Model | AUTO Model | PREMIUM Model |
|
|
113
|
+
| --------- | ----------------------------------- | ------------------------------------- | ---------------------------- |
|
|
114
|
+
| SIMPLE | nvidia/gpt-oss-120b (**FREE**) | gemini-2.5-flash ($0.30/$2.50) | kimi-k2.5 |
|
|
115
|
+
| MEDIUM | gemini-3.1-flash-lite ($0.25/$1.50) | kimi-k2.5 ($0.60/$3.00) | gpt-5.3-codex ($1.75/$14.00) |
|
|
116
|
+
| COMPLEX | gemini-3.1-flash-lite ($0.25/$1.50) | gemini-3.1-pro ($2/$12) | claude-opus-4.6 ($5/$25) |
|
|
117
|
+
| REASONING | grok-4-1-fast ($0.20/$0.50) | grok-4-1-fast-reasoning ($0.20/$0.50) | claude-sonnet-4.6 ($3/$15) |
|
|
119
118
|
|
|
120
119
|
**Blended average: $2.05/M** vs $25/M for Claude Opus = **92% savings**
|
|
121
120
|
|
|
@@ -234,7 +233,7 @@ Edit existing images with `/img2img`:
|
|
|
234
233
|
| openai/gpt-5.2-pro | $21.00 | $168.00 | $0.0945 | 400K | reasoning, tools |
|
|
235
234
|
| openai/gpt-5.4-pro | $30.00 | $180.00 | $0.1050 | 400K | reasoning, tools |
|
|
236
235
|
|
|
237
|
-
> **Free tier:** 11 NVIDIA models cost nothing —
|
|
236
|
+
> **Free tier:** 11 NVIDIA models cost nothing — `/model free` points to nemotron-ultra-253b, or pick any free model directly (e.g., `/model nemotron`, `/model deepseek-free`, `/model devstral`).
|
|
238
237
|
> **Best value:** `gpt-5-nano` and `gemini-2.5-flash-lite` deliver strong results at ~$0.0003/request.
|
|
239
238
|
|
|
240
239
|
---
|
|
@@ -465,7 +464,7 @@ ClawRouter integrates with OpenClaw (Claude Code), ElizaOS, and any agent that m
|
|
|
465
464
|
|
|
466
465
|
### Is ClawRouter free?
|
|
467
466
|
|
|
468
|
-
ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it — and 11 NVIDIA models (DeepSeek V3.2, Nemotron Ultra 253B, Mistral Large 675B, Llama 4 Maverick, and more) are completely free. Use `/model free` for
|
|
467
|
+
ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it — and 11 NVIDIA models (DeepSeek V3.2, Nemotron Ultra 253B, Mistral Large 675B, Llama 4 Maverick, and more) are completely free. Use `/model free` for Nemotron Ultra 253B, or pick any free model by name.
|
|
469
468
|
|
|
470
469
|
---
|
|
471
470
|
|
package/dist/cli.js
CHANGED
|
@@ -39086,11 +39086,7 @@ var RulesStrategy = class {
|
|
|
39086
39086
|
let tierConfigs;
|
|
39087
39087
|
let profileSuffix;
|
|
39088
39088
|
let profile;
|
|
39089
|
-
if (routingProfile === "
|
|
39090
|
-
tierConfigs = config.freeTiers;
|
|
39091
|
-
profileSuffix = " | free";
|
|
39092
|
-
profile = "free";
|
|
39093
|
-
} else if (routingProfile === "eco" && config.ecoTiers) {
|
|
39089
|
+
if (routingProfile === "eco" && config.ecoTiers) {
|
|
39094
39090
|
tierConfigs = config.ecoTiers;
|
|
39095
39091
|
profileSuffix = " | eco";
|
|
39096
39092
|
profile = "eco";
|
|
@@ -40218,7 +40214,7 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40218
40214
|
// $0.20/$1.25, 1M context
|
|
40219
40215
|
"xai/grok-4-fast-non-reasoning",
|
|
40220
40216
|
// 1,143ms, $0.20/$0.50 — fast fallback
|
|
40221
|
-
"
|
|
40217
|
+
"free/gpt-oss-120b"
|
|
40222
40218
|
// 1,252ms, FREE fallback
|
|
40223
40219
|
]
|
|
40224
40220
|
},
|
|
@@ -40279,13 +40275,13 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40279
40275
|
]
|
|
40280
40276
|
}
|
|
40281
40277
|
},
|
|
40282
|
-
// Eco tier configs - absolute cheapest
|
|
40278
|
+
// Eco tier configs - absolute cheapest (blockrun/eco)
|
|
40283
40279
|
ecoTiers: {
|
|
40284
40280
|
SIMPLE: {
|
|
40285
|
-
primary: "
|
|
40281
|
+
primary: "free/gpt-oss-120b",
|
|
40286
40282
|
// FREE! $0.00/$0.00
|
|
40287
40283
|
fallback: [
|
|
40288
|
-
"
|
|
40284
|
+
"free/gpt-oss-20b",
|
|
40289
40285
|
// FREE — smaller, faster
|
|
40290
40286
|
"google/gemini-3.1-flash-lite",
|
|
40291
40287
|
// $0.25/$1.50 — newest flash-lite
|
|
@@ -40298,13 +40294,9 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40298
40294
|
]
|
|
40299
40295
|
},
|
|
40300
40296
|
MEDIUM: {
|
|
40301
|
-
primary: "
|
|
40302
|
-
//
|
|
40297
|
+
primary: "google/gemini-3.1-flash-lite",
|
|
40298
|
+
// $0.25/$1.50 — newest flash-lite
|
|
40303
40299
|
fallback: [
|
|
40304
|
-
"nvidia/gpt-oss-120b",
|
|
40305
|
-
// FREE fallback
|
|
40306
|
-
"google/gemini-3.1-flash-lite",
|
|
40307
|
-
// $0.25/$1.50
|
|
40308
40300
|
"openai/gpt-5.4-nano",
|
|
40309
40301
|
// $0.20/$1.25
|
|
40310
40302
|
"google/gemini-2.5-flash-lite",
|
|
@@ -40314,15 +40306,9 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40314
40306
|
]
|
|
40315
40307
|
},
|
|
40316
40308
|
COMPLEX: {
|
|
40317
|
-
primary: "
|
|
40318
|
-
//
|
|
40309
|
+
primary: "google/gemini-3.1-flash-lite",
|
|
40310
|
+
// $0.25/$1.50
|
|
40319
40311
|
fallback: [
|
|
40320
|
-
"nvidia/mistral-large-3-675b",
|
|
40321
|
-
// FREE — 675B brute-force
|
|
40322
|
-
"nvidia/deepseek-v3.2",
|
|
40323
|
-
// FREE
|
|
40324
|
-
"google/gemini-3.1-flash-lite",
|
|
40325
|
-
// $0.25/$1.50
|
|
40326
40312
|
"google/gemini-2.5-flash-lite",
|
|
40327
40313
|
"xai/grok-4-0709",
|
|
40328
40314
|
"google/gemini-2.5-flash",
|
|
@@ -40332,12 +40318,7 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40332
40318
|
REASONING: {
|
|
40333
40319
|
primary: "xai/grok-4-1-fast-reasoning",
|
|
40334
40320
|
// $0.20/$0.50
|
|
40335
|
-
fallback: [
|
|
40336
|
-
"xai/grok-4-fast-reasoning",
|
|
40337
|
-
"nvidia/nemotron-ultra-253b",
|
|
40338
|
-
// FREE reasoning fallback
|
|
40339
|
-
"deepseek/deepseek-reasoner"
|
|
40340
|
-
]
|
|
40321
|
+
fallback: ["xai/grok-4-fast-reasoning", "deepseek/deepseek-reasoner"]
|
|
40341
40322
|
}
|
|
40342
40323
|
},
|
|
40343
40324
|
// Premium tier configs - best quality (blockrun/premium)
|
|
@@ -40451,73 +40432,6 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
40451
40432
|
]
|
|
40452
40433
|
}
|
|
40453
40434
|
},
|
|
40454
|
-
// Free tier configs - NVIDIA free models, smart-routed by task type (blockrun/free)
|
|
40455
|
-
freeTiers: {
|
|
40456
|
-
SIMPLE: {
|
|
40457
|
-
primary: "nvidia/gpt-oss-20b",
|
|
40458
|
-
// Fastest: small 20B for simple tasks
|
|
40459
|
-
fallback: [
|
|
40460
|
-
"nvidia/gpt-oss-120b",
|
|
40461
|
-
// Solid general-purpose
|
|
40462
|
-
"nvidia/nemotron-super-49b",
|
|
40463
|
-
// Thinking mode
|
|
40464
|
-
"nvidia/llama-4-maverick",
|
|
40465
|
-
// MoE broad coverage
|
|
40466
|
-
"nvidia/glm-4.7"
|
|
40467
|
-
// Thinking mode
|
|
40468
|
-
]
|
|
40469
|
-
},
|
|
40470
|
-
MEDIUM: {
|
|
40471
|
-
primary: "nvidia/deepseek-v3.2",
|
|
40472
|
-
// DeepSeek V3.2 quality, zero cost
|
|
40473
|
-
fallback: [
|
|
40474
|
-
"nvidia/gpt-oss-120b",
|
|
40475
|
-
// Strong 120B general-purpose
|
|
40476
|
-
"nvidia/nemotron-super-49b",
|
|
40477
|
-
// Thinking mode
|
|
40478
|
-
"nvidia/mistral-large-3-675b",
|
|
40479
|
-
// Largest Mistral
|
|
40480
|
-
"nvidia/llama-4-maverick",
|
|
40481
|
-
// MoE breadth
|
|
40482
|
-
"nvidia/glm-4.7"
|
|
40483
|
-
// Thinking mode
|
|
40484
|
-
]
|
|
40485
|
-
},
|
|
40486
|
-
COMPLEX: {
|
|
40487
|
-
primary: "nvidia/nemotron-ultra-253b",
|
|
40488
|
-
// Strongest free: 253B reasoning
|
|
40489
|
-
fallback: [
|
|
40490
|
-
"nvidia/mistral-large-3-675b",
|
|
40491
|
-
// 675B massive params
|
|
40492
|
-
"nvidia/deepseek-v3.2",
|
|
40493
|
-
// V3.2 quality
|
|
40494
|
-
"nvidia/nemotron-3-super-120b",
|
|
40495
|
-
// Thinking mode MoE
|
|
40496
|
-
"nvidia/qwen3-coder-480b",
|
|
40497
|
-
// 480B MoE for code-heavy tasks
|
|
40498
|
-
"nvidia/devstral-2-123b",
|
|
40499
|
-
// Coding-focused
|
|
40500
|
-
"nvidia/gpt-oss-120b"
|
|
40501
|
-
// Last resort
|
|
40502
|
-
]
|
|
40503
|
-
},
|
|
40504
|
-
REASONING: {
|
|
40505
|
-
primary: "nvidia/nemotron-ultra-253b",
|
|
40506
|
-
// Best free reasoning: 253B
|
|
40507
|
-
fallback: [
|
|
40508
|
-
"nvidia/nemotron-3-super-120b",
|
|
40509
|
-
// Thinking mode MoE
|
|
40510
|
-
"nvidia/nemotron-super-49b",
|
|
40511
|
-
// Thinking mode
|
|
40512
|
-
"nvidia/deepseek-v3.2",
|
|
40513
|
-
// DeepSeek reasoning
|
|
40514
|
-
"nvidia/mistral-large-3-675b",
|
|
40515
|
-
// Brute-force params
|
|
40516
|
-
"nvidia/glm-4.7"
|
|
40517
|
-
// GLM thinking mode
|
|
40518
|
-
]
|
|
40519
|
-
}
|
|
40520
|
-
},
|
|
40521
40435
|
overrides: {
|
|
40522
40436
|
maxTokensForceComplex: 1e5,
|
|
40523
40437
|
structuredOutputMinTier: "MEDIUM",
|
|
@@ -40597,27 +40511,38 @@ var MODEL_ALIASES = {
|
|
|
40597
40511
|
// delisted 2026-03-12
|
|
40598
40512
|
"xai/grok-3-fast": "xai/grok-4-fast-reasoning",
|
|
40599
40513
|
// delisted (too expensive)
|
|
40600
|
-
// NVIDIA —
|
|
40601
|
-
nvidia: "
|
|
40602
|
-
"gpt-120b": "
|
|
40603
|
-
"gpt-20b": "
|
|
40604
|
-
|
|
40605
|
-
"
|
|
40606
|
-
"
|
|
40607
|
-
"
|
|
40608
|
-
"
|
|
40609
|
-
|
|
40610
|
-
|
|
40611
|
-
"
|
|
40612
|
-
"
|
|
40613
|
-
"
|
|
40614
|
-
"
|
|
40615
|
-
|
|
40616
|
-
|
|
40617
|
-
"
|
|
40618
|
-
"
|
|
40619
|
-
"
|
|
40620
|
-
|
|
40514
|
+
// NVIDIA — backward compat aliases (nvidia/xxx → free/xxx)
|
|
40515
|
+
nvidia: "free/gpt-oss-120b",
|
|
40516
|
+
"gpt-120b": "free/gpt-oss-120b",
|
|
40517
|
+
"gpt-20b": "free/gpt-oss-20b",
|
|
40518
|
+
"nvidia/gpt-oss-120b": "free/gpt-oss-120b",
|
|
40519
|
+
"nvidia/gpt-oss-20b": "free/gpt-oss-20b",
|
|
40520
|
+
"nvidia/nemotron-ultra-253b": "free/nemotron-ultra-253b",
|
|
40521
|
+
"nvidia/nemotron-3-super-120b": "free/nemotron-3-super-120b",
|
|
40522
|
+
"nvidia/nemotron-super-49b": "free/nemotron-super-49b",
|
|
40523
|
+
"nvidia/deepseek-v3.2": "free/deepseek-v3.2",
|
|
40524
|
+
"nvidia/mistral-large-3-675b": "free/mistral-large-3-675b",
|
|
40525
|
+
"nvidia/qwen3-coder-480b": "free/qwen3-coder-480b",
|
|
40526
|
+
"nvidia/devstral-2-123b": "free/devstral-2-123b",
|
|
40527
|
+
"nvidia/glm-4.7": "free/glm-4.7",
|
|
40528
|
+
"nvidia/llama-4-maverick": "free/llama-4-maverick",
|
|
40529
|
+
// Free model shorthand aliases
|
|
40530
|
+
"deepseek-free": "free/deepseek-v3.2",
|
|
40531
|
+
"mistral-free": "free/mistral-large-3-675b",
|
|
40532
|
+
"glm-free": "free/glm-4.7",
|
|
40533
|
+
"llama-free": "free/llama-4-maverick",
|
|
40534
|
+
nemotron: "free/nemotron-ultra-253b",
|
|
40535
|
+
"nemotron-ultra": "free/nemotron-ultra-253b",
|
|
40536
|
+
"nemotron-253b": "free/nemotron-ultra-253b",
|
|
40537
|
+
"nemotron-super": "free/nemotron-super-49b",
|
|
40538
|
+
"nemotron-49b": "free/nemotron-super-49b",
|
|
40539
|
+
"nemotron-120b": "free/nemotron-3-super-120b",
|
|
40540
|
+
devstral: "free/devstral-2-123b",
|
|
40541
|
+
"devstral-2": "free/devstral-2-123b",
|
|
40542
|
+
"qwen-coder": "free/qwen3-coder-480b",
|
|
40543
|
+
"qwen-coder-free": "free/qwen3-coder-480b",
|
|
40544
|
+
maverick: "free/llama-4-maverick",
|
|
40545
|
+
free: "free/nemotron-ultra-253b",
|
|
40621
40546
|
// MiniMax
|
|
40622
40547
|
minimax: "minimax/minimax-m2.7",
|
|
40623
40548
|
"minimax-m2.7": "minimax/minimax-m2.7",
|
|
@@ -40629,7 +40554,7 @@ var MODEL_ALIASES = {
|
|
|
40629
40554
|
// Routing profile aliases (common variations)
|
|
40630
40555
|
"auto-router": "auto",
|
|
40631
40556
|
router: "auto"
|
|
40632
|
-
// Note: auto,
|
|
40557
|
+
// Note: auto, eco, premium are virtual routing profiles registered in BLOCKRUN_MODELS
|
|
40633
40558
|
// They don't need aliases since they're already top-level model IDs
|
|
40634
40559
|
};
|
|
40635
40560
|
function resolveModelAlias(model) {
|
|
@@ -40662,14 +40587,6 @@ var BLOCKRUN_MODELS = [
|
|
|
40662
40587
|
contextWindow: 105e4,
|
|
40663
40588
|
maxOutput: 128e3
|
|
40664
40589
|
},
|
|
40665
|
-
{
|
|
40666
|
-
id: "free",
|
|
40667
|
-
name: "Free (Smart Router - 11 NVIDIA Models)",
|
|
40668
|
-
inputPrice: 0,
|
|
40669
|
-
outputPrice: 0,
|
|
40670
|
-
contextWindow: 131072,
|
|
40671
|
-
maxOutput: 16384
|
|
40672
|
-
},
|
|
40673
40590
|
{
|
|
40674
40591
|
id: "eco",
|
|
40675
40592
|
name: "Eco (Smart Router - Cost Optimized)",
|
|
@@ -41173,11 +41090,12 @@ var BLOCKRUN_MODELS = [
|
|
|
41173
41090
|
agentic: true,
|
|
41174
41091
|
toolCalling: true
|
|
41175
41092
|
},
|
|
41176
|
-
//
|
|
41177
|
-
//
|
|
41178
|
-
//
|
|
41093
|
+
// Free models (hosted by NVIDIA, billingMode: "free" on server)
|
|
41094
|
+
// IDs use "free/" prefix so users see them as free in the /model picker.
|
|
41095
|
+
// ClawRouter maps free/xxx → nvidia/xxx before sending to BlockRun upstream.
|
|
41096
|
+
// toolCalling intentionally omitted: structured function calling unverified.
|
|
41179
41097
|
{
|
|
41180
|
-
id: "
|
|
41098
|
+
id: "free/gpt-oss-120b",
|
|
41181
41099
|
name: "[Free] GPT-OSS 120B",
|
|
41182
41100
|
version: "120b",
|
|
41183
41101
|
inputPrice: 0,
|
|
@@ -41186,7 +41104,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41186
41104
|
maxOutput: 16384
|
|
41187
41105
|
},
|
|
41188
41106
|
{
|
|
41189
|
-
id: "
|
|
41107
|
+
id: "free/gpt-oss-20b",
|
|
41190
41108
|
name: "[Free] GPT-OSS 20B",
|
|
41191
41109
|
version: "20b",
|
|
41192
41110
|
inputPrice: 0,
|
|
@@ -41195,7 +41113,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41195
41113
|
maxOutput: 16384
|
|
41196
41114
|
},
|
|
41197
41115
|
{
|
|
41198
|
-
id: "
|
|
41116
|
+
id: "free/nemotron-ultra-253b",
|
|
41199
41117
|
name: "[Free] Nemotron Ultra 253B",
|
|
41200
41118
|
version: "253b",
|
|
41201
41119
|
inputPrice: 0,
|
|
@@ -41205,7 +41123,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41205
41123
|
reasoning: true
|
|
41206
41124
|
},
|
|
41207
41125
|
{
|
|
41208
|
-
id: "
|
|
41126
|
+
id: "free/nemotron-3-super-120b",
|
|
41209
41127
|
name: "[Free] Nemotron 3 Super 120B",
|
|
41210
41128
|
version: "3-super-120b",
|
|
41211
41129
|
inputPrice: 0,
|
|
@@ -41215,7 +41133,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41215
41133
|
reasoning: true
|
|
41216
41134
|
},
|
|
41217
41135
|
{
|
|
41218
|
-
id: "
|
|
41136
|
+
id: "free/nemotron-super-49b",
|
|
41219
41137
|
name: "[Free] Nemotron Super 49B",
|
|
41220
41138
|
version: "super-49b",
|
|
41221
41139
|
inputPrice: 0,
|
|
@@ -41225,7 +41143,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41225
41143
|
reasoning: true
|
|
41226
41144
|
},
|
|
41227
41145
|
{
|
|
41228
|
-
id: "
|
|
41146
|
+
id: "free/deepseek-v3.2",
|
|
41229
41147
|
name: "[Free] DeepSeek V3.2",
|
|
41230
41148
|
version: "v3.2",
|
|
41231
41149
|
inputPrice: 0,
|
|
@@ -41235,7 +41153,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41235
41153
|
reasoning: true
|
|
41236
41154
|
},
|
|
41237
41155
|
{
|
|
41238
|
-
id: "
|
|
41156
|
+
id: "free/mistral-large-3-675b",
|
|
41239
41157
|
name: "[Free] Mistral Large 675B",
|
|
41240
41158
|
version: "3-675b",
|
|
41241
41159
|
inputPrice: 0,
|
|
@@ -41245,7 +41163,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41245
41163
|
reasoning: true
|
|
41246
41164
|
},
|
|
41247
41165
|
{
|
|
41248
|
-
id: "
|
|
41166
|
+
id: "free/qwen3-coder-480b",
|
|
41249
41167
|
name: "[Free] Qwen3 Coder 480B",
|
|
41250
41168
|
version: "480b",
|
|
41251
41169
|
inputPrice: 0,
|
|
@@ -41254,7 +41172,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41254
41172
|
maxOutput: 16384
|
|
41255
41173
|
},
|
|
41256
41174
|
{
|
|
41257
|
-
id: "
|
|
41175
|
+
id: "free/devstral-2-123b",
|
|
41258
41176
|
name: "[Free] Devstral 2 123B",
|
|
41259
41177
|
version: "2-123b",
|
|
41260
41178
|
inputPrice: 0,
|
|
@@ -41263,7 +41181,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41263
41181
|
maxOutput: 16384
|
|
41264
41182
|
},
|
|
41265
41183
|
{
|
|
41266
|
-
id: "
|
|
41184
|
+
id: "free/glm-4.7",
|
|
41267
41185
|
name: "[Free] GLM-4.7",
|
|
41268
41186
|
version: "4.7",
|
|
41269
41187
|
inputPrice: 0,
|
|
@@ -41273,7 +41191,7 @@ var BLOCKRUN_MODELS = [
|
|
|
41273
41191
|
reasoning: true
|
|
41274
41192
|
},
|
|
41275
41193
|
{
|
|
41276
|
-
id: "
|
|
41194
|
+
id: "free/llama-4-maverick",
|
|
41277
41195
|
name: "[Free] Llama 4 Maverick",
|
|
41278
41196
|
version: "4-maverick",
|
|
41279
41197
|
inputPrice: 0,
|
|
@@ -46849,8 +46767,6 @@ var BLOCKRUN_SOLANA_API = "https://sol.blockrun.ai/api";
|
|
|
46849
46767
|
var IMAGE_DIR = join8(homedir5(), ".openclaw", "blockrun", "images");
|
|
46850
46768
|
var AUTO_MODEL = "blockrun/auto";
|
|
46851
46769
|
var ROUTING_PROFILES = /* @__PURE__ */ new Set([
|
|
46852
|
-
"blockrun/free",
|
|
46853
|
-
"free",
|
|
46854
46770
|
"blockrun/eco",
|
|
46855
46771
|
"eco",
|
|
46856
46772
|
"blockrun/auto",
|
|
@@ -46858,39 +46774,26 @@ var ROUTING_PROFILES = /* @__PURE__ */ new Set([
|
|
|
46858
46774
|
"blockrun/premium",
|
|
46859
46775
|
"premium"
|
|
46860
46776
|
]);
|
|
46861
|
-
var FREE_MODEL = "
|
|
46777
|
+
var FREE_MODEL = "free/gpt-oss-120b";
|
|
46862
46778
|
var FREE_MODELS = /* @__PURE__ */ new Set([
|
|
46863
|
-
"
|
|
46864
|
-
"
|
|
46865
|
-
"
|
|
46866
|
-
"
|
|
46867
|
-
"
|
|
46868
|
-
"
|
|
46869
|
-
"
|
|
46870
|
-
"
|
|
46871
|
-
"
|
|
46872
|
-
"
|
|
46873
|
-
"
|
|
46779
|
+
"free/gpt-oss-120b",
|
|
46780
|
+
"free/gpt-oss-20b",
|
|
46781
|
+
"free/nemotron-ultra-253b",
|
|
46782
|
+
"free/nemotron-3-super-120b",
|
|
46783
|
+
"free/nemotron-super-49b",
|
|
46784
|
+
"free/deepseek-v3.2",
|
|
46785
|
+
"free/mistral-large-3-675b",
|
|
46786
|
+
"free/qwen3-coder-480b",
|
|
46787
|
+
"free/devstral-2-123b",
|
|
46788
|
+
"free/glm-4.7",
|
|
46789
|
+
"free/llama-4-maverick"
|
|
46874
46790
|
]);
|
|
46875
|
-
|
|
46876
|
-
|
|
46877
|
-
|
|
46878
|
-
fallback: ["nvidia/gpt-oss-120b", "nvidia/nemotron-super-49b"]
|
|
46879
|
-
},
|
|
46880
|
-
MEDIUM: {
|
|
46881
|
-
primary: "nvidia/deepseek-v3.2",
|
|
46882
|
-
fallback: ["nvidia/gpt-oss-120b", "nvidia/nemotron-super-49b"]
|
|
46883
|
-
},
|
|
46884
|
-
COMPLEX: {
|
|
46885
|
-
primary: "nvidia/nemotron-ultra-253b",
|
|
46886
|
-
fallback: ["nvidia/mistral-large-3-675b", "nvidia/deepseek-v3.2", "nvidia/gpt-oss-120b"]
|
|
46887
|
-
},
|
|
46888
|
-
REASONING: {
|
|
46889
|
-
primary: "nvidia/nemotron-ultra-253b",
|
|
46890
|
-
fallback: ["nvidia/nemotron-3-super-120b", "nvidia/deepseek-v3.2"]
|
|
46791
|
+
function toUpstreamModelId(modelId) {
|
|
46792
|
+
if (modelId.startsWith("free/")) {
|
|
46793
|
+
return "nvidia/" + modelId.slice("free/".length);
|
|
46891
46794
|
}
|
|
46892
|
-
|
|
46893
|
-
|
|
46795
|
+
return modelId;
|
|
46796
|
+
}
|
|
46894
46797
|
var MAX_MESSAGES = 200;
|
|
46895
46798
|
var CONTEXT_LIMIT_KB = 5120;
|
|
46896
46799
|
var HEARTBEAT_INTERVAL_MS = 2e3;
|
|
@@ -48252,7 +48155,7 @@ async function tryModelRequest(upstreamUrl, method, headers, body, modelId, maxT
|
|
|
48252
48155
|
let requestBody = body;
|
|
48253
48156
|
try {
|
|
48254
48157
|
const parsed = JSON.parse(body.toString());
|
|
48255
|
-
parsed.model = modelId;
|
|
48158
|
+
parsed.model = toUpstreamModelId(modelId);
|
|
48256
48159
|
if (Array.isArray(parsed.messages)) {
|
|
48257
48160
|
parsed.messages = normalizeMessageRoles(parsed.messages);
|
|
48258
48161
|
}
|
|
@@ -48396,7 +48299,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
48396
48299
|
const estimatedTokens = Math.ceil(fullText.length / 4);
|
|
48397
48300
|
const normalizedModel2 = typeof parsed.model === "string" ? parsed.model.trim().toLowerCase() : "";
|
|
48398
48301
|
const profileName = normalizedModel2.replace("blockrun/", "");
|
|
48399
|
-
const debugProfile = ["
|
|
48302
|
+
const debugProfile = ["eco", "auto", "premium"].includes(profileName) ? profileName : "auto";
|
|
48400
48303
|
const scoring = classifyByRules(
|
|
48401
48304
|
debugPrompt,
|
|
48402
48305
|
systemPrompt,
|
|
@@ -49016,20 +48919,15 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
49016
48919
|
}
|
|
49017
48920
|
}
|
|
49018
48921
|
options.onRouted?.(routingDecision);
|
|
49019
|
-
if (routingProfile === "free") {
|
|
49020
|
-
freeRequestCount++;
|
|
49021
|
-
if (freeRequestCount % 5 === 0) {
|
|
49022
|
-
balanceFallbackNotice = `> **\u{1F4A1} Tip:** Free tier gives you 11 NVIDIA models. Want Claude, GPT-5, or Gemini? Fund your wallet \u2014 starting at $0.001/request.
|
|
49023
|
-
|
|
49024
|
-
`;
|
|
49025
|
-
}
|
|
49026
|
-
}
|
|
49027
48922
|
}
|
|
49028
48923
|
}
|
|
49029
48924
|
if (!effectiveSessionId && parsedMessages.length > 0) {
|
|
49030
48925
|
effectiveSessionId = deriveSessionId(parsedMessages);
|
|
49031
48926
|
}
|
|
49032
48927
|
if (bodyModified) {
|
|
48928
|
+
if (parsed.model && typeof parsed.model === "string") {
|
|
48929
|
+
parsed.model = toUpstreamModelId(parsed.model);
|
|
48930
|
+
}
|
|
49033
48931
|
body = Buffer.from(JSON.stringify(parsed));
|
|
49034
48932
|
}
|
|
49035
48933
|
} catch (err) {
|
|
@@ -49128,28 +49026,19 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
49128
49026
|
const sufficiency = await balanceMonitor.checkSufficient(bufferedCostMicros);
|
|
49129
49027
|
if (sufficiency.info.isEmpty || !sufficiency.sufficient) {
|
|
49130
49028
|
const originalModel = modelId;
|
|
49131
|
-
const fallbackTier = routingDecision?.tier ?? "SIMPLE";
|
|
49132
|
-
const freeTierConfig = FREE_TIER_CONFIGS[fallbackTier];
|
|
49133
|
-
const freeModel = freeTierConfig.primary;
|
|
49134
49029
|
console.log(
|
|
49135
|
-
`[ClawRouter] Wallet ${sufficiency.info.isEmpty ? "empty" : "insufficient"} (${sufficiency.info.balanceUSD}), falling back to free model: ${
|
|
49030
|
+
`[ClawRouter] Wallet ${sufficiency.info.isEmpty ? "empty" : "insufficient"} (${sufficiency.info.balanceUSD}), falling back to free model: ${FREE_MODEL} (requested: ${originalModel})`
|
|
49136
49031
|
);
|
|
49137
|
-
modelId =
|
|
49032
|
+
modelId = FREE_MODEL;
|
|
49138
49033
|
isFreeModel = true;
|
|
49139
49034
|
const parsed = JSON.parse(body.toString());
|
|
49140
|
-
parsed.model =
|
|
49035
|
+
parsed.model = toUpstreamModelId(FREE_MODEL);
|
|
49141
49036
|
body = Buffer.from(JSON.stringify(parsed));
|
|
49142
49037
|
balanceFallbackNotice = sufficiency.info.isEmpty ? `> **\u26A0\uFE0F Wallet empty** \u2014 using free model. Fund your wallet to use ${originalModel}.
|
|
49143
49038
|
|
|
49144
49039
|
` : `> **\u26A0\uFE0F Insufficient balance** (${sufficiency.info.balanceUSD}) \u2014 using free model instead of ${originalModel}.
|
|
49145
49040
|
|
|
49146
49041
|
`;
|
|
49147
|
-
freeRequestCount++;
|
|
49148
|
-
if (freeRequestCount % 5 === 0) {
|
|
49149
|
-
balanceFallbackNotice = `> **\u{1F4A1} Tip:** Free tier gives you 11 NVIDIA models. Want Claude, GPT-5, or Gemini? Fund your wallet \u2014 starting at $0.001/request.
|
|
49150
|
-
|
|
49151
|
-
`;
|
|
49152
|
-
}
|
|
49153
49042
|
options.onLowBalance?.({
|
|
49154
49043
|
balanceUSD: sufficiency.info.balanceUSD,
|
|
49155
49044
|
walletAddress: sufficiency.info.walletAddress
|