Skip to content

Commit 8590348

Browse files
authored
0.32.0 — Kimi K3, the current high-end lineup, and a free tier that was 4/5 retired (#60)
Rebuilds MODEL_TIERS against the live catalogue. Adds kimi-k3, gpt-5.6-sol/terra, claude-sonnet-5, claude-fable-5, grok-4.5/4.3/build-0.1, qwen3.7-max, deepseek-v4-pro, minimax-m3, glm-5.2/5.1. Default model -> gpt-5.6-terra. Removes 8 retired IDs that were being silently aliased by the gateway, and excludes nvidia/mistral-large-3-675b (listed at $0 but hangs).
1 parent 2985b23 commit 8590348

5 files changed

Lines changed: 83 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to BlockRun MCP will be documented in this file.
44

5+
## 0.32.0
6+
7+
Kimi K3 and the current high-end lineup, plus the tier lists rebuilt against the live catalogue instead of edited by hand. The interesting part is why nobody noticed they had rotted: **a retired model ID does not fail.** The gateway silently aliases it onto something else — `nvidia/llama-4-maverick` answers `200 OK` while being served by `gpt-oss-120b`, and `moonshot/kimi-k2.6` still quotes a price. Only a wholly unknown ID `400`s. So "it works" was never evidence a tier was correct, and 8 dead IDs had accumulated across 6 tiers.
8+
9+
- **`feat(models)``moonshot/kimi-k3` ($3/$15, 1M ctx, vision + reasoning + coding)** added to `balanced`, `reasoning`, and `coding`. It supersedes the whole k2.x line, which is gone from the catalogue — `kimi-k2.6` was still listed in three tiers and was being aliased somewhere unchosen on every hit.
10+
- **`feat(models)` — the current high end, none of which we served.** `gpt-5.6-sol` ($5/$30, 1M) and `gpt-5.6-terra` ($2.5/$15, 1M); `claude-sonnet-5` ($3/$15, 1M) and `claude-fable-5` ($10/$50, 1M); `grok-4.5` ($2.5/$9, native search), `grok-4.3` ($1.5/$4, 1M) and `grok-build-0.1` (coding); `qwen3.7-max`; `deepseek-v4-pro` ($0.435/$0.87, 1M — frontier-class reasoning at budget-tier pricing, now `cheap[0]`); `minimax-m3`; `glm-5.2`/`glm-5.1`.
11+
- **`feat(chat)` — the default model is now `openai/gpt-5.6-terra`.** `balanced[0]` is what every call with no `model` resolves to. Newer line, 1M context, and **half the price** of the outgoing `gpt-5.5` default ($2.5/$15 vs $5/$30).
12+
- **`fix(models)` — the `free` tier was 4/5 retired.** `llama-4-maverick`, `qwen3-coder-480b`, `gpt-oss-120b` and `gpt-oss-20b` are all delisted; the tier only ever "worked" through the aliasing above, i.e. free calls were being served by a model nobody picked. Rebuilt from the `$0` models the catalogue actually lists.
13+
- **`fix(models)` — being listed is not being alive; every entry was live-probed.** `nvidia/mistral-large-3-675b` is in the catalogue at `$0` and **hangs**: no response, no error, connection held open past 90s, reproduced twice. It had landed at `free[0]` on the first pass — the first model every `mode:"free"` call tries — where it would have stalled the routing loop before it could fall through. Excluded and documented.
14+
- **`docs(chat)` — the tool description no longer advertises the old tiers.** It still told the model `mode:"coding"` meant "GLM-5 first" when `coding[0]` had been `claude-opus-4.8` for several releases, and pointed `mode:"reasoning"` at `o1`. Modes, examples and the `model` hints now match what the tiers actually contain.
15+
- **Budget gate re-verified, not assumed.** Adding $180/M and $168/M models raises the question of whether the `$20/M` frontier reserve still covers the worst case. It does — the gateway quotes sublinearly, so `gpt-5.4-pro` at 128k `max_tokens` quotes **$2.42** against a **$2.56** reserve — but headroom is only ~5%, so the constant was left alone rather than guessed at. Cheap-tier candidates probed the same way, all with wide margins.
16+
- All 49 tier IDs validated against live `GET /v1/models`. 169 tests, typecheck, build, `verify:prices` (20/20 exact), and the stdio smoke test (19 tools) green.
17+
518
## 0.31.6
619

720
Round 3. Two of these were live the whole time and invisible to every prior round: a skill that never loaded, and an endpoint that never existed. Both were found by asking the gateway instead of reading our own files.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/mcp",
3-
"version": "0.31.6",
3+
"version": "0.32.0",
44
"mcpName": "io.github.BlockRunAI/blockrun-mcp",
55
"description": "BlockRun MCP Server - Give your AI agent web search, deep research, prediction markets, and crypto data. Paid via x402 micropayments.",
66
"type": "module",

src/tools/chat.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export function estimateChatCost(
2929
// free, and `mode` alone does not make it so.
3030
//
3131
// An explicit `model` WINS over `mode` at call time:
32-
// targetModel = model || MODEL_TIERS[mode ?? "balanced"][0] || "openai/gpt-5.5"
33-
// so { mode: "free", model: "openai/gpt-5.5" } runs gpt-5.5 and settles at
32+
// targetModel = model || MODEL_TIERS[mode ?? "balanced"][0] || "openai/gpt-5.6-terra"
33+
// so { mode: "free", model: "openai/gpt-5.6-sol" } runs gpt-5.6-sol and settles at
3434
// frontier prices. Returning 0 for it — which is what an unconditional
3535
// `mode === "free"` check does — is a TOTAL budget-gate bypass: any agent, even
3636
// one already at its cap, gets unmetered frontier calls by tacking on
@@ -60,7 +60,7 @@ export function estimateChatCost(
6060

6161
// Any tier whose FIRST-CHOICE model is a frontier model, plus any explicit
6262
// single model, can settle at a price we can't know up front — reserve
63-
// conservatively. balanced[0] = openai/gpt-5.5 and coding[0] =
63+
// conservatively. balanced[0] = openai/gpt-5.6-terra and coding[0] =
6464
// anthropic/claude-opus-4.8 (see MODEL_TIERS), the same frontier primaries as
6565
// reasoning/powerful, and a no-mode chat resolves to "balanced" (see the
6666
// routing loop below) — so undefined counts too. Reserving the cheap heuristic
@@ -106,19 +106,20 @@ export function registerChatTool(server: McpServer, budget: BudgetState): void {
106106
description: `Get a second opinion from another AI model, or use a specialized model for a specific task.
107107
108108
Notable modes:
109-
- mode:"glm" → Zhipu GLM-5 / GLM-5-Turbo ($0.001/call, excellent for coding tasks, pays via USDC on BlockRun)
110-
- mode:"coding" → GLM-5 first, then code-specialized models
111-
- mode:"cheap" → GLM-5, NVIDIA free, DeepSeek
112-
- mode:"reasoning" → Claude Opus, o3, o1, deepseek-reasoner
109+
- mode:"powerful" → Claude Opus 4.8, GPT-5.6-sol, Claude Fable 5 (frontier, 1M context)
110+
- mode:"reasoning" → Claude Opus 4.8, GPT-5.6-sol, Kimi K3, Grok 4.3, deepseek-v4-pro
111+
- mode:"coding" → Claude Opus 4.8, GPT-5.3-codex, Kimi K3, Grok Build, GLM-5.2
112+
- mode:"cheap" → deepseek-v4-pro, MiniMax M3, GLM-5, NVIDIA free
113+
- mode:"glm" → Zhipu GLM-5 / 5.2 / 5.1 / 5-Turbo (cheap, strong at coding)
113114
- mode:"free" → NVIDIA models (no cost)
114115
115-
Pick directly: model:"zai/glm-5", model:"openai/o3", model:"nvidia/deepseek-v4-flash" (free).
116+
Pick directly: model:"moonshot/kimi-k3", model:"openai/gpt-5.6-sol", model:"anthropic/claude-opus-4.8", model:"xai/grok-4.5", model:"nvidia/deepseek-v4-flash" (free).
116117
117118
Run blockrun_models to see all available models with pricing.`,
118119
inputSchema: {
119120
message: z.string().describe("Your message to the AI"),
120-
model: z.string().optional().describe("Specific model ID (e.g., 'zai/glm-5', 'openai/o3')"),
121-
mode: z.enum(["fast", "balanced", "powerful", "cheap", "reasoning", "free", "coding", "glm"]).optional().describe("Routing mode: glm = Zhipu GLM-5/GLM-5-Turbo ($0.001/call, great for coding), coding = GLM-5 + code models, cheap = GLM-5 + budget, free = NVIDIA only (ignored if model specified)"),
121+
model: z.string().optional().describe("Specific model ID (e.g., 'moonshot/kimi-k3', 'openai/gpt-5.6-sol', 'zai/glm-5')"),
122+
mode: z.enum(["fast", "balanced", "powerful", "cheap", "reasoning", "free", "coding", "glm"]).optional().describe("Routing mode: powerful/reasoning = frontier models (Opus 4.8, GPT-5.6-sol, Kimi K3), coding = code-specialized, glm = Zhipu GLM (cheap, great for coding), cheap = budget models, free = NVIDIA only (ignored if model specified)"),
122123
system: z.string().optional().describe("Optional system prompt"),
123124
max_tokens: z.number().optional().default(1024).describe("Max tokens in response"),
124125
temperature: z.number().optional().default(1).describe("Creativity 0-2"),
@@ -138,7 +139,7 @@ Run blockrun_models to see all available models with pricing.`,
138139
z.object({ type: z.literal("image_url"), image_url: z.object({ url: z.string().describe("https URL or data:<mime>;base64,<...> URI") }) }),
139140
])),
140141
]).describe("Plain text, or an array of parts for multimodal input (text + image_url). Images are honored on the native anthropic/claude-* path."),
141-
})).optional().describe("Conversation history for multi-turn context. When provided, 'message' is appended as the final user turn. Use with explicit 'model' param (defaults to 'openai/gpt-5.5' if not specified). Note: if you include a role:'system' entry in messages[], do not also pass the system param to avoid duplicate system messages."),
142+
})).optional().describe("Conversation history for multi-turn context. When provided, 'message' is appended as the final user turn. Use with explicit 'model' param (defaults to 'openai/gpt-5.6-terra' if not specified). Note: if you include a role:'system' entry in messages[], do not also pass the system param to avoid duplicate system messages."),
142143
},
143144
},
144145
async ({ message, model, mode, system, max_tokens, temperature, response_format, stop, thinking, agent_id, messages }) => {
@@ -207,7 +208,7 @@ Run blockrun_models to see all available models with pricing.`,
207208

208209
// Multi-turn conversation
209210
if (messages && messages.length > 0) {
210-
const targetModel = model || MODEL_TIERS[(mode ?? "balanced") as RoutingMode]?.[0] || "openai/gpt-5.5";
211+
const targetModel = model || MODEL_TIERS[(mode ?? "balanced") as RoutingMode]?.[0] || "openai/gpt-5.6-terra";
211212
const fullMessages = [
212213
...(system ? [{ role: "system" as const, content: system }] : []),
213214
...messages,

src/utils/constants.ts

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,62 @@ export const BASE_RPC_URLS = [
1414
"https://1rpc.io/base",
1515
];
1616

17-
// Models organized by provider:
18-
// OpenAI (14): openai/gpt-5.5 (balanced default), openai/gpt-5.4, openai/gpt-5.4-pro,
19-
// openai/gpt-5.3, openai/gpt-5.2, openai/gpt-5.4-mini, openai/gpt-5-mini,
20-
// openai/gpt-5.4-nano, openai/gpt-5.2-pro, openai/gpt-5.3-codex, openai/o1,
21-
// openai/o1-mini, openai/o3, openai/o3-mini
22-
// Anthropic (flagships): anthropic/claude-opus-4.8 (most capable, 1M context, 128k output),
23-
// anthropic/claude-opus-4.7 (1M context), anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6,
24-
// anthropic/claude-haiku-4.5 (plus opus-4.5, opus-4, sonnet-4 legacy)
25-
// Google (8): google/gemini-3.1-pro, google/gemini-3-pro-preview, google/gemini-3.5-flash
26-
// (latest flash, thinking, $0.5/$3), google/gemini-3-flash-preview, google/gemini-2.5-pro,
27-
// google/gemini-2.5-flash, google/gemini-3.1-flash-lite, google/gemini-2.5-flash-lite
28-
// DeepSeek (2): deepseek/deepseek-chat, deepseek/deepseek-reasoner
29-
// Moonshot (2): moonshot/kimi-k2.6 (flagship, $0.95/$4, vision + reasoning), moonshot/kimi-k2.5 (legacy)
30-
// NVIDIA FREE — serving healthy as of the 2026-06-07 sweep: nvidia/llama-4-maverick
31-
// (general workhorse), nvidia/qwen3-coder-480b (coding), nvidia/deepseek-v4-flash
32-
// (1M context), nvidia/nemotron-3-nano-omni-30b-a3b-reasoning (vision),
33-
// nvidia/gpt-oss-120b, nvidia/gpt-oss-20b.
34-
// Down/redirected server-side (do NOT route to): nvidia/qwen3-next-80b-a3b-thinking
35-
// (NVIDIA EOL 2026-05-21, 410), nvidia/mistral-small-4-119b (timing out),
36-
// nvidia/deepseek-v3.2 + nvidia/glm-4.7 (NIM hung). Other retired-but-aliased:
37-
// nvidia/kimi-k2.5, nvidia/nemotron-{ultra-253b,3-super-120b,super-49b},
38-
// nvidia/mistral-large-3-675b, nvidia/devstral-2-123b, nvidia/qwen3.5-397b-a17b.
39-
// ZAI (2): zai/glm-5, zai/glm-5-turbo
40-
// MiniMax (2): minimax/minimax-m3 (flagship, 1M context, reasoning + coding), minimax/minimax-m2.7
41-
// xAI (hidden, API-routable): xai/grok-4.20-reasoning, xai/grok-4.20-non-reasoning, xai/grok-4-fast-reasoning
17+
// Model catalogue, refreshed against the live GET /v1/models on 2026-07-20.
18+
// Prices below are $/M input / $/M output as the gateway quotes them.
19+
//
20+
// A NOTE ON STALENESS: the gateway silently ALIASES retired IDs onto a live
21+
// model rather than 404ing (the 2026-07-20 sweep found nvidia/llama-4-maverick
22+
// answering as nvidia/gpt-oss-120b, and moonshot/kimi-k2.6 still quoting a
23+
// price). So a dead entry here does NOT surface as an error — it quietly routes
24+
// somewhere you did not choose. Only a genuinely unknown ID 400s. That is why
25+
// these lists are checked against the catalogue rather than "tested by working".
26+
//
27+
// OpenAI (22): gpt-5.6-sol ($5/$30, 1M, deepest reasoning), gpt-5.6-terra
28+
// ($2.5/$15, 1M — the balanced default), gpt-5.6-luna ($1/$6, 1M, no
29+
// reasoning), gpt-5.5 ($5/$30), gpt-5.4 ($2.5/$15), gpt-5.4-pro ($30/$180,
30+
// the priciest model served), gpt-5.3 / gpt-5.2 / gpt-5.3-codex ($1.75/$14),
31+
// gpt-5.2-pro ($21/$168), gpt-5.4-mini, gpt-5-mini, gpt-5.4-nano, gpt-4.1{,
32+
// -mini,-nano}, gpt-4o{,-mini}, o1 ($15/$60), o3 ($2/$8), o3-mini, o4-mini
33+
// Anthropic (8): claude-opus-4.8 ($5/$25, 1M — most capable), claude-fable-5
34+
// ($10/$50, 1M), claude-opus-4.7 ($5/$25, 1M), claude-sonnet-5 ($3/$15, 1M),
35+
// claude-opus-4.5, claude-sonnet-4.6, claude-sonnet-4.5, claude-haiku-4.5
36+
// Google (7): gemini-3.1-pro ($2/$12), gemini-3.5-flash + gemini-3-flash-preview
37+
// ($0.5/$3), gemini-2.5-pro, gemini-2.5-flash, gemini-3.1-flash-lite,
38+
// gemini-2.5-flash-lite — all 1M context
39+
// DeepSeek (3): deepseek-v4-pro ($0.435/$0.87, 1M, reasoning + coding — the
40+
// cheapest frontier-class option served), deepseek-chat, deepseek-reasoner
41+
// Moonshot (1): kimi-k3 ($3/$15, 1M, vision + reasoning + coding). Supersedes
42+
// the k2.x line, which is gone from the catalogue.
43+
// ZAI (4): glm-5.2 ($1.4/$4.4, 1M), glm-5.1 ($1.4/$4.4), glm-5 ($0.6/$1.92 —
44+
// still the cheapest ZAI), glm-5-turbo ($1.2/$4)
45+
// xAI (3): grok-4.5 ($2.5/$9, 500K, native search), grok-4.3 ($1.5/$4, 1M),
46+
// grok-build-0.1 ($1.5/$3, coding)
47+
// MiniMax (2): minimax-m3 ($0.3/$1.2, 1M), minimax-m2.7 ($0.3/$1.2, 200K)
48+
// Qwen (1): qwen3.7-max ($1.475/$4.425, 1M)
49+
// NVIDIA — genuinely $0. Serving healthy on the 2026-07-20 probe:
50+
// deepseek-v4-flash (1M context), mistral-nemotron, step-3.7-flash,
51+
// seed-oss-36b, nemotron-nano-9b-v2, nemotron-nano-12b-v2-vl (vision),
52+
// nemotron-3-nano-omni-30b-a3b-reasoning (vision).
53+
// Listed but NOT serving — do NOT route to: mistral-large-3-675b (hangs).
4254
export const MODEL_TIERS = {
4355
fast: ["google/gemini-3.5-flash", "google/gemini-2.5-flash", "google/gemini-3.1-flash-lite", "openai/gpt-5-mini", "deepseek/deepseek-chat", "google/gemini-3-flash-preview"],
44-
balanced: ["openai/gpt-5.5", "anthropic/claude-sonnet-4.6", "google/gemini-3.1-pro", "moonshot/kimi-k2.6", "openai/gpt-5.3", "openai/gpt-5.4"],
45-
powerful: ["anthropic/claude-opus-4.8", "openai/gpt-5.4-pro", "anthropic/claude-opus-4.7", "anthropic/claude-opus-4.6", "openai/o3", "openai/gpt-5.4"],
46-
cheap: ["zai/glm-5", "zai/glm-5-turbo", "nvidia/gpt-oss-120b", "nvidia/deepseek-v4-flash", "google/gemini-2.5-flash", "deepseek/deepseek-chat", "openai/gpt-5.4-nano"],
47-
reasoning: ["anthropic/claude-opus-4.8", "openai/o3", "openai/o1", "openai/o3-mini", "deepseek/deepseek-reasoner", "moonshot/kimi-k2.6", "openai/gpt-5.3-codex"],
48-
// 2026-06-07 sweep: dropped qwen3-next (NVIDIA EOL, 410), mistral-small-4-119b
49-
// (timing out), deepseek-v3.2 + glm-4.7 (NIM hung). All redirect server-side
50-
// anyway; these are the free models actually serving themselves.
51-
free: ["nvidia/llama-4-maverick", "nvidia/qwen3-coder-480b", "nvidia/deepseek-v4-flash", "nvidia/gpt-oss-120b", "nvidia/gpt-oss-20b"],
52-
coding: ["anthropic/claude-opus-4.8", "zai/glm-5", "openai/gpt-5.3-codex", "moonshot/kimi-k2.6", "nvidia/qwen3-coder-480b", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4"],
53-
glm: ["zai/glm-5", "zai/glm-5-turbo"],
56+
balanced: ["openai/gpt-5.6-terra", "anthropic/claude-sonnet-5", "moonshot/kimi-k3", "google/gemini-3.1-pro", "xai/grok-4.5", "openai/gpt-5.5"],
57+
powerful: ["anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "anthropic/claude-fable-5", "openai/gpt-5.4-pro", "anthropic/claude-opus-4.7", "openai/gpt-5.2-pro"],
58+
cheap: ["deepseek/deepseek-v4-pro", "minimax/minimax-m3", "zai/glm-5", "nvidia/deepseek-v4-flash", "google/gemini-2.5-flash", "deepseek/deepseek-chat", "openai/gpt-5.4-nano"],
59+
reasoning: ["anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "moonshot/kimi-k3", "xai/grok-4.3", "deepseek/deepseek-v4-pro", "openai/o3", "deepseek/deepseek-reasoner"],
60+
// 2026-07-20 sweep: the previous list was 4/5 retired (llama-4-maverick,
61+
// qwen3-coder-480b, gpt-oss-120b, gpt-oss-20b) and only "worked" via the
62+
// server-side aliasing described above.
63+
//
64+
// Every entry below was live-probed and returned a completion. Being IN the
65+
// catalogue is not sufficient: nvidia/mistral-large-3-675b is listed at $0 but
66+
// hangs — no response, no error, connection open past 90s (the NIM-hung mode
67+
// seen in earlier sweeps) — so it is deliberately excluded. Order matters:
68+
// free[0] is what every mode:"free" call tries first, and a hung primary
69+
// stalls the whole routing loop before it can fall through.
70+
free: ["nvidia/deepseek-v4-flash", "nvidia/mistral-nemotron", "nvidia/step-3.7-flash", "nvidia/seed-oss-36b", "nvidia/nemotron-nano-12b-v2-vl", "nvidia/nemotron-nano-9b-v2"],
71+
coding: ["anthropic/claude-opus-4.8", "openai/gpt-5.3-codex", "moonshot/kimi-k3", "xai/grok-build-0.1", "zai/glm-5.2", "qwen/qwen3.7-max", "anthropic/claude-sonnet-5"],
72+
glm: ["zai/glm-5", "zai/glm-5.2", "zai/glm-5.1", "zai/glm-5-turbo"],
5473
} as const;
5574

5675
export type RoutingMode = keyof typeof MODEL_TIERS;

test/chat.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ test("estimateChatCost keeps genuinely-free paths at $0", () => {
2525
assert.equal(estimateChatCost(1024, undefined, "nvidia/deepseek-v4-flash"), 0);
2626
});
2727

28-
// ── balanced/coding tiers have FRONTIER primaries (gpt-5.5 / claude-opus-4.8),
28+
// ── balanced/coding tiers have FRONTIER primaries (gpt-5.6-terra / claude-opus-4.8),
2929
// so the gate must reserve the frontier worst-case — not the cheap heuristic ──
3030
test("estimateChatCost reserves the frontier worst-case for balanced/coding (their primary is a frontier model)", () => {
3131
const frontier = estimateChatCost(1024, "reasoning", undefined);
3232
assert.equal(estimateChatCost(1024, "balanced", undefined), frontier);
3333
assert.equal(estimateChatCost(1024, "coding", undefined), frontier);
3434
});
3535

36-
test("estimateChatCost reserves the frontier worst-case for a no-mode chat (defaults to the balanced tier → gpt-5.5)", () => {
36+
test("estimateChatCost reserves the frontier worst-case for a no-mode chat (defaults to the balanced tier → gpt-5.6-terra)", () => {
3737
const frontier = estimateChatCost(1024, "reasoning", undefined);
3838
assert.equal(estimateChatCost(1024, undefined, undefined), frontier);
3939
});

0 commit comments

Comments
 (0)