@blockrun/clawrouter 0.12.79 → 0.12.81

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/dist/cli.js CHANGED
@@ -40214,7 +40214,7 @@ var DEFAULT_ROUTING_CONFIG = {
40214
40214
  // $0.20/$1.25, 1M context
40215
40215
  "xai/grok-4-fast-non-reasoning",
40216
40216
  // 1,143ms, $0.20/$0.50 — fast fallback
40217
- "nvidia/gpt-oss-120b"
40217
+ "free/gpt-oss-120b"
40218
40218
  // 1,252ms, FREE fallback
40219
40219
  ]
40220
40220
  },
@@ -40278,10 +40278,10 @@ var DEFAULT_ROUTING_CONFIG = {
40278
40278
  // Eco tier configs - absolute cheapest (blockrun/eco)
40279
40279
  ecoTiers: {
40280
40280
  SIMPLE: {
40281
- primary: "nvidia/gpt-oss-120b",
40281
+ primary: "free/gpt-oss-120b",
40282
40282
  // FREE! $0.00/$0.00
40283
40283
  fallback: [
40284
- "nvidia/gpt-oss-20b",
40284
+ "free/gpt-oss-20b",
40285
40285
  // FREE — smaller, faster
40286
40286
  "google/gemini-3.1-flash-lite",
40287
40287
  // $0.25/$1.50 — newest flash-lite
@@ -40511,27 +40511,38 @@ var MODEL_ALIASES = {
40511
40511
  // delisted 2026-03-12
40512
40512
  "xai/grok-3-fast": "xai/grok-4-fast-reasoning",
40513
40513
  // delisted (too expensive)
40514
- // NVIDIA — existing alias kept for backward compat
40515
- nvidia: "nvidia/gpt-oss-120b",
40516
- "gpt-120b": "nvidia/gpt-oss-120b",
40517
- "gpt-20b": "nvidia/gpt-oss-20b",
40518
- // Free model aliases — "-free" suffix for models with paid twins
40519
- "deepseek-free": "nvidia/deepseek-v3.2",
40520
- "mistral-free": "nvidia/mistral-large-3-675b",
40521
- "glm-free": "nvidia/glm-4.7",
40522
- "llama-free": "nvidia/llama-4-maverick",
40523
- // Bare-name aliases for unique free models
40524
- nemotron: "nvidia/nemotron-ultra-253b",
40525
- "nemotron-ultra": "nvidia/nemotron-ultra-253b",
40526
- "nemotron-253b": "nvidia/nemotron-ultra-253b",
40527
- "nemotron-super": "nvidia/nemotron-super-49b",
40528
- "nemotron-49b": "nvidia/nemotron-super-49b",
40529
- "nemotron-120b": "nvidia/nemotron-3-super-120b",
40530
- devstral: "nvidia/devstral-2-123b",
40531
- "devstral-2": "nvidia/devstral-2-123b",
40532
- "qwen-coder": "nvidia/qwen3-coder-480b",
40533
- "qwen-coder-free": "nvidia/qwen3-coder-480b",
40534
- maverick: "nvidia/llama-4-maverick",
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",
40535
40546
  // MiniMax
40536
40547
  minimax: "minimax/minimax-m2.7",
40537
40548
  "minimax-m2.7": "minimax/minimax-m2.7",
@@ -40540,8 +40551,6 @@ var MODEL_ALIASES = {
40540
40551
  glm: "zai/glm-5",
40541
40552
  "glm-5": "zai/glm-5",
40542
40553
  "glm-5-turbo": "zai/glm-5-turbo",
40543
- // Free alias — points to strongest free model
40544
- free: "nvidia/nemotron-ultra-253b",
40545
40554
  // Routing profile aliases (common variations)
40546
40555
  "auto-router": "auto",
40547
40556
  router: "auto"
@@ -40578,6 +40587,15 @@ var BLOCKRUN_MODELS = [
40578
40587
  contextWindow: 105e4,
40579
40588
  maxOutput: 128e3
40580
40589
  },
40590
+ {
40591
+ id: "free",
40592
+ name: "Free \u2192 Nemotron Ultra 253B",
40593
+ inputPrice: 0,
40594
+ outputPrice: 0,
40595
+ contextWindow: 131072,
40596
+ maxOutput: 16384,
40597
+ reasoning: true
40598
+ },
40581
40599
  {
40582
40600
  id: "eco",
40583
40601
  name: "Eco (Smart Router - Cost Optimized)",
@@ -41081,11 +41099,12 @@ var BLOCKRUN_MODELS = [
41081
41099
  agentic: true,
41082
41100
  toolCalling: true
41083
41101
  },
41084
- // NVIDIA - Free models (hosted by NVIDIA, billingMode: "free" on server)
41085
- // toolCalling intentionally omitted on all free models: structured function
41086
- // calling support unverified. Excluded from tool-heavy routing paths.
41102
+ // Free models (hosted by NVIDIA, billingMode: "free" on server)
41103
+ // IDs use "free/" prefix so users see them as free in the /model picker.
41104
+ // ClawRouter maps free/xxx nvidia/xxx before sending to BlockRun upstream.
41105
+ // toolCalling intentionally omitted: structured function calling unverified.
41087
41106
  {
41088
- id: "nvidia/gpt-oss-120b",
41107
+ id: "free/gpt-oss-120b",
41089
41108
  name: "[Free] GPT-OSS 120B",
41090
41109
  version: "120b",
41091
41110
  inputPrice: 0,
@@ -41094,7 +41113,7 @@ var BLOCKRUN_MODELS = [
41094
41113
  maxOutput: 16384
41095
41114
  },
41096
41115
  {
41097
- id: "nvidia/gpt-oss-20b",
41116
+ id: "free/gpt-oss-20b",
41098
41117
  name: "[Free] GPT-OSS 20B",
41099
41118
  version: "20b",
41100
41119
  inputPrice: 0,
@@ -41103,7 +41122,7 @@ var BLOCKRUN_MODELS = [
41103
41122
  maxOutput: 16384
41104
41123
  },
41105
41124
  {
41106
- id: "nvidia/nemotron-ultra-253b",
41125
+ id: "free/nemotron-ultra-253b",
41107
41126
  name: "[Free] Nemotron Ultra 253B",
41108
41127
  version: "253b",
41109
41128
  inputPrice: 0,
@@ -41113,7 +41132,7 @@ var BLOCKRUN_MODELS = [
41113
41132
  reasoning: true
41114
41133
  },
41115
41134
  {
41116
- id: "nvidia/nemotron-3-super-120b",
41135
+ id: "free/nemotron-3-super-120b",
41117
41136
  name: "[Free] Nemotron 3 Super 120B",
41118
41137
  version: "3-super-120b",
41119
41138
  inputPrice: 0,
@@ -41123,7 +41142,7 @@ var BLOCKRUN_MODELS = [
41123
41142
  reasoning: true
41124
41143
  },
41125
41144
  {
41126
- id: "nvidia/nemotron-super-49b",
41145
+ id: "free/nemotron-super-49b",
41127
41146
  name: "[Free] Nemotron Super 49B",
41128
41147
  version: "super-49b",
41129
41148
  inputPrice: 0,
@@ -41133,7 +41152,7 @@ var BLOCKRUN_MODELS = [
41133
41152
  reasoning: true
41134
41153
  },
41135
41154
  {
41136
- id: "nvidia/deepseek-v3.2",
41155
+ id: "free/deepseek-v3.2",
41137
41156
  name: "[Free] DeepSeek V3.2",
41138
41157
  version: "v3.2",
41139
41158
  inputPrice: 0,
@@ -41143,7 +41162,7 @@ var BLOCKRUN_MODELS = [
41143
41162
  reasoning: true
41144
41163
  },
41145
41164
  {
41146
- id: "nvidia/mistral-large-3-675b",
41165
+ id: "free/mistral-large-3-675b",
41147
41166
  name: "[Free] Mistral Large 675B",
41148
41167
  version: "3-675b",
41149
41168
  inputPrice: 0,
@@ -41153,7 +41172,7 @@ var BLOCKRUN_MODELS = [
41153
41172
  reasoning: true
41154
41173
  },
41155
41174
  {
41156
- id: "nvidia/qwen3-coder-480b",
41175
+ id: "free/qwen3-coder-480b",
41157
41176
  name: "[Free] Qwen3 Coder 480B",
41158
41177
  version: "480b",
41159
41178
  inputPrice: 0,
@@ -41162,7 +41181,7 @@ var BLOCKRUN_MODELS = [
41162
41181
  maxOutput: 16384
41163
41182
  },
41164
41183
  {
41165
- id: "nvidia/devstral-2-123b",
41184
+ id: "free/devstral-2-123b",
41166
41185
  name: "[Free] Devstral 2 123B",
41167
41186
  version: "2-123b",
41168
41187
  inputPrice: 0,
@@ -41171,7 +41190,7 @@ var BLOCKRUN_MODELS = [
41171
41190
  maxOutput: 16384
41172
41191
  },
41173
41192
  {
41174
- id: "nvidia/glm-4.7",
41193
+ id: "free/glm-4.7",
41175
41194
  name: "[Free] GLM-4.7",
41176
41195
  version: "4.7",
41177
41196
  inputPrice: 0,
@@ -41181,7 +41200,7 @@ var BLOCKRUN_MODELS = [
41181
41200
  reasoning: true
41182
41201
  },
41183
41202
  {
41184
- id: "nvidia/llama-4-maverick",
41203
+ id: "free/llama-4-maverick",
41185
41204
  name: "[Free] Llama 4 Maverick",
41186
41205
  version: "4-maverick",
41187
41206
  inputPrice: 0,
@@ -46764,20 +46783,26 @@ var ROUTING_PROFILES = /* @__PURE__ */ new Set([
46764
46783
  "blockrun/premium",
46765
46784
  "premium"
46766
46785
  ]);
46767
- var FREE_MODEL = "nvidia/gpt-oss-120b";
46786
+ var FREE_MODEL = "free/gpt-oss-120b";
46768
46787
  var FREE_MODELS = /* @__PURE__ */ new Set([
46769
- "nvidia/gpt-oss-120b",
46770
- "nvidia/gpt-oss-20b",
46771
- "nvidia/nemotron-ultra-253b",
46772
- "nvidia/nemotron-3-super-120b",
46773
- "nvidia/nemotron-super-49b",
46774
- "nvidia/deepseek-v3.2",
46775
- "nvidia/mistral-large-3-675b",
46776
- "nvidia/qwen3-coder-480b",
46777
- "nvidia/devstral-2-123b",
46778
- "nvidia/glm-4.7",
46779
- "nvidia/llama-4-maverick"
46788
+ "free/gpt-oss-120b",
46789
+ "free/gpt-oss-20b",
46790
+ "free/nemotron-ultra-253b",
46791
+ "free/nemotron-3-super-120b",
46792
+ "free/nemotron-super-49b",
46793
+ "free/deepseek-v3.2",
46794
+ "free/mistral-large-3-675b",
46795
+ "free/qwen3-coder-480b",
46796
+ "free/devstral-2-123b",
46797
+ "free/glm-4.7",
46798
+ "free/llama-4-maverick"
46780
46799
  ]);
46800
+ function toUpstreamModelId(modelId) {
46801
+ if (modelId.startsWith("free/")) {
46802
+ return "nvidia/" + modelId.slice("free/".length);
46803
+ }
46804
+ return modelId;
46805
+ }
46781
46806
  var MAX_MESSAGES = 200;
46782
46807
  var CONTEXT_LIMIT_KB = 5120;
46783
46808
  var HEARTBEAT_INTERVAL_MS = 2e3;
@@ -48139,7 +48164,7 @@ async function tryModelRequest(upstreamUrl, method, headers, body, modelId, maxT
48139
48164
  let requestBody = body;
48140
48165
  try {
48141
48166
  const parsed = JSON.parse(body.toString());
48142
- parsed.model = modelId;
48167
+ parsed.model = toUpstreamModelId(modelId);
48143
48168
  if (Array.isArray(parsed.messages)) {
48144
48169
  parsed.messages = normalizeMessageRoles(parsed.messages);
48145
48170
  }
@@ -48909,6 +48934,9 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
48909
48934
  effectiveSessionId = deriveSessionId(parsedMessages);
48910
48935
  }
48911
48936
  if (bodyModified) {
48937
+ if (parsed.model && typeof parsed.model === "string") {
48938
+ parsed.model = toUpstreamModelId(parsed.model);
48939
+ }
48912
48940
  body = Buffer.from(JSON.stringify(parsed));
48913
48941
  }
48914
48942
  } catch (err) {
@@ -49013,7 +49041,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
49013
49041
  modelId = FREE_MODEL;
49014
49042
  isFreeModel = true;
49015
49043
  const parsed = JSON.parse(body.toString());
49016
- parsed.model = FREE_MODEL;
49044
+ parsed.model = toUpstreamModelId(FREE_MODEL);
49017
49045
  body = Buffer.from(JSON.stringify(parsed));
49018
49046
  balanceFallbackNotice = sufficiency.info.isEmpty ? `> **\u26A0\uFE0F Wallet empty** \u2014 using free model. Fund your wallet to use ${originalModel}.
49019
49047