@blockrun/franklin 3.39.0 → 3.40.0
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/agent/context.js +15 -6
- package/dist/agent/tokens.js +17 -1
- package/dist/brain/extract.js +6 -1
- package/dist/pricing.js +1 -0
- package/dist/router/index.js +36 -15
- package/dist/router/vision.js +21 -1
- package/dist/tools/videogen.js +2 -1
- package/dist/ui/model-picker.js +115 -19
- package/package.json +1 -1
package/dist/agent/context.js
CHANGED
|
@@ -242,7 +242,7 @@ You run on the BlockRun AI Gateway. When the user asks you to "test the BlockRun
|
|
|
242
242
|
- \`GET /.well-known/x402\` — x402 resource list with prices
|
|
243
243
|
|
|
244
244
|
**LLM (POST, x402-paid)**
|
|
245
|
-
- \`POST /v1/chat/completions\` — OpenAI-compatible. Body: \`{ model, messages, stream?, tools?, max_tokens?, temperature? }\`. \`model\` MUST come from \`GET /v1/models\` (real frontier examples on the gateway, verified live 2026-08-
|
|
245
|
+
- \`POST /v1/chat/completions\` — OpenAI-compatible. Body: \`{ model, messages, stream?, tools?, max_tokens?, temperature? }\`. \`model\` MUST come from \`GET /v1/models\` (real frontier examples on the gateway, verified live 2026-08-19: \`anthropic/claude-sonnet-5\`, \`anthropic/claude-opus-5\`, \`openai/gpt-5.6-sol\`, \`deepseek/deepseek-v4-pro\`, \`zai/glm-5.3\`, \`xai/grok-4.5\`, \`qwen/qwen3.7-flash\`, \`nvidia/nemotron-nano-9b-v2\` (free)). Do NOT invent versions like \`openai/gpt-5.1\` or \`xai/grok-5\` — those don't exist; the gateway 400s with the valid list in the error body, so when in doubt fetch \`GET /v1/models\` first.
|
|
246
246
|
- \`POST /v1/messages\` — Anthropic-compatible. Body: \`{ model, messages, max_tokens, system?, tools? }\`.
|
|
247
247
|
|
|
248
248
|
**Media (POST, x402-paid; GET to poll async jobs)**
|
|
@@ -524,8 +524,14 @@ export function assembleInstructions(workingDir, model) {
|
|
|
524
524
|
*/
|
|
525
525
|
export function getModelGuidance(model) {
|
|
526
526
|
const m = model.toLowerCase();
|
|
527
|
-
// Weak/cheap models: strict discipline to prevent looping and hallucination
|
|
528
|
-
|
|
527
|
+
// Weak/cheap models: strict discipline to prevent looping and hallucination.
|
|
528
|
+
// The bare `glm` match dates from the GLM-4.x era. The paid Z.AI GLM-5 line
|
|
529
|
+
// is a different animal — 1M context, always-on reasoning, priced above
|
|
530
|
+
// Gemini 3.1 Pro on input — and `glm` now resolves to 5.3, so matching it
|
|
531
|
+
// here was telling a flagship to make ONE tool call and stay under 300
|
|
532
|
+
// words. GLM-5.x moves to the balanced branch; glm-4.7 and friends stay.
|
|
533
|
+
if ((m.includes('glm') && !m.includes('glm-5')) ||
|
|
534
|
+
m.includes('gpt-oss') || m.includes('nemotron') ||
|
|
529
535
|
m.includes('minimax') || m.includes('devstral') || m.includes('llama-4')) {
|
|
530
536
|
return `# Execution Discipline (strict — this model requires guardrails)
|
|
531
537
|
- Make ONE tool call per task. Do NOT retry the same tool with query variations.
|
|
@@ -535,10 +541,13 @@ export function getModelGuidance(model) {
|
|
|
535
541
|
- Before responding: does every URL and fact come from a tool result? If not, remove it.`;
|
|
536
542
|
}
|
|
537
543
|
// Medium models: balanced guidance. The bare `qwen` match dates from when
|
|
538
|
-
// every qwen id on the gateway was a free NVIDIA SKU
|
|
539
|
-
// 1M-context
|
|
544
|
+
// every qwen id on the gateway was a free NVIDIA SKU. The paid Qwen line is
|
|
545
|
+
// now Max + Plus + Flash — all 1M-context with reasoning — so only the Max
|
|
546
|
+
// flagship graduates to the strong branch; Plus and Flash stay here, and the
|
|
547
|
+
// legacy free `nvidia/qwen*` ids keep matching as before.
|
|
540
548
|
if (m.includes('kimi') || m.includes('grok') || m.includes('flash') ||
|
|
541
549
|
m.includes('haiku') || m.includes('deepseek') ||
|
|
550
|
+
m.includes('hy3') || m.includes('mimo') || m.includes('glm-5') ||
|
|
542
551
|
(m.includes('qwen') && !m.includes('qwen3.7-max'))) {
|
|
543
552
|
return `# Execution Guidance
|
|
544
553
|
- Use tools to verify facts before stating them. Do not answer from memory when a tool can confirm.
|
|
@@ -550,7 +559,7 @@ export function getModelGuidance(model) {
|
|
|
550
559
|
if (m.includes('claude') || m.includes('gpt-5') || m.includes('opus') ||
|
|
551
560
|
m.includes('sonnet') || m.includes('gemini-2.5-pro') || m.includes('gemini-3') ||
|
|
552
561
|
m.includes('o3') || m.includes('o1') || m.includes('codex') ||
|
|
553
|
-
m.includes('qwen3.7-max')) {
|
|
562
|
+
m.includes('chat-latest') || m.includes('qwen3.7-max')) {
|
|
554
563
|
return `# Quality Standards (strong model)
|
|
555
564
|
- Keep calling tools until the task is complete AND the result is verified. Don't stop at "this should work" — prove it works.
|
|
556
565
|
- Before finalizing: check correctness, grounding in tool output, and formatting.
|
package/dist/agent/tokens.js
CHANGED
|
@@ -229,8 +229,15 @@ const MODEL_CONTEXT_WINDOWS = {
|
|
|
229
229
|
'openai/gpt-5.2': 128_000,
|
|
230
230
|
'openai/gpt-5-mini': 128_000,
|
|
231
231
|
'openai/gpt-5-nano': 128_000,
|
|
232
|
+
'openai/gpt-5.2-pro': 400_000,
|
|
232
233
|
'openai/gpt-4.1': 1_000_000,
|
|
234
|
+
'openai/gpt-4.1-mini': 128_000,
|
|
235
|
+
'openai/gpt-4.1-nano': 128_000,
|
|
236
|
+
'openai/gpt-4o': 128_000,
|
|
237
|
+
'openai/gpt-4o-mini': 128_000,
|
|
238
|
+
'openai/o1': 200_000,
|
|
233
239
|
'openai/o3': 200_000,
|
|
240
|
+
'openai/o3-mini': 128_000,
|
|
234
241
|
'openai/o4-mini': 200_000,
|
|
235
242
|
// Google
|
|
236
243
|
'google/gemini-2.5-pro': 1_000_000,
|
|
@@ -239,18 +246,27 @@ const MODEL_CONTEXT_WINDOWS = {
|
|
|
239
246
|
'google/gemini-3.1-pro': 1_000_000,
|
|
240
247
|
'google/gemini-3.5-flash': 1_000_000,
|
|
241
248
|
'google/gemini-3.1-flash-lite': 1_000_000,
|
|
249
|
+
'google/gemini-3-flash-preview': 1_048_576,
|
|
242
250
|
// DeepSeek (V4 family — gateway aliased deepseek-chat / -reasoner to V4
|
|
243
251
|
// Flash on 2026-05-03; context bumped 128K → 1M for both, 65K out)
|
|
244
252
|
'deepseek/deepseek-chat': 1_000_000,
|
|
245
253
|
'deepseek/deepseek-reasoner': 1_000_000,
|
|
246
254
|
'deepseek/deepseek-v4-pro': 1_000_000,
|
|
247
|
-
// xAI
|
|
255
|
+
// xAI. grok-4.5 / 4.3 / build were missing until 2026-08-20: neither matches
|
|
256
|
+
// any inference pattern below, so a cold catalog cache fell through to the
|
|
257
|
+
// blind 128k default and compacted a 500K–1M window ~4-8x too early.
|
|
258
|
+
'xai/grok-4.5': 500_000,
|
|
259
|
+
'xai/grok-4.3': 1_000_000,
|
|
260
|
+
'xai/grok-build-0.1': 256_000,
|
|
248
261
|
'xai/grok-3': 131_072,
|
|
249
262
|
'xai/grok-4-0709': 131_072,
|
|
250
263
|
'xai/grok-4-1-fast-reasoning': 131_072,
|
|
251
264
|
// Others
|
|
265
|
+
'zai/glm-5.3': 1_000_000, // flagship 2026-08 — 1M context, always-on reasoning
|
|
252
266
|
'zai/glm-5.2': 1_000_000, // flagship bump 2026-06 — context jumped 200K → 1M
|
|
253
267
|
'zai/glm-5.1': 200_000,
|
|
268
|
+
'zai/glm-5': 200_000,
|
|
269
|
+
'zai/glm-5-turbo': 200_000,
|
|
254
270
|
'moonshot/kimi-k3': 1_048_576,
|
|
255
271
|
'moonshot/kimi-k2.7': 256_000,
|
|
256
272
|
'moonshot/kimi-k2.6': 256_000,
|
package/dist/brain/extract.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
* Uses cheap model to detect people, projects, companies from conversation.
|
|
4
4
|
*/
|
|
5
5
|
import { loadEntities, saveEntities, upsertEntity, addObservation, upsertRelation, isJunkEntityName, } from './store.js';
|
|
6
|
+
// Last entry is the free safety net. nvidia/nemotron-super-49b held it until
|
|
7
|
+
// 2026-08-20, by which point it had left the catalog entirely — the free pool
|
|
8
|
+
// answers for it with a substitute, so the "free fallback" was neither the
|
|
9
|
+
// model named nor reliably shaped. nemotron-nano-9b-v2 is the current free
|
|
10
|
+
// default and verifiably serves itself.
|
|
6
11
|
const EXTRACTION_MODELS = [
|
|
7
12
|
'google/gemini-2.5-flash-lite',
|
|
8
13
|
'google/gemini-2.5-flash',
|
|
9
|
-
'nvidia/nemotron-
|
|
14
|
+
'nvidia/nemotron-nano-9b-v2',
|
|
10
15
|
];
|
|
11
16
|
const VALID_TYPES = new Set(['person', 'project', 'company', 'product', 'concept']);
|
|
12
17
|
const BRAIN_PROMPT = `You are analyzing a conversation between a user and an AI agent. Extract entities (people, projects, companies, products, concepts) mentioned in the conversation.
|
package/dist/pricing.js
CHANGED
|
@@ -144,6 +144,7 @@ export const MODEL_PRICING = {
|
|
|
144
144
|
'zai/glm-5': { input: 1.0, output: 3.2 }, // flat promo ended 2026-06-06; raised upstream 2026-08-07
|
|
145
145
|
'zai/glm-5.1': { input: 1.40, output: 4.40 }, // launch promo ended 2026-06-05 — per-token now
|
|
146
146
|
'zai/glm-5.2': { input: 1.40, output: 4.40 }, // new flagship 2026-06 — 1M context, same per-token price as 5.1
|
|
147
|
+
'zai/glm-5.3': { input: 1.40, output: 4.40 }, // flagship 2026-08 — 1M context, always-on reasoning, priced at 5.2
|
|
147
148
|
'zai/glm-5-turbo': { input: 1.2, output: 4.0 }, // flat promo ended 2026-06-06 — per-token now
|
|
148
149
|
'zai/glm-5.1-turbo': { input: 1.2, output: 4.0 }, // client alias for zai/glm-5-turbo
|
|
149
150
|
};
|
package/dist/router/index.js
CHANGED
|
@@ -332,10 +332,23 @@ function classicRouteRequest(prompt, profile, needsVision = false) {
|
|
|
332
332
|
// - Exposed via async `routeRequestAsync(prompt, profile, classify?)`. Callers
|
|
333
333
|
// that can't be async (proxy, LLM-client bootstrap) keep using the sync
|
|
334
334
|
// `routeRequest`, which silently does keyword-only routing.
|
|
335
|
-
//
|
|
336
|
-
//
|
|
337
|
-
//
|
|
338
|
-
|
|
335
|
+
// The classifier needs a free model that answers with ONE BARE WORD under a
|
|
336
|
+
// tight max_tokens. That is a narrower requirement than "is a good free chat
|
|
337
|
+
// model", and most of the free pool fails it by streaming chain-of-thought
|
|
338
|
+
// into `content` (glm-4.7 and the qwen-thinking builds emit reasoning and
|
|
339
|
+
// leave text empty; nemotron-nano-9b-v2 opens with "Okay, let's see. The user
|
|
340
|
+
// wants to…" and never reaches a verdict inside the budget).
|
|
341
|
+
//
|
|
342
|
+
// 2026-08-19: the previous default, nvidia/qwen3-next-80b-a3b-instruct, was
|
|
343
|
+
// EOL'd by NVIDIA (410 on 2026-07-27) — the gateway now rides its calls on
|
|
344
|
+
// nemotron-3-super-120b, which leaks prose. Every classification has been
|
|
345
|
+
// failing the strict parse and falling through to keyword-only routing ever
|
|
346
|
+
// since, silently, because the fallback is by design invisible.
|
|
347
|
+
//
|
|
348
|
+
// nemotron-3-nano-omni is the replacement: live-probed on this exact prompt
|
|
349
|
+
// shape it returns "MEDIUM" and nothing else, and it verifiably serves itself
|
|
350
|
+
// rather than riding a pooled substitute.
|
|
351
|
+
const CLASSIFIER_MODEL = process.env.FRANKLIN_ROUTER_MODEL || 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning';
|
|
339
352
|
const CLASSIFIER_TIMEOUT_MS = 2_500;
|
|
340
353
|
const CLASSIFIER_SYSTEM = `You classify a user's message into ONE routing tier for a CLI agent. Reply with EXACTLY ONE WORD from the allowed set. No explanation, no punctuation, no quotes.
|
|
341
354
|
|
|
@@ -649,21 +662,29 @@ export function getFallbackChain(tier, profile = 'auto') {
|
|
|
649
662
|
// verifiably serves ITSELF on the streaming path Franklin uses (verified live
|
|
650
663
|
// through the binary today). mistral-nemotron is DEGRADED at NVIDIA — stream
|
|
651
664
|
// calls 400 ("DEGRADED function cannot be invoked") and non-stream calls ride
|
|
652
|
-
// the gateway's disclosed fallback
|
|
653
|
-
//
|
|
654
|
-
//
|
|
655
|
-
//
|
|
656
|
-
//
|
|
665
|
+
// the gateway's disclosed fallback.
|
|
666
|
+
// 2026-08-19: nvidia/nemotron-3-nano-omni-30b-a3b-reasoning promoted to
|
|
667
|
+
// second. When it was last probed it came back served as gpt-oss-120b — the
|
|
668
|
+
// pooled-substitute trap this comment warns about — but NVIDIA has since
|
|
669
|
+
// fixed it: it now answers as ITSELF on both the streaming and non-streaming
|
|
670
|
+
// paths, and it returns clean single-word output under tight max_tokens (it
|
|
671
|
+
// is also the router's classifier for that reason). mistral-nemotron drops to
|
|
672
|
+
// third: still DEGRADED at NVIDIA, kept as a genuinely different family for
|
|
673
|
+
// the case where both Nemotron nano builds are down. The catalog's fifth free
|
|
674
|
+
// id, step-3.7-flash, stays out of every chain — it leaks thinking prose into
|
|
675
|
+
// content AND comes back served by nemotron-3-super-120b.
|
|
676
|
+
const OMNI = 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning';
|
|
657
677
|
const FREE_MODELS_BY_CATEGORY = {
|
|
658
|
-
coding: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
659
|
-
trading: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
660
|
-
research: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
661
|
-
reasoning: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
662
|
-
chat: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
663
|
-
creative: ['nvidia/nemotron-nano-9b-v2', 'nvidia/mistral-nemotron'],
|
|
678
|
+
coding: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
679
|
+
trading: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
680
|
+
research: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
681
|
+
reasoning: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
682
|
+
chat: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
683
|
+
creative: ['nvidia/nemotron-nano-9b-v2', OMNI, 'nvidia/mistral-nemotron'],
|
|
664
684
|
};
|
|
665
685
|
const DEFAULT_FREE_CHAIN = [
|
|
666
686
|
'nvidia/nemotron-nano-9b-v2',
|
|
687
|
+
OMNI,
|
|
667
688
|
'nvidia/mistral-nemotron',
|
|
668
689
|
];
|
|
669
690
|
/**
|
package/dist/router/vision.js
CHANGED
|
@@ -35,21 +35,37 @@ const VISION_MODELS = new Set([
|
|
|
35
35
|
'openai/gpt-5.6-sol',
|
|
36
36
|
'openai/gpt-5.6-terra',
|
|
37
37
|
'openai/gpt-5.6-luna',
|
|
38
|
+
// The pro reasoning tier is the same multimodal base with thinking on.
|
|
39
|
+
'openai/gpt-5.6-sol-pro',
|
|
40
|
+
'openai/gpt-5.6-terra-pro',
|
|
41
|
+
'openai/gpt-5.6-luna-pro',
|
|
38
42
|
'openai/gpt-5.5',
|
|
43
|
+
'openai/gpt-5.5-pro',
|
|
44
|
+
// The rolling ChatGPT default — vision-tagged in the catalog.
|
|
45
|
+
'openai/chat-latest',
|
|
39
46
|
'openai/gpt-5.4',
|
|
40
47
|
'openai/gpt-5.4-pro',
|
|
41
48
|
'openai/gpt-5.4-mini',
|
|
42
49
|
'openai/gpt-5.2',
|
|
43
50
|
'openai/gpt-5.2-pro',
|
|
44
51
|
'openai/gpt-5-mini',
|
|
52
|
+
'openai/gpt-5.3',
|
|
45
53
|
'openai/gpt-4.1',
|
|
54
|
+
'openai/gpt-4o',
|
|
46
55
|
'openai/o3',
|
|
47
56
|
// Google — vision baked into every Gemini SKU we surface (flash-lite excepted)
|
|
48
57
|
'google/gemini-3.1-pro',
|
|
58
|
+
'google/gemini-3.6-flash',
|
|
49
59
|
'google/gemini-3.5-flash',
|
|
60
|
+
'google/gemini-3-flash-preview',
|
|
50
61
|
'google/gemini-2.5-pro',
|
|
51
62
|
'google/gemini-2.5-flash',
|
|
52
|
-
// xAI —
|
|
63
|
+
// xAI — grok-4-1-fast-reasoning stays out (text-only). Grok 4.5 and 4.3 are
|
|
64
|
+
// both vision-capable in the catalog and were missing here until 2026-08-20:
|
|
65
|
+
// `grok` resolves to 4.5, so every image turn on the xAI flagship was being
|
|
66
|
+
// rerouted to a "vision sibling" the user never asked for.
|
|
67
|
+
'xai/grok-4.5',
|
|
68
|
+
'xai/grok-4.3',
|
|
53
69
|
'xai/grok-4-0709',
|
|
54
70
|
'xai/grok-3',
|
|
55
71
|
// Moonshot — K3 is the Solana flagship; the K2.x compatibility line remains
|
|
@@ -63,6 +79,10 @@ const VISION_MODELS = new Set([
|
|
|
63
79
|
// listing it here contradicted routeRequest()'s own "maverick is text-only"
|
|
64
80
|
// note — the free profile would route a vision turn to a text-only model.
|
|
65
81
|
'nvidia/nemotron-nano-12b-v2-vl',
|
|
82
|
+
// Nemotron 3 Nano Omni accepts text, images, video and audio, and now serves
|
|
83
|
+
// itself (2026-08-19 probe) — it is the strongest free vision option in the
|
|
84
|
+
// catalog on ChartQA / DocVQA / MMMU.
|
|
85
|
+
'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
|
|
66
86
|
]);
|
|
67
87
|
/** Does this concrete gateway model accept image input? */
|
|
68
88
|
export function isVisionModel(modelId) {
|
package/dist/tools/videogen.js
CHANGED
|
@@ -505,10 +505,11 @@ export function createVideoGenCapability(deps = {}) {
|
|
|
505
505
|
model: {
|
|
506
506
|
type: 'string',
|
|
507
507
|
description: 'Video model. Default: xai/grok-imagine-video ($0.05/s). Known-valid models on the BlockRun gateway as of 2026-08: ' +
|
|
508
|
-
'xai/grok-imagine-video, bytedance/seedance-1.5-pro ($0.070/s), bytedance/seedance-2.0-mini ($0.0797/s), ' +
|
|
508
|
+
'xai/grok-imagine-video, xai/grok-imagine-video-1.5 ($0.08/s), bytedance/seedance-1.5-pro ($0.070/s), bytedance/seedance-2.0-mini ($0.0797/s), ' +
|
|
509
509
|
'bytedance/seedance-2.0-fast ($0.165/s), bytedance/seedance-2.0 ($0.227/s), bytedance/seedance-2.5 ($0.315/s), azure/sora-2 ($0.10/s). ' +
|
|
510
510
|
'Pick from this list; the gateway rejects unknown names with HTTP 400 (no money charged on rejection). ' +
|
|
511
511
|
'Speak "Seedance" → bytedance/seedance-2.5 (newest flagship); "Seedance Pro" → bytedance/seedance-2.0; ' +
|
|
512
|
+
'"Grok video" → xai/grok-imagine-video-1.5 (newer Grok clip model, $0.08/s vs $0.05/s); ' +
|
|
512
513
|
'"Seedance fast" → bytedance/seedance-2.0-fast; "Seedance mini" → bytedance/seedance-2.0-mini (cheapest).',
|
|
513
514
|
},
|
|
514
515
|
image_url: { type: 'string', description: 'Optional seed image (image-to-video). Accepts http(s) URL, data: URI, or local file path — local paths get inlined as base64 data URIs automatically.' },
|
package/dist/ui/model-picker.js
CHANGED
|
@@ -41,7 +41,26 @@ export const MODEL_SHORTCUTS = {
|
|
|
41
41
|
'gpt-5.6-sol': 'openai/gpt-5.6-sol',
|
|
42
42
|
'gpt-5.6-terra': 'openai/gpt-5.6-terra',
|
|
43
43
|
'gpt-5.6-luna': 'openai/gpt-5.6-luna',
|
|
44
|
+
// GPT-5.6 pro reasoning tier (gateway, 2026-08). Same base models with pro
|
|
45
|
+
// reasoning mode on: Sol Pro matches Sol at $5/$30, while Terra Pro ($1/$6)
|
|
46
|
+
// and Luna Pro ($0.1/$0.6) come in UNDER their own base tiers — so the pro
|
|
47
|
+
// ids are the better pick for anything reasoning-shaped. `gpt` stays pinned
|
|
48
|
+
// to Sol: bare aliases track the gateway's flagship, not the cheapest
|
|
49
|
+
// sibling.
|
|
50
|
+
'gpt-5.6-sol-pro': 'openai/gpt-5.6-sol-pro',
|
|
51
|
+
'sol-pro': 'openai/gpt-5.6-sol-pro',
|
|
52
|
+
'gpt-5.6-terra-pro': 'openai/gpt-5.6-terra-pro',
|
|
53
|
+
'terra-pro': 'openai/gpt-5.6-terra-pro',
|
|
54
|
+
'gpt-5.6-luna-pro': 'openai/gpt-5.6-luna-pro',
|
|
55
|
+
'luna-pro': 'openai/gpt-5.6-luna-pro',
|
|
44
56
|
'gpt-5.5': 'openai/gpt-5.5',
|
|
57
|
+
'gpt-5.5-pro': 'openai/gpt-5.5-pro',
|
|
58
|
+
// The rolling `chat-latest` alias — whatever ChatGPT currently serves as its
|
|
59
|
+
// default (GPT-5.5 Instant today), tuned for speed and concision. Priced
|
|
60
|
+
// like GPT-5.5 but capped at 128K context.
|
|
61
|
+
'chat-latest': 'openai/chat-latest',
|
|
62
|
+
chatgpt: 'openai/chat-latest',
|
|
63
|
+
instant: 'openai/chat-latest',
|
|
45
64
|
'gpt-5.4': 'openai/gpt-5.4',
|
|
46
65
|
'gpt-5.4-pro': 'openai/gpt-5.4-pro',
|
|
47
66
|
'gpt-5.4-mini': 'openai/gpt-5.4-mini',
|
|
@@ -50,19 +69,43 @@ export const MODEL_SHORTCUTS = {
|
|
|
50
69
|
'gpt-5.2': 'openai/gpt-5.2',
|
|
51
70
|
'gpt-5.2-pro': 'openai/gpt-5.2-pro',
|
|
52
71
|
'gpt-4.1': 'openai/gpt-4.1',
|
|
72
|
+
'gpt-4.1-mini': 'openai/gpt-4.1-mini',
|
|
73
|
+
'gpt-4.1-nano': 'openai/gpt-4.1-nano',
|
|
74
|
+
'4o': 'openai/gpt-4o',
|
|
75
|
+
'gpt-4o': 'openai/gpt-4o',
|
|
76
|
+
'gpt-4o-mini': 'openai/gpt-4o-mini',
|
|
53
77
|
codex: 'openai/gpt-5.3-codex',
|
|
54
78
|
nano: 'openai/gpt-5-nano',
|
|
55
79
|
mini: 'openai/gpt-5-mini',
|
|
56
80
|
o3: 'openai/o3',
|
|
81
|
+
'o3-mini': 'openai/o3-mini',
|
|
57
82
|
o4: 'openai/o4-mini',
|
|
58
83
|
'o4-mini': 'openai/o4-mini',
|
|
59
84
|
o1: 'openai/o1',
|
|
60
85
|
// Google
|
|
61
|
-
gemini
|
|
86
|
+
// `gemini` follows the flagship Pro build (3.1 since 2026-08), matching the
|
|
87
|
+
// bare-alias-tracks-flagship rule `gpt`, `grok` and `glm` already use. 2.5
|
|
88
|
+
// Pro stays reachable as `gemini-2.5` — it is cheaper on input but a
|
|
89
|
+
// generation behind.
|
|
90
|
+
gemini: 'google/gemini-3.1-pro',
|
|
62
91
|
'gemini-2.5': 'google/gemini-2.5-pro',
|
|
63
|
-
|
|
64
|
-
|
|
92
|
+
'gemini-2.5-pro': 'google/gemini-2.5-pro',
|
|
93
|
+
// `flash` follows the newest Flash generation (3.6 since 2026-08). 3.5 stays
|
|
94
|
+
// reachable by its explicit id — it is dearer on output ($9 vs $7.5) with no
|
|
95
|
+
// capability edge, so nothing should be pinned to it deliberately.
|
|
96
|
+
flash: 'google/gemini-3.6-flash',
|
|
97
|
+
'gemini-flash': 'google/gemini-3.6-flash',
|
|
98
|
+
'gemini-3.6': 'google/gemini-3.6-flash',
|
|
99
|
+
'gemini-3.6-flash': 'google/gemini-3.6-flash',
|
|
65
100
|
'gemini-3.5-flash': 'google/gemini-3.5-flash',
|
|
101
|
+
'gemini-2.5-flash': 'google/gemini-2.5-flash',
|
|
102
|
+
'gemini-3-flash-preview': 'google/gemini-3-flash-preview',
|
|
103
|
+
// Flash Lite — thinking-mode Gemini for high-throughput work. `flash-lite`
|
|
104
|
+
// follows the newest (3.5); 3.1 is cheaper still and stays explicit.
|
|
105
|
+
'flash-lite': 'google/gemini-3.5-flash-lite',
|
|
106
|
+
'gemini-3.5-flash-lite': 'google/gemini-3.5-flash-lite',
|
|
107
|
+
'gemini-3.1-flash-lite': 'google/gemini-3.1-flash-lite',
|
|
108
|
+
'gemini-2.5-flash-lite': 'google/gemini-2.5-flash-lite',
|
|
66
109
|
'gemini-3': 'google/gemini-3.1-pro',
|
|
67
110
|
'gemini-3.1': 'google/gemini-3.1-pro',
|
|
68
111
|
// xAI — grok-4.5 is the public flagship since 2026-07-14; `grok` follows it
|
|
@@ -120,6 +163,17 @@ export const MODEL_SHORTCUTS = {
|
|
|
120
163
|
'nano-9b': 'nvidia/nemotron-nano-9b-v2',
|
|
121
164
|
'nano-vl': 'nvidia/nemotron-nano-12b-v2-vl',
|
|
122
165
|
'free-vision': 'nvidia/nemotron-nano-12b-v2-vl',
|
|
166
|
+
// Nemotron 3 Nano Omni started answering as ITSELF (re-probed 2026-08-19,
|
|
167
|
+
// stream and non-stream) — it was pooled behind gpt-oss-120b when it was
|
|
168
|
+
// last checked, which is why it had no alias until now. 31B/3.2B MoE,
|
|
169
|
+
// text + image + video + audio in, 256K context.
|
|
170
|
+
omni: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
|
|
171
|
+
'free-omni': 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
|
|
172
|
+
'nano-omni': 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning',
|
|
173
|
+
// Deliberately NOT aliased: nvidia/step-3.7-flash. It is in the catalog and
|
|
174
|
+
// billed at $0, but live probes (2026-08-19) come back served by
|
|
175
|
+
// nvidia/nemotron-3-super-120b — pointing users at it would promise a model
|
|
176
|
+
// they don't get. Same rule that retired the maverick and qwen3-next ids.
|
|
123
177
|
// Maverick left the gateway catalog on/before 2026-07-14. The id still
|
|
124
178
|
// answers, but only because the free pool silently substitutes another model
|
|
125
179
|
// for it — so pointing users at it would be promising a model they don't get.
|
|
@@ -147,14 +201,38 @@ export const MODEL_SHORTCUTS = {
|
|
|
147
201
|
'qwen-max': 'qwen/qwen3.7-max',
|
|
148
202
|
'qwen3.7-max': 'qwen/qwen3.7-max',
|
|
149
203
|
'qwen-3.7-max': 'qwen/qwen3.7-max',
|
|
204
|
+
// Plus and Flash round out the paid Qwen line — both 1M context with
|
|
205
|
+
// reasoning. Flash at $0.03/$0.13 is the cheapest paid model on the gateway.
|
|
206
|
+
'qwen-plus': 'qwen/qwen3.7-plus',
|
|
207
|
+
'qwen3.7-plus': 'qwen/qwen3.7-plus',
|
|
208
|
+
'qwen-flash': 'qwen/qwen3.7-flash',
|
|
209
|
+
'qwen3.7-flash': 'qwen/qwen3.7-flash',
|
|
210
|
+
// GLM-5.3 (2026-08) is Z.AI's flagship — same $1.4/$4.4 as 5.2 with 1M
|
|
211
|
+
// context and always-on reasoning — but it ships on the BASE gateway ONLY
|
|
212
|
+
// (sol.blockrun.ai lists 92 of Base's 93 models, and 5.3 is the one it's
|
|
213
|
+
// missing; verified 2026-08-20).
|
|
214
|
+
//
|
|
215
|
+
// So `glm` deliberately does NOT follow the flagship here. A bare alias is
|
|
216
|
+
// what people type from muscle memory, and it has to resolve on BOTH chains
|
|
217
|
+
// — pointing it at a Base-only id would hand every Solana user an HTTP 400
|
|
218
|
+
// on `/model glm`. 5.2 is on both, identically priced, one generation back.
|
|
219
|
+
// Promote this line the day 5.3 lands on Solana.
|
|
150
220
|
glm: 'zai/glm-5.2',
|
|
151
221
|
'glm-5': 'zai/glm-5',
|
|
222
|
+
'glm-5.3': 'zai/glm-5.3',
|
|
152
223
|
'glm-5.2': 'zai/glm-5.2',
|
|
153
224
|
// GLM-5.1 demoted to a back-compat pin 2026-06 (flagship is 5.2) — still
|
|
154
225
|
// routes for anyone who wants the 200K-context build explicitly.
|
|
155
226
|
'glm-5.1': 'zai/glm-5.1',
|
|
156
227
|
'glm-turbo': 'zai/glm-5-turbo',
|
|
157
228
|
'glm5': 'zai/glm-5.2',
|
|
229
|
+
// Tencent + Xiaomi joined the gateway in 2026-08 — cheap reasoning at long
|
|
230
|
+
// context, below the frontier tier.
|
|
231
|
+
hy3: 'tencent/hy3',
|
|
232
|
+
tencent: 'tencent/hy3',
|
|
233
|
+
mimo: 'xiaomi/mimo-v2.5-pro',
|
|
234
|
+
'mimo-v2.5-pro': 'xiaomi/mimo-v2.5-pro',
|
|
235
|
+
xiaomi: 'xiaomi/mimo-v2.5-pro',
|
|
158
236
|
kimi: 'moonshot/kimi-k3',
|
|
159
237
|
k3: 'moonshot/kimi-k3',
|
|
160
238
|
// The K2.x line was retired by the gateway (2026-07, replaced by K3).
|
|
@@ -222,6 +300,8 @@ const PROVIDER_ORDER = [
|
|
|
222
300
|
'minimax',
|
|
223
301
|
'qwen',
|
|
224
302
|
'deepseek',
|
|
303
|
+
'tencent',
|
|
304
|
+
'xiaomi',
|
|
225
305
|
'nvidia',
|
|
226
306
|
];
|
|
227
307
|
const PROVIDER_LABELS = {
|
|
@@ -234,6 +314,8 @@ const PROVIDER_LABELS = {
|
|
|
234
314
|
minimax: 'MiniMax',
|
|
235
315
|
qwen: 'Qwen / Alibaba',
|
|
236
316
|
deepseek: 'DeepSeek',
|
|
317
|
+
tencent: 'Tencent / Hunyuan',
|
|
318
|
+
xiaomi: 'Xiaomi / MiMo',
|
|
237
319
|
nvidia: 'Free / NVIDIA',
|
|
238
320
|
};
|
|
239
321
|
/**
|
|
@@ -276,8 +358,10 @@ export const PICKER_CATEGORIES = [
|
|
|
276
358
|
{ id: 'anthropic/claude-sonnet-5', shortcut: 'sonnet', label: 'Claude Sonnet 5', price: '$3/$15' },
|
|
277
359
|
{ id: 'qwen/qwen3.7-max', shortcut: 'qwen-max', label: 'Qwen3.7 Max', price: '$1.475/$4.425', highlight: true },
|
|
278
360
|
{ id: 'openai/gpt-5.6-sol', shortcut: 'gpt', label: 'GPT-5.6 Sol', price: '$5/$30', highlight: true },
|
|
279
|
-
|
|
280
|
-
|
|
361
|
+
// Gemini 2.5 Pro's row retired here the same way Opus 4.8's did: a
|
|
362
|
+
// superseded sibling listed directly under its successor is choice
|
|
363
|
+
// paralysis, not choice. `gemini-2.5` still resolves to it.
|
|
364
|
+
{ id: 'google/gemini-3.1-pro', shortcut: 'gemini', label: 'Gemini 3.1 Pro', price: '$2/$12' },
|
|
281
365
|
{ id: 'xai/grok-4.5', shortcut: 'grok', label: 'Grok 4.5', price: '$2.5/$9' },
|
|
282
366
|
// Kimi K3 (2026-07): 2.8T open MoE, 1M context, multimodal + reasoning.
|
|
283
367
|
// Replaced the budget K2.7 line — now premium-priced ($3/$15).
|
|
@@ -294,10 +378,14 @@ export const PICKER_CATEGORIES = [
|
|
|
294
378
|
// on hard tasks at <1/10 the price.
|
|
295
379
|
{ id: 'deepseek/deepseek-v4-pro', shortcut: 'deepseek-v4-pro', label: 'DeepSeek V4 Pro', price: '$0.435/$0.87', highlight: true },
|
|
296
380
|
{ id: 'deepseek/deepseek-reasoner', shortcut: 'r1', label: 'DeepSeek V4 Flash R.', price: '$0.2/$0.4' },
|
|
297
|
-
|
|
298
|
-
//
|
|
381
|
+
// Terra Pro took the row grok-4-1-fast-reasoning used to hold: the xAI
|
|
382
|
+
// fast family is hidden from /v1/models, so reconcilePicker dropped that
|
|
383
|
+
// row on every live render anyway (`grok-fast` still resolves). Terra
|
|
384
|
+
// Pro is GPT-5.6 Terra with pro reasoning on, at HALF Terra's price.
|
|
385
|
+
{ id: 'openai/gpt-5.6-terra-pro', shortcut: 'terra-pro', label: 'GPT-5.6 Terra Pro', price: '$1/$6', highlight: true },
|
|
386
|
+
// GLM-5.3: Z.AI's flagship — 1M context, always-on reasoning, strong on
|
|
299
387
|
// long-horizon coding. `glm`/`glm5` shortcuts pin it.
|
|
300
|
-
{ id: 'zai/glm-5.
|
|
388
|
+
{ id: 'zai/glm-5.3', shortcut: 'glm-5.3', label: 'GLM-5.3', price: '$1.4/$4.4' },
|
|
301
389
|
],
|
|
302
390
|
},
|
|
303
391
|
{
|
|
@@ -305,13 +393,16 @@ export const PICKER_CATEGORIES = [
|
|
|
305
393
|
models: [
|
|
306
394
|
{ id: 'anthropic/claude-haiku-4.5', shortcut: 'haiku', label: 'Claude Haiku 4.5', price: '$1/$5' },
|
|
307
395
|
{ id: 'openai/gpt-5-mini', shortcut: 'mini', label: 'GPT-5 Mini', price: '$0.25/$2' },
|
|
308
|
-
|
|
396
|
+
// `flash` now follows Gemini 3.6; this row keeps the cheap 2.5 build and
|
|
397
|
+
// labels itself with the explicit shortcut so the two can't drift apart.
|
|
398
|
+
{ id: 'google/gemini-2.5-flash', shortcut: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', price: '$0.3/$2.5' },
|
|
309
399
|
// Re-aliased to V4 Flash Chat upstream — context 1M, price 30% lower.
|
|
310
|
-
{ id: 'deepseek/deepseek-chat', shortcut: 'deepseek', label: 'DeepSeek V4 Flash Chat', price: '$0.
|
|
311
|
-
//
|
|
312
|
-
//
|
|
313
|
-
//
|
|
314
|
-
|
|
400
|
+
{ id: 'deepseek/deepseek-chat', shortcut: 'deepseek', label: 'DeepSeek V4 Flash Chat', price: '$0.14/$0.28' },
|
|
401
|
+
// Cheapest paid model on the gateway, and it still carries 1M context
|
|
402
|
+
// with reasoning — the budget slot GLM-5 used to hold (its flat-rate
|
|
403
|
+
// promo ended 2026-06-06 and it now lists at $1/$3.2, no longer a budget
|
|
404
|
+
// number; the `glm-5` shortcut stays live).
|
|
405
|
+
{ id: 'qwen/qwen3.7-flash', shortcut: 'qwen-flash', label: 'Qwen3.7 Flash', price: '$0.03/$0.13', highlight: true },
|
|
315
406
|
// Minimax M2.7 hidden to make room for V4 Pro in Reasoning + V4 Flash
|
|
316
407
|
// (free) without exceeding the picker's 24-entry cap. Shortcut `minimax`
|
|
317
408
|
// still resolves to it.
|
|
@@ -326,13 +417,18 @@ export const PICKER_CATEGORIES = [
|
|
|
326
417
|
// back to paid.
|
|
327
418
|
//
|
|
328
419
|
// Caveat worth knowing before editing this list: the NVIDIA free pool
|
|
329
|
-
// silently substitutes or degrades
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
420
|
+
// silently substitutes or degrades, so every row here is re-probed
|
|
421
|
+
// before it ships. Re-probed 2026-08-19: the nano pair and the 30B omni
|
|
422
|
+
// model all answer as THEMSELVES on both the streaming and non-streaming
|
|
423
|
+
// paths (omni was pooled behind gpt-oss-120b in August and has since
|
|
424
|
+
// been fixed upstream — hence its new row). mistral-nemotron still
|
|
425
|
+
// comes back served by `nvidia/nemotron-3-super-120b`; it keeps its row
|
|
426
|
+
// and its `nemotron` alias but must never lead a chain. The catalog's
|
|
427
|
+
// fifth free id, nvidia/step-3.7-flash, is substituted the same way and
|
|
428
|
+
// is deliberately absent from both this list and MODEL_SHORTCUTS.
|
|
334
429
|
{ id: 'nvidia/nemotron-nano-9b-v2', shortcut: 'free', label: 'Nemotron Nano 9B', price: 'FREE', highlight: true },
|
|
335
430
|
{ id: 'nvidia/nemotron-nano-12b-v2-vl', shortcut: 'nano-vl', label: 'Nemotron Nano VL', price: 'FREE' },
|
|
431
|
+
{ id: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning', shortcut: 'omni', label: 'Nemotron 3 Nano Omni', price: 'FREE' },
|
|
336
432
|
{ id: 'nvidia/mistral-nemotron', shortcut: 'nemotron', label: 'Mistral Nemotron', price: 'FREE' },
|
|
337
433
|
],
|
|
338
434
|
},
|
package/package.json
CHANGED