@blockrun/clawrouter 0.8.23 → 0.8.24

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 CHANGED
@@ -30,6 +30,7 @@ _The world's first hackathon run entirely by AI agents, powered by USDC_
30
30
 
31
31
  ## Why ClawRouter?
32
32
 
33
+ - **4 routing profiles** — auto (balanced), eco (95.9-100% savings), premium (best quality), free (zero cost)
33
34
  - **100% local routing** — 15-dimension weighted scoring runs on your machine in <1ms
34
35
  - **Zero external calls** — no API calls for routing decisions, ever
35
36
  - **30+ models** — OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot through one wallet
@@ -73,13 +74,21 @@ Done! Smart routing (`blockrun/auto`) is now your default model.
73
74
 
74
75
  **For advanced users:** See the [complete manual installation guide](docs/windows-installation.md) with step-by-step PowerShell instructions.
75
76
 
76
- ### Tips
77
+ ### Routing Profiles
77
78
 
78
- - **Use `/model blockrun/auto`** in any conversation to switch on the fly
79
- - **Free tier?** Use `/model free` — routes to gpt-oss-120b at $0
80
- - **Model aliases:** `/model sonnet`, `/model grok`, `/model deepseek`, `/model kimi`
81
- - **Want a specific model?** Use `blockrun/openai/gpt-4o` or `blockrun/anthropic/claude-sonnet-4`
82
- - **Already have a funded wallet?** `export BLOCKRUN_WALLET_KEY=0x...`
79
+ Choose your routing strategy with `/model <profile>`:
80
+
81
+ | Profile | Strategy | Savings | Use Case |
82
+ |---------|----------|---------|----------|
83
+ | `/model auto` | Balanced (default) | 74-100% | Best overall balance |
84
+ | `/model eco` | Cost optimized | 95.9-100% | Maximum savings |
85
+ | `/model premium` | Quality focused | 0% | Best quality (Opus 4.5) |
86
+ | `/model free` | Free tier only | 100% | Zero cost |
87
+
88
+ **Other shortcuts:**
89
+ - **Model aliases:** `/model sonnet`, `/model grok`, `/model gpt5`, `/model o3`
90
+ - **Specific models:** `blockrun/openai/gpt-4o` or `blockrun/anthropic/claude-sonnet-4`
91
+ - **Bring your wallet:** `export BLOCKRUN_WALLET_KEY=0x...`
83
92
 
84
93
  ---
85
94
 
