Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ Package managers have shown install size for decades. Almost no MCP server shows

| Profile | Tools | Context |
|---------|-------|---------|
| `full` *(default)* | 19 | 14,533 |
| `full` *(default)* | 19 | 14,535 |
| `trading` | 8 | 5,619 |
| `media` | 7 | 7,124 |
| `research` | 5 | 2,819 |
| `chat` | 3 | 2,167 |
| `research` | 5 | 2,821 |
| `chat` | 3 | 2,169 |

Running `--profile trading` instead of the default costs **61% less context** for the same trading
workflow. If you only ever ask about markets, that is the single cheapest change you can make.
Expand Down
9 changes: 5 additions & 4 deletions docs/mcp-schema-overhead.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ Harness: [`scripts/measure-tool-schema.mjs`](../scripts/measure-tool-schema.mjs)
which fails the build when the README card disagrees with a live measurement.

Written 2026-09-01, verified against `@modelcontextprotocol/sdk` 1.29.0. Numbers re-measured
2026-09-26 for the Seedance video parameter expansion and its review pass.
2026-09-26 for the Seedance video parameter expansion and its review pass, and since kept current
by `test/schema-tokens.test.ts` (last: 2026-12-01, Gemini 2.5 Flash leaving `mode:"cheap"`).

## Our number

| Profile | Tools | Context |
|---------|-------|---------|
| `full` *(default)* | 19 | 14,533 |
| `full` *(default)* | 19 | 14,535 |
| `trading` | 8 | 5,619 |
| `media` | 7 | 7,124 |
| `research` | 5 | 2,819 |
| `chat` | 3 | 2,167 |
| `research` | 5 | 2,821 |
| `chat` | 3 | 2,169 |

Descriptions are ~55% of it, input schemas ~41%. `--profile trading` costs 61% less than the
default for the same workflow.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ Notable modes:
- mode:"powerful" → Claude Opus 5, Claude Opus 4.8, GPT-5.6-sol, Claude Fable 5 (frontier, 1M context)
- mode:"reasoning" → Claude Opus 5, GPT-5.6-sol, Kimi K3.1 Pro, Grok 4.3, deepseek-v4-pro
- mode:"coding" → Claude Opus 5, GPT-5.3-codex, Kimi K3.1 Pro, Grok Build, GLM-5.2
- mode:"cheap" → deepseek-v4-pro, Qwen3.7 Flash, MiniMax M3, Gemini 2.5 Flash, DeepSeek Chat / V4.1 Flash
- mode:"cheap" → deepseek-v4-pro, Qwen3.7 Flash, MiniMax M3, Gemini 3.5 Flash-Lite, DeepSeek Chat / V4.1 Flash
- mode:"glm" → Zhipu GLM-5 / 5.2 / 5.1 / 5-Turbo (strong at coding)
- mode:"free" → free models (no cost)

