Skip to content
Merged
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,335 |
| `full` *(default)* | 19 | 14,348 |
| `trading` | 8 | 5,411 |
| `media` | 7 | 7,144 |
| `research` | 5 | 2,727 |
| `chat` | 3 | 2,082 |
| `research` | 5 | 2,740 |
| `chat` | 3 | 2,095 |

Running `--profile trading` instead of the default costs **62% 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
6 changes: 3 additions & 3 deletions docs/mcp-schema-overhead.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Written 2026-09-01, verified against `@modelcontextprotocol/sdk` 1.29.0. Numbers

| Profile | Tools | Context |
|---------|-------|---------|
| `full` *(default)* | 19 | 14,335 |
| `full` *(default)* | 19 | 14,348 |
| `trading` | 8 | 5,411 |
| `media` | 7 | 7,144 |
| `research` | 5 | 2,727 |
| `chat` | 3 | 2,082 |
| `research` | 5 | 2,740 |
| `chat` | 3 | 2,095 |

Descriptions are ~54% of it, input schemas ~42%. `--profile trading` costs 62% 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 @@ -443,7 +443,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, Grok 4.3, deepseek-v4-pro
- mode:"coding" → Claude Opus 5, GPT-5.3-codex, Kimi K3, Grok Build, GLM-5.2
- mode:"cheap" → deepseek-v4-pro, Qwen3.7 Flash, MiniMax M3, Tencent Hy3
- mode:"cheap" → deepseek-v4-pro, Qwen3.7 Flash, MiniMax M3, Gemini 2.5 Flash, 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
11 changes: 8 additions & 3 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export const BASE_RPC_URLS = [
// 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-2.5-flash-lite — all 1M context
// DeepSeek (4): deepseek-v4-flash-vision-exp ($0.3/$1.2), deepseek-v4-pro ($1.32/$3.96, 1M, reasoning + coding;
// 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:
// sol.blockrun.ai answers 400 "Unknown model", which a routing tier just
// falls through before any payment), deepseek-v4-flash-vision-exp ($0.3/$1.2), deepseek-v4-pro ($1.32/$3.96, 1M, reasoning + coding;
// repriced by the gateway and re-probed 2026-09-02),
// deepseek-chat, deepseek-reasoner ($0.14/$0.28 on Base since DeepSeek's
// 2026-08-07 cut; sol still quotes $0.2/$0.4 — see the drift note above)
Expand Down Expand Up @@ -134,10 +137,10 @@ export const BASE_RPC_URLS = [
// hidden-alive since July). They stay routed at the tail of free[] until a
// realistic-prompt POST probe reads their response `model` field.
export const MODEL_TIERS = {
fast: ["google/gemini-3.5-flash", "google/gemini-2.5-flash", "openai/gpt-5.6-luna", "google/gemini-3.5-flash-lite", "openai/gpt-5-mini", "deepseek/deepseek-chat", "google/gemini-3-flash-preview"],
fast: ["google/gemini-3.5-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"],
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"],
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", "openai/gpt-5.4-nano"],
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"],
reasoning: ["anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "openai/gpt-5.6-sol", "moonshot/kimi-k3", "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 @@ -432,6 +435,8 @@ export const CHAT_PRICE_PER_MTOKEN: Record<string, { input: number; output: numb
"zai/glm-5": { input: 1, output: 3.2 },
"deepseek/deepseek-v4-pro": { input: 1.32, output: 3.96 },
"deepseek/deepseek-chat": { input: 0.14, output: 0.28 },
// Base GET /v1/models + account sheet, 2026-10-20 (not yet on Solana).
"deepseek/deepseek-v4.1-flash": { input: 0.14, output: 0.28 },
"deepseek/deepseek-reasoner": { input: 0.14, output: 0.28 },
"minimax/minimax-m3": { input: 0.3, output: 1.2 },
// Every other live, available, paid chat id in GET /v1/models (2026-10-20;
Expand Down
17 changes: 17 additions & 0 deletions test/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,20 @@ test("free[] is the self-serving set from the 2026-10-20 probe, fastest first",
assert.ok(!(MODEL_TIERS.free as readonly string[]).includes(aliased), `${aliased} answers as another model on both chains — not a fallback rung`);
}
});

// deepseek/deepseek-v4.1-flash, listed on Base 2026-10-20 at deepseek-chat's
// $0.14/$0.28. It sits beside deepseek-chat (never in place of it) because
// Solana does not serve it yet — sol answers 400 "Unknown model" before any
// payment, so the tier simply falls through to the next member there.
test("deepseek-v4.1-flash is priced like deepseek-chat and follows it in fast and cheap", () => {
assert.deepEqual(CHAT_PRICE_PER_MTOKEN["deepseek/deepseek-v4.1-flash"], { input: 0.14, output: 0.28 });
assert.deepEqual(CHAT_PRICE_PER_MTOKEN["deepseek/deepseek-v4.1-flash"], CHAT_PRICE_PER_MTOKEN["deepseek/deepseek-chat"]);
for (const tier of ["fast", "cheap"] as const) {
const ids = MODEL_TIERS[tier] as readonly string[];
assert.equal(ids.indexOf("deepseek/deepseek-v4.1-flash"), ids.indexOf("deepseek/deepseek-chat") + 1, tier);
}
assert.equal(
estimateChatCost(1024, undefined, "deepseek-v4.1-flash", undefined, 100_000),
estimateChatCost(1024, undefined, "deepseek/deepseek-chat", undefined, 100_000),
);
});
Loading