@@ -116,6 +125,27 @@ No external classifier calls. Ambiguous queries default to the MEDIUM tier (Grok
116
125
 
117
126
  **Deep dive:** [15-dimension scoring weights](docs/configuration.md#scoring-weights) | [Architecture](docs/architecture.md)
118
127
 
128
+ ### Routing Profiles (NEW in v0.8.21)
129
+
130
+ ClawRouter now offers 4 routing profiles to match different priorities:
131
+
132
+ | Profile | Strategy | Savings vs Opus 4.5 | When to Use |
133
+ |---------|----------|---------------------|-------------|
134
+ | **auto** (default) | Balanced quality + cost | 74-100% | General use, best overall |
135
+ | **eco** | Maximum cost savings | 95.9-100% | Budget-conscious, high volume |
136
+ | **premium** | Best quality only | 0% | Mission-critical tasks |
137
+ | **free** | Free tier only | 100% | Testing, empty wallet |
138
+
139
+ Switch profiles anytime: `/model eco`, `/model premium`, `/model auto`
140
+
141
+ **Example:**
142
+ ```
143
+ /model eco # Switch to cost-optimized routing
144
+ "Write a React component" # Routes to DeepSeek ($0.28/$0.42)
145
+ # vs Auto → Grok ($0.20/$1.50)
146
+ # 98.3% savings vs Opus 4.5
147
+ ```
148
+
119
149
  ### Tier → Model Mapping
120
150
 
121
151
  | Tier | Primary Model | Cost/M | Savings vs Opus |
package/dist/cli.js CHANGED
@@ -1147,9 +1147,15 @@ var DEFAULT_ROUTING_CONFIG = {
1147
1147
  ]
1148
1148
  },
1149
1149
  COMPLEX: {
1150
- primary: "google/gemini-2.5-pro",
1151
- fallback: ["xai/grok-4-0709", "openai/gpt-4o", "openai/gpt-5.2", "anthropic/claude-sonnet-4"]
1152
- // Grok first for cost efficiency, Sonnet as last resort
1150
+ primary: "google/gemini-3-pro-preview",
1151
+ // Latest Gemini - upgraded from 2.5
1152
+ fallback: [
1153
+ "google/gemini-2.5-pro",
1154
+ "xai/grok-4-0709",
1155
+ "openai/gpt-4o",
1156
+ "openai/gpt-5.2",
1157
+ "anthropic/claude-sonnet-4"
1158
+ ]
1153
1159
  },
1154
1160
  REASONING: {
1155
1161
  primary: "xai/grok-4-1-fast-reasoning",
@@ -1157,7 +1163,8 @@ var DEFAULT_ROUTING_CONFIG = {
1157
1163
  fallback: [
1158
1164
  "xai/grok-4-fast-reasoning",
1159
1165
  "openai/o3",
1160
- // Strong reasoning model
1166
+ "openai/o4-mini",
1167
+ // Latest o-series mini
1161
1168
  "deepseek/deepseek-reasoner",
1162
1169
  "moonshot/kimi-k2.5"
1163
1170
  ]
@@ -1200,13 +1207,25 @@ var DEFAULT_ROUTING_CONFIG = {
1200
1207
  },
1201
1208
  COMPLEX: {
1202
1209
  primary: "anthropic/claude-opus-4.5",
1203
- // $15/$75
1204
- fallback: ["openai/gpt-5.2", "anthropic/claude-sonnet-4", "google/gemini-2.5-pro"]
1210
+ // $5/$25 - Latest Opus
1211
+ fallback: [
1212
+ "openai/gpt-5.2-pro",
1213
+ // $21/$168 - Latest GPT pro
1214
+ "google/gemini-3-pro-preview",
1215
+ // Latest Gemini
1216
+ "openai/gpt-5.2",
1217
+ "anthropic/claude-sonnet-4"
1218
+ ]
1205
1219
  },
1206
1220
  REASONING: {
1207
1221
  primary: "openai/o3",
1208
- // $10/$40
1209
- fallback: ["anthropic/claude-opus-4.5", "openai/o1", "google/gemini-2.5-pro"]
1222
+ // $2/$8 - Best value reasoning
1223
+ fallback: [
1224
+ "openai/o4-mini",
1225
+ // Latest o-series
1226
+ "anthropic/claude-opus-4.5",
1227
+ "google/gemini-3-pro-preview"
1228
+ ]
1210
1229
  }
1211
1230
  },
1212
1231
  // Agentic tier configs - models that excel at multi-step autonomous tasks
@@ -1227,13 +1246,23 @@ var DEFAULT_ROUTING_CONFIG = {
1227
1246
  },
1228
1247
  COMPLEX: {
1229
1248
  primary: "anthropic/claude-sonnet-4",
1230
- fallback: ["anthropic/claude-opus-4.5", "openai/gpt-5.2", "xai/grok-4-0709"]
1231
- // Opus 4.5 is 3x cheaper than Opus 4
1249
+ fallback: [
1250
+ "anthropic/claude-opus-4.5",
1251
+ // Latest Opus - best agentic
1252
+ "openai/gpt-5.2",
1253
+ "google/gemini-3-pro-preview",
1254
+ "xai/grok-4-0709"
1255
+ ]
1232
1256
  },
1233
1257
  REASONING: {
1234
1258
  primary: "anthropic/claude-sonnet-4",
1235
1259
  // Strong tool use + reasoning for agentic tasks
1236
- fallback: ["xai/grok-4-fast-reasoning", "moonshot/kimi-k2.5", "deepseek/deepseek-reasoner"]
1260
+ fallback: [
1261
+ "anthropic/claude-opus-4.5",
1262
+ "xai/grok-4-fast-reasoning",
1263
+ "moonshot/kimi-k2.5",
1264
+ "deepseek/deepseek-reasoner"
1265
+ ]
1237
1266
  }
1238
1267
  },
1239
1268
  overrides: {
@@ -2372,6 +2401,16 @@ var FREE_MODEL = "nvidia/gpt-oss-120b";
2372
2401
  var HEARTBEAT_INTERVAL_MS = 2e3;
2373
2402
  var DEFAULT_REQUEST_TIMEOUT_MS = 18e4;
2374
2403
  var DEFAULT_PORT = 8402;
2404
+ var PROXY_PORT = (() => {
2405
+ const envPort = process.env.BLOCKRUN_PROXY_PORT;
2406
+ if (envPort) {
2407
+ const parsed = parseInt(envPort, 10);
2408
+ if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
2409
+ return parsed;
2410
+ }
2411
+ }
2412
+ return DEFAULT_PORT;
2413
+ })();
2375
2414
  var MAX_FALLBACK_ATTEMPTS = 3;
2376
2415
  var HEALTH_CHECK_TIMEOUT_MS = 2e3;
2377
2416
  var RATE_LIMIT_COOLDOWN_MS = 6e4;
@@ -2471,14 +2510,7 @@ function safeWrite(res, data) {
2471
2510
  }
2472
2511
  var BALANCE_CHECK_BUFFER = 1.5;
2473
2512
  function getProxyPort() {
2474
- const envPort = process.env.BLOCKRUN_PROXY_PORT;
2475
- if (envPort) {
2476
- const parsed = parseInt(envPort, 10);
2477
- if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
2478
- return parsed;
2479
- }
2480
- }
2481
- return DEFAULT_PORT;
2513
+ return PROXY_PORT;
2482
2514
  }
2483
2515
  async function checkExistingProxy(port) {
2484
2516
  const controller = new AbortController();