Expand Down
20 changes: 17 additions & 3 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export const BASE_RPC_URLS = [
// file recorded in July; RETIRED 2026-11-24, redirected to 3.6 Flash),
// gemini-3-flash-preview ($0.5/$3),
// gemini-3.5-flash-lite ($0.3/$2.5, live-probed 2026-08-12),
// gemini-3.1-flash-lite ($0.25/$1.5), gemini-2.5-pro, gemini-2.5-flash,
// gemini-3.1-flash-lite ($0.25/$1.5), gemini-2.5-pro and gemini-2.5-flash
// (both RETIRED 2026-12-01: redirected to 3.8 Flash and 3.5 Flash-Lite),
// gemini-2.5-flash-lite — all 1M context
// DeepSeek (5): deepseek-v4.1-flash ($0.14/$0.28, 1M, reasoning + coding —
// listed on Base 2026-10-20, same price as deepseek-chat; NOT on Solana yet:
Expand Down Expand Up @@ -154,11 +155,19 @@ export const BASE_RPC_URLS = [
// openai/o1, openai/o3-mini, openai/o4-mini (and o1-mini, which redirected
// onto o4-mini) -> openai/gpt-5.4-mini. Dead at OpenAI since 2026-10-23
// and on Azure since 2026-11-19. None was in a tier; see their price rows.
//
// 2026-12-01 RETIREMENTS (Google retires Gemini 2.5; the gateways redirect):
// google/gemini-2.5-flash -> google/gemini-3.5-flash-lite (same $0.3/$2.5).
// Written in place in fast and cheap. fast already listed 3.5-flash-lite
// further down; from 12-01 the gateway answered the 2.5 name with it, so
// the tier was already trying it second — that second slot now says so,
// and the later duplicate is gone. The order of every other member holds.
// google/gemini-2.5-pro -> google/gemini-3.8-flash. In no tier.
export const MODEL_TIERS = {
fast: ["google/gemini-3.6-flash", "google/gemini-2.5-flash", "openai/gpt-5.6-luna", "google/gemini-3.5-flash-lite", "openai/gpt-5-mini", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "google/gemini-3-flash-preview"],
fast: ["google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "openai/gpt-5.6-luna", "openai/gpt-5-mini", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "google/gemini-3-flash-preview"],
balanced: ["openai/gpt-5.6-terra", "anthropic/claude-sonnet-5", "moonshot/kimi-k3.1-pro", "google/gemini-3.1-pro", "xai/grok-4.5", "openai/gpt-5.5"],
powerful: ["anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "anthropic/claude-fable-5", "openai/gpt-5.4-pro", "openai/gpt-5.2-pro"],
cheap: ["deepseek/deepseek-v4-pro", "qwen/qwen3.7-flash", "minimax/minimax-m3", "google/gemini-2.5-flash", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "openai/gpt-5.4-nano"],
cheap: ["deepseek/deepseek-v4-pro", "qwen/qwen3.7-flash", "minimax/minimax-m3", "google/gemini-3.5-flash-lite", "deepseek/deepseek-chat", "deepseek/deepseek-v4.1-flash", "openai/gpt-5.4-nano"],
reasoning: ["anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "moonshot/kimi-k3.1-pro", "xai/grok-4.3", "deepseek/deepseek-v4-pro", "deepseek/deepseek-reasoner"],
// 2026-08-12 sweep (both chains, realistic prompt). Order matters: free[0]
// is what every mode:"free" call tries first, and a slow primary stalls the
Expand Down Expand Up @@ -536,6 +545,8 @@ export const CHAT_PRICE_PER_MTOKEN: Record<string, { input: number; output: numb
// not shipped the redirect yet (the claude-opus-4 rule — the dearer rail).
"google/gemini-3.5-flash": { input: 1.5, output: 9 },
"google/gemini-3-flash-preview": { input: 0.5, output: 3 },
// RETIRED from fast and cheap 2026-12-01: redirected to gemini-3.5-flash-lite
// at the same $0.3/$2.5, so the row is exact on every rail. Kept for pins.
"google/gemini-2.5-flash": { input: 0.3, output: 2.5 },
"google/gemini-3.5-flash-lite": { input: 0.3, output: 2.5 },
"moonshot/kimi-k3.1-pro": { input: 2, output: 10 },
Expand Down Expand Up @@ -588,6 +599,9 @@ export const CHAT_PRICE_PER_MTOKEN: Record<string, { input: number; output: numb
// ⏰ 2026-12-01: Google moves Argon to $4/$20 — re-price this row.
"google/gemini-4-argon": { input: 2, output: 10 },
"google/gemini-3.6-flash": { input: 0.75, output: 3.75 },
// RETIRED 2026-12-01: redirected to gemini-3.8-flash ($0.75/$3.75). The row
// (and its 200K step) over-covers the redirect target and still covers any
// rail that bills 2.5 Pro until it ships the redirect. Kept for pins.
"google/gemini-2.5-pro": { input: 1.25, output: 10 },
"google/gemini-3.1-flash-lite": { input: 0.25, output: 1.5 },
"google/gemini-2.5-flash-lite": { input: 0.1, output: 0.4 },
Expand Down
14 changes: 14 additions & 0 deletions test/retired-models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const REDIRECTED: Record<string, [string, Rate | null]> = {
"openai/o3-mini": ["openai/gpt-5.4-mini", { input: 1.1, output: 4.4 }],
"openai/o4-mini": ["openai/gpt-5.4-mini", { input: 1.1, output: 4.4 }],
"google/gemini-3.5-flash": ["google/gemini-3.6-flash", { input: 1.5, output: 9 }],
// 2026-12-01: Google retires Gemini 2.5.
"google/gemini-2.5-flash": ["google/gemini-3.5-flash-lite", { input: 0.3, output: 2.5 }],
"google/gemini-2.5-pro": ["google/gemini-3.8-flash", { input: 1.25, output: 10 }],
};

const bare = (id: string) => id.slice(id.indexOf("/") + 1);
Expand All @@ -58,6 +61,17 @@ test("fast[0] names the model Google serves, in the position its old name held",
assert.deepEqual(CHAT_PRICE_PER_MTOKEN["google/gemini-3.6-flash"], { input: 0.75, output: 3.75 });
});

test("gemini-3.5-flash-lite holds gemini-2.5-flash's slot in fast and cheap, once each", () => {
// From 2026-12-01 the gateway answers the 2.5 name with 3.5 Flash-Lite, so
// the served order is unchanged: fast tried it second already (and again,
// as a duplicate, fourth); cheap tried it fourth.
assert.equal(MODEL_TIERS.fast[1], "google/gemini-3.5-flash-lite");
assert.equal(MODEL_TIERS.cheap[3], "google/gemini-3.5-flash-lite");
for (const [mode, ids] of Object.entries(MODEL_TIERS)) {
assert.equal(new Set(ids).size, ids.length, `${mode} lists a model twice`);
}
});

test("every redirect target has its own price row (a tier or a pin lands on it)", () => {
for (const [retired, [target]] of Object.entries(REDIRECTED)) {
assert.ok(Object.hasOwn(CHAT_PRICE_PER_MTOKEN, target), `${retired} -> ${target} has no row`);
Expand Down
Loading