@blockrun/clawrouter 0.12.231 → 0.12.233
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 +3 -2
- package/dist/cli.js +66 -12
- package/dist/index.js +64 -10
- package/docs/routing-profiles.md +6 -6
- package/package.json +1 -1
- package/scripts/reinstall.sh +1 -1
- package/skills/clawrouter/SKILL.md +1 -1
- package/src/top-models.json +1 -0
package/README.md
CHANGED
|
@@ -140,7 +140,7 @@ models:
|
|
|
140
140
|
- apply
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
To pin a specific model, replace `blockrun/auto` with any model from [blockrun.ai/models](https://blockrun.ai/models), e.g. `anthropic/claude-opus-
|
|
143
|
+
To pin a specific model, replace `blockrun/auto` with any model from [blockrun.ai/models](https://blockrun.ai/models), e.g. `anthropic/claude-opus-5`, `xai/grok-4.5`.
|
|
144
144
|
|
|
145
145
|
Both `provider: openai` and `provider: clawrouter` work — just make sure `apiBase` ends with `/v1/`.
|
|
146
146
|
|
|
@@ -211,7 +211,7 @@ Request → Weighted Scorer (15 dimensions) → Tier → Best Model → Response
|
|
|
211
211
|
| --------- | ------------------------------------ | ------------------------------- | ---------------------------- |
|
|
212
212
|
| SIMPLE | free/mistral-large-3-675b (**FREE**) | gemini-2.5-flash ($0.30/$2.50) | kimi-k2.7 ($0.95/$4.00) |
|
|
213
213
|
| MEDIUM | gemini-3.1-flash-lite ($0.25/$1.50) | kimi-k2.7 ($0.95/$4.00) | gpt-5.3-codex ($1.75/$14.00) |
|
|
214
|
-
| COMPLEX | gemini-3.1-flash-lite ($0.25/$1.50) | gemini-3.1-pro ($2/$12) | claude-
|
|
214
|
+
| COMPLEX | gemini-3.1-flash-lite ($0.25/$1.50) | gemini-3.1-pro ($2/$12) | claude-fable-5 ($10/$50) |
|
|
215
215
|
| REASONING | deepseek-reasoner ($0.20/$0.40) | deepseek-reasoner ($0.20/$0.40) | claude-sonnet-4.6 ($3/$15) |
|
|
216
216
|
|
|
217
217
|
**Blended average: $2.05/M** vs $25/M for Claude Opus = **92% savings**
|
|
@@ -456,6 +456,7 @@ No Surf account, no API key — settles directly to Surf's Base treasury in USDC
|
|
|
456
456
|
| --------------------------- | --------: | ---------: | ---------: | ------- | --------------------------------- |
|
|
457
457
|
| anthropic/claude-sonnet-5 | $3.00 | $15.00 | $0.0090 | 1M | reasoning, vision, agentic, tools |
|
|
458
458
|
| anthropic/claude-sonnet-4.6 | $3.00 | $15.00 | $0.0090 | 200K | reasoning, vision, agentic, tools |
|
|
459
|
+
| anthropic/claude-opus-5 | $5.00 | $25.00 | $0.0150 | 1M | reasoning, vision, agentic, tools |
|
|
459
460
|
| anthropic/claude-opus-4.8 | $5.00 | $25.00 | $0.0150 | 1M | reasoning, vision, agentic, tools |
|
|
460
461
|
| openai/gpt-5.6-sol | $5.00 | $30.00 | $0.0175 | 1M | reasoning, vision, agentic, tools |
|
|
461
462
|
| openai/gpt-5.5 | $5.00 | $30.00 | $0.0175 | 1M | reasoning, vision, agentic, tools |
|
package/dist/cli.js
CHANGED
|
@@ -31393,6 +31393,22 @@ var init_esm4 = __esm({
|
|
|
31393
31393
|
}
|
|
31394
31394
|
});
|
|
31395
31395
|
|
|
31396
|
+
// src/max-tokens.ts
|
|
31397
|
+
function resolveMaxTokens(parsed, fallback2 = DEFAULT_MAX_TOKENS) {
|
|
31398
|
+
const usable = (v) => typeof v === "number" && Number.isFinite(v) && v > 0 ? v : void 0;
|
|
31399
|
+
const candidates = [usable(parsed.max_tokens), usable(parsed.max_completion_tokens)].filter(
|
|
31400
|
+
(n) => n !== void 0
|
|
31401
|
+
);
|
|
31402
|
+
return candidates.length > 0 ? Math.max(...candidates) : fallback2;
|
|
31403
|
+
}
|
|
31404
|
+
var DEFAULT_MAX_TOKENS;
|
|
31405
|
+
var init_max_tokens = __esm({
|
|
31406
|
+
"src/max-tokens.ts"() {
|
|
31407
|
+
"use strict";
|
|
31408
|
+
DEFAULT_MAX_TOKENS = 4096;
|
|
31409
|
+
}
|
|
31410
|
+
});
|
|
31411
|
+
|
|
31396
31412
|
// src/payment-preauth.ts
|
|
31397
31413
|
function createPayFetchWithPreAuth(baseFetch, client, ttlMs = DEFAULT_TTL_MS, options) {
|
|
31398
31414
|
const httpClient = new x402HTTPClient(client);
|
|
@@ -31410,7 +31426,7 @@ function createPayFetchWithPreAuth(baseFetch, client, ttlMs = DEFAULT_TTL_MS, op
|
|
|
31410
31426
|
bodyLength = bodyStr.length;
|
|
31411
31427
|
const parsed = JSON.parse(bodyStr);
|
|
31412
31428
|
requestModel = parsed.model ?? "";
|
|
31413
|
-
maxTokens =
|
|
31429
|
+
maxTokens = resolveMaxTokens(parsed, 0);
|
|
31414
31430
|
}
|
|
31415
31431
|
} catch {
|
|
31416
31432
|
}
|
|
@@ -31481,6 +31497,7 @@ var init_payment_preauth = __esm({
|
|
|
31481
31497
|
"src/payment-preauth.ts"() {
|
|
31482
31498
|
"use strict";
|
|
31483
31499
|
init_esm4();
|
|
31500
|
+
init_max_tokens();
|
|
31484
31501
|
DEFAULT_TTL_MS = 36e5;
|
|
31485
31502
|
}
|
|
31486
31503
|
});
|
|
@@ -34084,8 +34101,10 @@ var init_config = __esm({
|
|
|
34084
34101
|
// back to Google at the same time). Prefer xAI Grok → Moonshot → OpenAI
|
|
34085
34102
|
// flagship → DeepSeek → NVIDIA free instead.
|
|
34086
34103
|
fallback: [
|
|
34087
|
-
"anthropic/claude-opus-
|
|
34104
|
+
"anthropic/claude-opus-5",
|
|
34088
34105
|
// in-family hot swap first (half the price, 1M ctx + adaptive thinking)
|
|
34106
|
+
"anthropic/claude-opus-4.8",
|
|
34107
|
+
// in-family hot swap (identical cost to 5)
|
|
34089
34108
|
"anthropic/claude-opus-4.7",
|
|
34090
34109
|
// in-family hot swap (identical cost to 4.8)
|
|
34091
34110
|
"anthropic/claude-opus-4.6",
|
|
@@ -34120,8 +34139,10 @@ var init_config = __esm({
|
|
|
34120
34139
|
fallback: [
|
|
34121
34140
|
"anthropic/claude-sonnet-5",
|
|
34122
34141
|
// in-family hot swap — same cost, adaptive thinking, 1M ctx
|
|
34123
|
-
"anthropic/claude-opus-
|
|
34142
|
+
"anthropic/claude-opus-5",
|
|
34124
34143
|
// Newest flagship Opus w/ adaptive thinking
|
|
34144
|
+
"anthropic/claude-opus-4.8",
|
|
34145
|
+
// Prior flagship Opus — identical cost to 5
|
|
34125
34146
|
"anthropic/claude-opus-4.7",
|
|
34126
34147
|
// Flagship Opus w/ adaptive thinking
|
|
34127
34148
|
"anthropic/claude-opus-4.6",
|
|
@@ -34176,8 +34197,10 @@ var init_config = __esm({
|
|
|
34176
34197
|
fallback: [
|
|
34177
34198
|
"anthropic/claude-sonnet-5",
|
|
34178
34199
|
// in-family hot swap — same cost, near-Opus agentic quality
|
|
34179
|
-
"anthropic/claude-opus-
|
|
34200
|
+
"anthropic/claude-opus-5",
|
|
34180
34201
|
// Newest flagship Opus — in-family hot swap
|
|
34202
|
+
"anthropic/claude-opus-4.8",
|
|
34203
|
+
// Prior flagship Opus — identical cost to 5
|
|
34181
34204
|
"anthropic/claude-opus-4.7",
|
|
34182
34205
|
// Flagship Opus — in-family hot swap
|
|
34183
34206
|
"anthropic/claude-opus-4.6",
|
|
@@ -34206,8 +34229,10 @@ var init_config = __esm({
|
|
|
34206
34229
|
fallback: [
|
|
34207
34230
|
"anthropic/claude-sonnet-5",
|
|
34208
34231
|
// in-family hot swap — same cost, adaptive thinking
|
|
34209
|
-
"anthropic/claude-opus-
|
|
34232
|
+
"anthropic/claude-opus-5",
|
|
34210
34233
|
// Newest flagship Opus w/ adaptive thinking
|
|
34234
|
+
"anthropic/claude-opus-4.8",
|
|
34235
|
+
// Prior flagship Opus — identical cost to 5
|
|
34211
34236
|
"anthropic/claude-opus-4.7",
|
|
34212
34237
|
// Flagship Opus w/ adaptive thinking
|
|
34213
34238
|
"anthropic/claude-opus-4.6",
|
|
@@ -34268,6 +34293,7 @@ var init_top_models = __esm({
|
|
|
34268
34293
|
"eco",
|
|
34269
34294
|
"free",
|
|
34270
34295
|
"anthropic/claude-fable-5",
|
|
34296
|
+
"anthropic/claude-opus-5",
|
|
34271
34297
|
"anthropic/claude-opus-4.8",
|
|
34272
34298
|
"anthropic/claude-opus-4.7",
|
|
34273
34299
|
"anthropic/claude-sonnet-5",
|
|
@@ -34423,7 +34449,7 @@ var init_models = __esm({
|
|
|
34423
34449
|
"use strict";
|
|
34424
34450
|
init_top_models2();
|
|
34425
34451
|
MODEL_ALIASES = {
|
|
34426
|
-
// Claude - flagship opus is
|
|
34452
|
+
// Claude - flagship opus is 5; bare sonnet stays at 4.6 (sonnet-5 is opt-in
|
|
34427
34453
|
// via explicit `sonnet-5` — not promoted to the bare alias pending benchmarks)
|
|
34428
34454
|
claude: "anthropic/claude-sonnet-4.6",
|
|
34429
34455
|
"br-sonnet": "anthropic/claude-sonnet-4.6",
|
|
@@ -34447,7 +34473,15 @@ var init_models = __esm({
|
|
|
34447
34473
|
fable: "anthropic/claude-fable-5",
|
|
34448
34474
|
"fable-5": "anthropic/claude-fable-5",
|
|
34449
34475
|
"fable-5.0": "anthropic/claude-fable-5",
|
|
34450
|
-
opus:
|
|
34476
|
+
// Opus 5 (2026-07-24) takes the bare `opus` alias: identical $5/$25 and the
|
|
34477
|
+
// same 1M/128K envelope as 4.8, so no per-call-cap wallet changes behavior,
|
|
34478
|
+
// and BlockRun already repointed `clawrouter-premium` → opus-5. `opus-4` and
|
|
34479
|
+
// `anthropic/claude-opus-4` stay on 4.8 — they name the 4-series generation.
|
|
34480
|
+
// Note: `anthropic/claude-opus-5` must NOT be an alias key (see fable note).
|
|
34481
|
+
opus: "anthropic/claude-opus-5",
|
|
34482
|
+
"opus-5": "anthropic/claude-opus-5",
|
|
34483
|
+
"opus-5.0": "anthropic/claude-opus-5",
|
|
34484
|
+
"opus-5-0": "anthropic/claude-opus-5",
|
|
34451
34485
|
"opus-4": "anthropic/claude-opus-4.8",
|
|
34452
34486
|
"opus-4.8": "anthropic/claude-opus-4.8",
|
|
34453
34487
|
"opus-4-8": "anthropic/claude-opus-4.8",
|
|
@@ -34461,7 +34495,9 @@ var init_models = __esm({
|
|
|
34461
34495
|
// fable-5 relisted 2026-07-06 (see note above)
|
|
34462
34496
|
"anthropic/fable": "anthropic/claude-fable-5",
|
|
34463
34497
|
"anthropic/claude-fable-5.0": "anthropic/claude-fable-5",
|
|
34464
|
-
"anthropic/opus": "anthropic/claude-opus-
|
|
34498
|
+
"anthropic/opus": "anthropic/claude-opus-5",
|
|
34499
|
+
"anthropic/claude-opus-5.0": "anthropic/claude-opus-5",
|
|
34500
|
+
"anthropic/claude-opus-5-0": "anthropic/claude-opus-5",
|
|
34465
34501
|
"anthropic/haiku": "anthropic/claude-haiku-4.5",
|
|
34466
34502
|
"anthropic/claude": "anthropic/claude-sonnet-4.6",
|
|
34467
34503
|
// Backward compatibility - generic opus-4 and older flagships point at 4.8;
|
|
@@ -35176,6 +35212,22 @@ var init_models = __esm({
|
|
|
35176
35212
|
agentic: true,
|
|
35177
35213
|
toolCalling: true
|
|
35178
35214
|
},
|
|
35215
|
+
// claude-opus-5 added 2026-07-24 (BlockRun launch-day sync, PR #283).
|
|
35216
|
+
// Same $5/$25 as Opus 4.8 — Anthropic bills the 1M window at standard rates,
|
|
35217
|
+
// so there is no long-context premium to model here.
|
|
35218
|
+
{
|
|
35219
|
+
id: "anthropic/claude-opus-5",
|
|
35220
|
+
name: "Claude Opus 5",
|
|
35221
|
+
version: "5",
|
|
35222
|
+
inputPrice: 5,
|
|
35223
|
+
outputPrice: 25,
|
|
35224
|
+
contextWindow: 1e6,
|
|
35225
|
+
maxOutput: 128e3,
|
|
35226
|
+
reasoning: true,
|
|
35227
|
+
vision: true,
|
|
35228
|
+
agentic: true,
|
|
35229
|
+
toolCalling: true
|
|
35230
|
+
},
|
|
35179
35231
|
// Google
|
|
35180
35232
|
{
|
|
35181
35233
|
id: "google/gemini-3.1-pro",
|
|
@@ -86091,7 +86143,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
86091
86143
|
let hasVision = false;
|
|
86092
86144
|
let isStreaming = false;
|
|
86093
86145
|
let modelId = "";
|
|
86094
|
-
let maxTokens =
|
|
86146
|
+
let maxTokens = DEFAULT_MAX_TOKENS;
|
|
86095
86147
|
let routingProfile = null;
|
|
86096
86148
|
let stickyExplicitModel;
|
|
86097
86149
|
let balanceFallbackNotice;
|
|
@@ -86110,7 +86162,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
86110
86162
|
const parsed = JSON.parse(body.toString());
|
|
86111
86163
|
isStreaming = parsed.stream === true;
|
|
86112
86164
|
modelId = parsed.model || "";
|
|
86113
|
-
maxTokens = parsed
|
|
86165
|
+
maxTokens = resolveMaxTokens(parsed);
|
|
86114
86166
|
let bodyModified = false;
|
|
86115
86167
|
const parsedMessages = Array.isArray(parsed.messages) ? parsed.messages : [];
|
|
86116
86168
|
const lastUserMsg = [...parsedMessages].reverse().find((m) => m.role === "user");
|
|
@@ -88107,6 +88159,7 @@ var init_proxy = __esm({
|
|
|
88107
88159
|
init_router();
|
|
88108
88160
|
init_rules();
|
|
88109
88161
|
init_models();
|
|
88162
|
+
init_max_tokens();
|
|
88110
88163
|
init_logger();
|
|
88111
88164
|
init_stats();
|
|
88112
88165
|
init_dedup();
|
|
@@ -88124,6 +88177,7 @@ var init_proxy = __esm({
|
|
|
88124
88177
|
init_textual_tool_calls();
|
|
88125
88178
|
init_response_store();
|
|
88126
88179
|
init_share_formatters();
|
|
88180
|
+
init_max_tokens();
|
|
88127
88181
|
paymentStore = new AsyncLocalStorage();
|
|
88128
88182
|
BLOCKRUN_API = "https://blockrun.ai/api";
|
|
88129
88183
|
BLOCKRUN_SOLANA_API = "https://sol.blockrun.ai/api";
|
|
@@ -219799,8 +219853,8 @@ var DOCTOR_MODELS = {
|
|
|
219799
219853
|
cost: "~$0.003"
|
|
219800
219854
|
},
|
|
219801
219855
|
opus: {
|
|
219802
|
-
id: "anthropic/claude-opus-
|
|
219803
|
-
name: "Claude Opus
|
|
219856
|
+
id: "anthropic/claude-opus-5",
|
|
219857
|
+
name: "Claude Opus 5",
|
|
219804
219858
|
cost: "~$0.01"
|
|
219805
219859
|
}
|
|
219806
219860
|
};
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ var init_top_models = __esm({
|
|
|
58
58
|
"eco",
|
|
59
59
|
"free",
|
|
60
60
|
"anthropic/claude-fable-5",
|
|
61
|
+
"anthropic/claude-opus-5",
|
|
61
62
|
"anthropic/claude-opus-4.8",
|
|
62
63
|
"anthropic/claude-opus-4.7",
|
|
63
64
|
"anthropic/claude-sonnet-5",
|
|
@@ -213,7 +214,7 @@ var init_models = __esm({
|
|
|
213
214
|
"use strict";
|
|
214
215
|
init_top_models2();
|
|
215
216
|
MODEL_ALIASES = {
|
|
216
|
-
// Claude - flagship opus is
|
|
217
|
+
// Claude - flagship opus is 5; bare sonnet stays at 4.6 (sonnet-5 is opt-in
|
|
217
218
|
// via explicit `sonnet-5` — not promoted to the bare alias pending benchmarks)
|
|
218
219
|
claude: "anthropic/claude-sonnet-4.6",
|
|
219
220
|
"br-sonnet": "anthropic/claude-sonnet-4.6",
|
|
@@ -237,7 +238,15 @@ var init_models = __esm({
|
|
|
237
238
|
fable: "anthropic/claude-fable-5",
|
|
238
239
|
"fable-5": "anthropic/claude-fable-5",
|
|
239
240
|
"fable-5.0": "anthropic/claude-fable-5",
|
|
240
|
-
opus:
|
|
241
|
+
// Opus 5 (2026-07-24) takes the bare `opus` alias: identical $5/$25 and the
|
|
242
|
+
// same 1M/128K envelope as 4.8, so no per-call-cap wallet changes behavior,
|
|
243
|
+
// and BlockRun already repointed `clawrouter-premium` → opus-5. `opus-4` and
|
|
244
|
+
// `anthropic/claude-opus-4` stay on 4.8 — they name the 4-series generation.
|
|
245
|
+
// Note: `anthropic/claude-opus-5` must NOT be an alias key (see fable note).
|
|
246
|
+
opus: "anthropic/claude-opus-5",
|
|
247
|
+
"opus-5": "anthropic/claude-opus-5",
|
|
248
|
+
"opus-5.0": "anthropic/claude-opus-5",
|
|
249
|
+
"opus-5-0": "anthropic/claude-opus-5",
|
|
241
250
|
"opus-4": "anthropic/claude-opus-4.8",
|
|
242
251
|
"opus-4.8": "anthropic/claude-opus-4.8",
|
|
243
252
|
"opus-4-8": "anthropic/claude-opus-4.8",
|
|
@@ -251,7 +260,9 @@ var init_models = __esm({
|
|
|
251
260
|
// fable-5 relisted 2026-07-06 (see note above)
|
|
252
261
|
"anthropic/fable": "anthropic/claude-fable-5",
|
|
253
262
|
"anthropic/claude-fable-5.0": "anthropic/claude-fable-5",
|
|
254
|
-
"anthropic/opus": "anthropic/claude-opus-
|
|
263
|
+
"anthropic/opus": "anthropic/claude-opus-5",
|
|
264
|
+
"anthropic/claude-opus-5.0": "anthropic/claude-opus-5",
|
|
265
|
+
"anthropic/claude-opus-5-0": "anthropic/claude-opus-5",
|
|
255
266
|
"anthropic/haiku": "anthropic/claude-haiku-4.5",
|
|
256
267
|
"anthropic/claude": "anthropic/claude-sonnet-4.6",
|
|
257
268
|
// Backward compatibility - generic opus-4 and older flagships point at 4.8;
|
|
@@ -966,6 +977,22 @@ var init_models = __esm({
|
|
|
966
977
|
agentic: true,
|
|
967
978
|
toolCalling: true
|
|
968
979
|
},
|
|
980
|
+
// claude-opus-5 added 2026-07-24 (BlockRun launch-day sync, PR #283).
|
|
981
|
+
// Same $5/$25 as Opus 4.8 — Anthropic bills the 1M window at standard rates,
|
|
982
|
+
// so there is no long-context premium to model here.
|
|
983
|
+
{
|
|
984
|
+
id: "anthropic/claude-opus-5",
|
|
985
|
+
name: "Claude Opus 5",
|
|
986
|
+
version: "5",
|
|
987
|
+
inputPrice: 5,
|
|
988
|
+
outputPrice: 25,
|
|
989
|
+
contextWindow: 1e6,
|
|
990
|
+
maxOutput: 128e3,
|
|
991
|
+
reasoning: true,
|
|
992
|
+
vision: true,
|
|
993
|
+
agentic: true,
|
|
994
|
+
toolCalling: true
|
|
995
|
+
},
|
|
969
996
|
// Google
|
|
970
997
|
{
|
|
971
998
|
id: "google/gemini-3.1-pro",
|
|
@@ -32917,6 +32944,22 @@ var init_esm4 = __esm({
|
|
|
32917
32944
|
}
|
|
32918
32945
|
});
|
|
32919
32946
|
|
|
32947
|
+
// src/max-tokens.ts
|
|
32948
|
+
function resolveMaxTokens(parsed, fallback2 = DEFAULT_MAX_TOKENS) {
|
|
32949
|
+
const usable = (v) => typeof v === "number" && Number.isFinite(v) && v > 0 ? v : void 0;
|
|
32950
|
+
const candidates = [usable(parsed.max_tokens), usable(parsed.max_completion_tokens)].filter(
|
|
32951
|
+
(n) => n !== void 0
|
|
32952
|
+
);
|
|
32953
|
+
return candidates.length > 0 ? Math.max(...candidates) : fallback2;
|
|
32954
|
+
}
|
|
32955
|
+
var DEFAULT_MAX_TOKENS;
|
|
32956
|
+
var init_max_tokens = __esm({
|
|
32957
|
+
"src/max-tokens.ts"() {
|
|
32958
|
+
"use strict";
|
|
32959
|
+
DEFAULT_MAX_TOKENS = 4096;
|
|
32960
|
+
}
|
|
32961
|
+
});
|
|
32962
|
+
|
|
32920
32963
|
// src/payment-preauth.ts
|
|
32921
32964
|
function createPayFetchWithPreAuth(baseFetch, client, ttlMs = DEFAULT_TTL_MS, options) {
|
|
32922
32965
|
const httpClient = new x402HTTPClient(client);
|
|
@@ -32934,7 +32977,7 @@ function createPayFetchWithPreAuth(baseFetch, client, ttlMs = DEFAULT_TTL_MS, op
|
|
|
32934
32977
|
bodyLength = bodyStr.length;
|
|
32935
32978
|
const parsed = JSON.parse(bodyStr);
|
|
32936
32979
|
requestModel = parsed.model ?? "";
|
|
32937
|
-
maxTokens =
|
|
32980
|
+
maxTokens = resolveMaxTokens(parsed, 0);
|
|
32938
32981
|
}
|
|
32939
32982
|
} catch {
|
|
32940
32983
|
}
|
|
@@ -33005,6 +33048,7 @@ var init_payment_preauth = __esm({
|
|
|
33005
33048
|
"src/payment-preauth.ts"() {
|
|
33006
33049
|
"use strict";
|
|
33007
33050
|
init_esm4();
|
|
33051
|
+
init_max_tokens();
|
|
33008
33052
|
DEFAULT_TTL_MS = 36e5;
|
|
33009
33053
|
}
|
|
33010
33054
|
});
|
|
@@ -35608,8 +35652,10 @@ var init_config = __esm({
|
|
|
35608
35652
|
// back to Google at the same time). Prefer xAI Grok → Moonshot → OpenAI
|
|
35609
35653
|
// flagship → DeepSeek → NVIDIA free instead.
|
|
35610
35654
|
fallback: [
|
|
35611
|
-
"anthropic/claude-opus-
|
|
35655
|
+
"anthropic/claude-opus-5",
|
|
35612
35656
|
// in-family hot swap first (half the price, 1M ctx + adaptive thinking)
|
|
35657
|
+
"anthropic/claude-opus-4.8",
|
|
35658
|
+
// in-family hot swap (identical cost to 5)
|
|
35613
35659
|
"anthropic/claude-opus-4.7",
|
|
35614
35660
|
// in-family hot swap (identical cost to 4.8)
|
|
35615
35661
|
"anthropic/claude-opus-4.6",
|
|
@@ -35644,8 +35690,10 @@ var init_config = __esm({
|
|
|
35644
35690
|
fallback: [
|
|
35645
35691
|
"anthropic/claude-sonnet-5",
|
|
35646
35692
|
// in-family hot swap — same cost, adaptive thinking, 1M ctx
|
|
35647
|
-
"anthropic/claude-opus-
|
|
35693
|
+
"anthropic/claude-opus-5",
|
|
35648
35694
|
// Newest flagship Opus w/ adaptive thinking
|
|
35695
|
+
"anthropic/claude-opus-4.8",
|
|
35696
|
+
// Prior flagship Opus — identical cost to 5
|
|
35649
35697
|
"anthropic/claude-opus-4.7",
|
|
35650
35698
|
// Flagship Opus w/ adaptive thinking
|
|
35651
35699
|
"anthropic/claude-opus-4.6",
|
|
@@ -35700,8 +35748,10 @@ var init_config = __esm({
|
|
|
35700
35748
|
fallback: [
|
|
35701
35749
|
"anthropic/claude-sonnet-5",
|
|
35702
35750
|
// in-family hot swap — same cost, near-Opus agentic quality
|
|
35703
|
-
"anthropic/claude-opus-
|
|
35751
|
+
"anthropic/claude-opus-5",
|
|
35704
35752
|
// Newest flagship Opus — in-family hot swap
|
|
35753
|
+
"anthropic/claude-opus-4.8",
|
|
35754
|
+
// Prior flagship Opus — identical cost to 5
|
|
35705
35755
|
"anthropic/claude-opus-4.7",
|
|
35706
35756
|
// Flagship Opus — in-family hot swap
|
|
35707
35757
|
"anthropic/claude-opus-4.6",
|
|
@@ -35730,8 +35780,10 @@ var init_config = __esm({
|
|
|
35730
35780
|
fallback: [
|
|
35731
35781
|
"anthropic/claude-sonnet-5",
|
|
35732
35782
|
// in-family hot swap — same cost, adaptive thinking
|
|
35733
|
-
"anthropic/claude-opus-
|
|
35783
|
+
"anthropic/claude-opus-5",
|
|
35734
35784
|
// Newest flagship Opus w/ adaptive thinking
|
|
35785
|
+
"anthropic/claude-opus-4.8",
|
|
35786
|
+
// Prior flagship Opus — identical cost to 5
|
|
35735
35787
|
"anthropic/claude-opus-4.7",
|
|
35736
35788
|
// Flagship Opus w/ adaptive thinking
|
|
35737
35789
|
"anthropic/claude-opus-4.6",
|
|
@@ -85911,7 +85963,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
85911
85963
|
let hasVision = false;
|
|
85912
85964
|
let isStreaming = false;
|
|
85913
85965
|
let modelId = "";
|
|
85914
|
-
let maxTokens =
|
|
85966
|
+
let maxTokens = DEFAULT_MAX_TOKENS;
|
|
85915
85967
|
let routingProfile = null;
|
|
85916
85968
|
let stickyExplicitModel;
|
|
85917
85969
|
let balanceFallbackNotice;
|
|
@@ -85930,7 +85982,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
|
|
|
85930
85982
|
const parsed = JSON.parse(body.toString());
|
|
85931
85983
|
isStreaming = parsed.stream === true;
|
|
85932
85984
|
modelId = parsed.model || "";
|
|
85933
|
-
maxTokens = parsed
|
|
85985
|
+
maxTokens = resolveMaxTokens(parsed);
|
|
85934
85986
|
let bodyModified = false;
|
|
85935
85987
|
const parsedMessages = Array.isArray(parsed.messages) ? parsed.messages : [];
|
|
85936
85988
|
const lastUserMsg = [...parsedMessages].reverse().find((m) => m.role === "user");
|
|
@@ -87927,6 +87979,7 @@ var init_proxy = __esm({
|
|
|
87927
87979
|
init_router();
|
|
87928
87980
|
init_rules();
|
|
87929
87981
|
init_models();
|
|
87982
|
+
init_max_tokens();
|
|
87930
87983
|
init_logger();
|
|
87931
87984
|
init_stats();
|
|
87932
87985
|
init_dedup();
|
|
@@ -87944,6 +87997,7 @@ var init_proxy = __esm({
|
|
|
87944
87997
|
init_textual_tool_calls();
|
|
87945
87998
|
init_response_store();
|
|
87946
87999
|
init_share_formatters();
|
|
88000
|
+
init_max_tokens();
|
|
87947
88001
|
paymentStore = new AsyncLocalStorage();
|
|
87948
88002
|
BLOCKRUN_API = "https://blockrun.ai/api";
|
|
87949
88003
|
BLOCKRUN_SOLANA_API = "https://sol.blockrun.ai/api";
|
package/docs/routing-profiles.md
CHANGED
|
@@ -32,12 +32,12 @@ Use `blockrun/auto` for the best quality/price balance.
|
|
|
32
32
|
|
|
33
33
|
Use `blockrun/premium` for maximum quality.
|
|
34
34
|
|
|
35
|
-
| Tier | Primary Model | Input
|
|
36
|
-
| --------- | -------------------- |
|
|
37
|
-
| SIMPLE | moonshot/kimi-k2.6 | $0.95
|
|
38
|
-
| MEDIUM | openai/gpt-5.3-codex | $1.75
|
|
39
|
-
| COMPLEX | claude-
|
|
40
|
-
| REASONING | claude-sonnet-4.6 | $3.00
|
|
35
|
+
| Tier | Primary Model | Input | Output |
|
|
36
|
+
| --------- | -------------------- | ------ | ------ |
|
|
37
|
+
| SIMPLE | moonshot/kimi-k2.6 | $0.95 | $4.00 |
|
|
38
|
+
| MEDIUM | openai/gpt-5.3-codex | $1.75 | $14.00 |
|
|
39
|
+
| COMPLEX | claude-fable-5 | $10.00 | $50.00 |
|
|
40
|
+
| REASONING | claude-sonnet-4.6 | $3.00 | $15.00 |
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
package/package.json
CHANGED
package/scripts/reinstall.sh
CHANGED
|
@@ -877,7 +877,7 @@ fi
|
|
|
877
877
|
echo ""
|
|
878
878
|
echo "Model aliases available:"
|
|
879
879
|
echo " /model sonnet → claude-sonnet-4.6"
|
|
880
|
-
echo " /model opus → claude-opus-
|
|
880
|
+
echo " /model opus → claude-opus-5"
|
|
881
881
|
echo " /model codex → openai/gpt-5.3-codex"
|
|
882
882
|
echo " /model deepseek → deepseek/deepseek-chat"
|
|
883
883
|
echo " /model free → gpt-oss-120b (default free)"
|
|
@@ -135,7 +135,7 @@ Rules handle ~~80% of requests in <1ms. Only ambiguous queries hit the LLM class
|
|
|
135
135
|
|
|
136
136
|
## Available Models
|
|
137
137
|
|
|
138
|
-
55+ models including: gpt-5.6-terra [balanced, stable default], gpt-5.6-sol [flagship], gpt-5.6-luna [cost-efficient], gpt-5.5, gpt-5.4, gpt-4o, o3, claude-fable-5, claude-opus-4.8, claude-opus-4.7, claude-opus-4.5, claude-sonnet-5, claude-sonnet-4.6, gemini-3.1-pro, gemini-2.5-flash, deepseek-v4-pro, deepseek-chat, grok-4.5, grok-4.3, grok-build-0.1, kimi-k3 [1M ctx flagship], kimi-k2.7, qwen3.7-max [Qwen flagship, 1M ctx], and 8 free NVIDIA models (mistral-large-3-675b [default, 675B flagship], deepseek-v4-flash [1M context], seed-oss-36b [coding], nemotron-3-nano-omni-30b-a3b-reasoning [vision], mistral-nemotron, step-3.7-flash, nemotron-nano-9b-v2, nemotron-nano-12b-v2-vl [vision]).
|
|
138
|
+
55+ models including: gpt-5.6-terra [balanced, stable default], gpt-5.6-sol [flagship], gpt-5.6-luna [cost-efficient], gpt-5.5, gpt-5.4, gpt-4o, o3, claude-fable-5, claude-opus-5 [Anthropic flagship, 1M ctx], claude-opus-4.8, claude-opus-4.7, claude-opus-4.5, claude-sonnet-5, claude-sonnet-4.6, gemini-3.1-pro, gemini-2.5-flash, deepseek-v4-pro, deepseek-chat, grok-4.5, grok-4.3, grok-build-0.1, kimi-k3 [1M ctx flagship], kimi-k2.7, qwen3.7-max [Qwen flagship, 1M ctx], and 8 free NVIDIA models (mistral-large-3-675b [default, 675B flagship], deepseek-v4-flash [1M context], seed-oss-36b [coding], nemotron-3-nano-omni-30b-a3b-reasoning [vision], mistral-nemotron, step-3.7-flash, nemotron-nano-9b-v2, nemotron-nano-12b-v2-vl [vision]).
|
|
139
139
|
|
|
140
140
|
## Built-in Agent Tools
|
|
141
141
|
|