Skip to content
Draft
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
19 changes: 19 additions & 0 deletions changelog/unreleased/2026-08-03-minimax-m3-preset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Built-in MiniMax M3 model preset

The built-in model catalog gains a MiniMax provider group with one direct `MiniMax-M3` preset, ready to use with only an API key.

## Core

The new `minimax-token-plan` group (label "MiniMax", listed between Moonshot and Custom) carries `MiniMax-M3` with a 1,000,000-token context window and vision support. The preset pins AgentHub's `minimax-m3` Responses client and inlines the direct endpoint `https://api.minimax.io/v1`, so it holds no secret and accepts either a Token Plan Subscription Key or a pay-as-you-go API key.

Pricing is omitted because MiniMax doubles cache-read, input, and output rates above 512K input tokens, while the catalog cannot represent tiered pricing. Env-var fallback mirrors AgentHub's exact routing: only `MiniMax-M3` with the `minimax-m3` client resolves to `MINIMAX_API_KEY` / `MINIMAX_BASE_URL`; lookalike and unsupported MiniMax ids remain unroutable.

Requires `@prismshadow/agenthub` >= 0.4.2, the first release that ships the `minimax-m3` Responses client.

## Web App

The provider logo set gains MiniMax's official stream-lines mark, flattened to currentColor monochrome — the same recognition-purposes treatment as the other vendor brand marks.

## Docs

The bilingual model and configuration pages document the new group, its credential resolution, omitted tiered pricing, and the M3 thinking mapping where `none` becomes `reasoning.effort = "none"`.
2 changes: 2 additions & 0 deletions changelog/unreleased/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
- [2026-08-06] Models: Thinking Machines Lab's Inkling joins on OpenRouter and Fireworks AI, Fireworks AI gains DeepSeek V4 Flash 0731, and the OpenRouter + SiliconFlow GLM-5.1 gateway listings are delisted (Z.AI direct stays; existing Project configs unaffected); OpenRouter prices refreshed from the models API on 2026-08-07 (Inkling cached input $0.17, four drifted rows corrected); agenthub-models skill v11. ([details](2026-08-06-model-catalog-inkling-dsv4-flash-0731.md))

- [2026-08-06] Release tooling: repo versions realigned with the shipped 0.2.1, and the release workflow now refuses a tag push whose version does not match `package.json` (the drift that made every dev build nag about updates); the bump is documented as a release-prep step. ([details](2026-08-06-release-version-guard.md))

- [2026-08-03] Core & Web App: an official `MiniMax-M3` preset (1M context, vision) pins AgentHub's `minimax-m3` Responses client and direct endpoint, uses `MINIMAX_*` credential fallback, omits unsupported tiered pricing, and adds the MiniMax provider glyph plus bilingual docs (requires AgentHub >= 0.4.2). ([details](2026-08-03-minimax-m3-preset.md))
57 changes: 42 additions & 15 deletions packages/core/src/state/model-catalog.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Built-in model catalog (single source of truth): official chat models that AgentHub can
* auto-route, shared by core's default config, server's initial config, and web/cli display.
* Data verified as of 2026-07-10 (Qwen Token Plan entries: 2026-07-20, per the plan's docs).
* Data verified as of 2026-07-10 (Qwen Token Plan entries: 2026-07-20; MiniMax Token Plan: 2026-08-03, per each provider's docs).
* Docs: packages/docs/content/models.{zh,en}.md (site path /docs/models) documents the
* provider groups and credential resolution described here.
*
Expand All @@ -11,9 +11,10 @@
* - cache_write: the vendor's "cache write" price (e.g. Anthropic uses 1.25 x input); vendors
* without a separate cache-write fee use the standard input price;
* - output: output price (thinking + reply).
* OpenAI charges extra for >272K input and Gemini 3.1 Pro for >200K input under official
* long-context pricing; this catalog only records the base tier (the cost center uses a
* single rate, so long-context usage will be underestimated).
* OpenAI charges extra for >272K input and Gemini 3.1 Pro for >200K input; this catalog records
* their base tier (the cost center uses a single rate, so long-context usage will be
* underestimated). MiniMax M3 pricing is omitted because all three rates double above 512K
* input tokens and the catalog cannot represent tiered pricing.
*
* Scope: excludes deepseek-chat / deepseek-reasoner legacy aliases that AgentHub cannot
* auto-route (deprecated 2026-07-24), glm-5v-turbo (image input unsupported by AgentHub's GLM
Expand All @@ -22,7 +23,8 @@
* generation / TTS), and Bedrock. Direct-vendor ids are auto-routed by AgentHub and leave
* client_type unset; the five gateway groups (OpenRouter, Fireworks AI, SiliconFlow, Qwen
* Token Plan, Qwen Pay-As-You-Go) can't be auto-routed, so they set `client_type: "openai"`
* and inline their preset base URL.
* and inline their preset base URL. The MiniMax M3 preset pins AgentHub's first-party
* `minimax-m3` protocol and direct API endpoint.
*
* This file imports no Node built-ins (type-only imports only), so it can be bundled directly
* for the browser.
Expand Down Expand Up @@ -60,25 +62,27 @@ export interface ModelCatalogEntry {
pricing?: ModelPricing;
/** Whether image input (vision modality) is supported. */
supportsVision: boolean;
/** AgentHub client protocol: required for models whose id can't be auto-routed (e.g. OpenRouter gateway models). */
/** AgentHub client protocol: required when an id cannot be auto-routed or a shared protocol must be pinned. */
clientType?: string;
/** Preset base URL (gateway models): inlined into the model entry so the user only needs to supply an API key. */
/** Preset base URL: inlined into gateway and direct MiniMax entries so only an API key is required. */
baseUrl?: string;
}

/** Each gateway's OpenAI-compatible endpoint (preset base URL for gateway models; also used as the provider's gatewayBaseUrl). */
/** Preset provider endpoints; only OpenAI-compatible gateways expose theirs as gatewayBaseUrl. */
const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
const SILICONFLOW_BASE_URL = "https://api.siliconflow.cn/v1";
const QWEN_TOKEN_PLAN_BASE_URL =
"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1";
const QWEN_PAYG_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
const FIREWORKS_BASE_URL = "https://api.fireworks.ai/inference/v1";
const MINIMAX_BASE_URL = "https://api.minimax.io/v1";

/**
* Provider list (web model page groups in this order): DeepSeek first (the default model's
* provider), followed by the five gateways (OpenRouter, Fireworks AI, SiliconFlow, Qwen Token
* Plan, Qwen Pay-As-You-Go), then the first-party providers Google Gemini, Anthropic, OpenAI,
* Z.AI (GLM) and Moonshot (Kimi); custom groups custom OpenAI-protocol models and comes last.
* Z.AI (GLM), Moonshot (Kimi), and MiniMax; custom groups custom OpenAI-protocol models and
* comes last.
*/
export const MODEL_PROVIDERS: ModelProviderInfo[] = [
{
Expand Down Expand Up @@ -179,6 +183,14 @@ export const MODEL_PROVIDERS: ModelProviderInfo[] = [
apiKeyUrl: "https://platform.kimi.com/console/api-keys",
modelsUrl: "https://platform.kimi.com/docs/pricing",
},
{
id: "minimax-token-plan",
label: "MiniMax",
envKey: "MINIMAX_API_KEY",
envBaseUrlKey: "MINIMAX_BASE_URL",
apiKeyUrl: "https://platform.minimax.io/subscribe/token-plan?tab=api-enterprise",
modelsUrl: "https://platform.minimax.io/docs/guides/models-intro",
},
{ id: "custom", label: "Custom", envKey: "OPENAI_API_KEY", envBaseUrlKey: "OPENAI_BASE_URL" },
];

Expand Down Expand Up @@ -815,6 +827,17 @@ export const MODEL_CATALOG: ModelCatalogEntry[] = [
clientType: "openai",
baseUrl: QWEN_PAYG_BASE_URL,
},
// -- MiniMax (direct M3 Responses client). Pricing is omitted because all rates double above
// 512K input tokens and the catalog cannot represent tiered pricing. --
{
modelId: "MiniMax-M3",
displayName: "MiniMax M3",
provider: "minimax-token-plan",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不需要分 Token plan

contextWindow: 1000000,
supportsVision: true,
clientType: "minimax-m3",
baseUrl: MINIMAX_BASE_URL,
},
// -- Google Gemini (official USD pricing) --
{
modelId: "gemini-3.6-flash",
Expand Down Expand Up @@ -1030,14 +1053,15 @@ export interface ModelEnvInfo {

/**
* Resolves the env var fallback for a model: mirrors AgentHub's
* AutoLLMClient routing rules (verified against agenthub v0.4.1 autoClient.ts) - an explicit
* client_type takes priority, otherwise routes to a client by lowercase substring match on
* model_id, returning the var pair that client reads; branch order matches AutoLLMClient.
* AutoLLMClient routing rules - an explicit client_type takes priority; otherwise the lowercase
* model_id is matched by the same exact or family-specific rules, returning the var pair that
* client reads. Branch order matches AutoLLMClient.
* Returns undefined on no match (AgentHub will reject that id: it needs an explicit
* client_type, or should be added under custom / a self-built group via the OpenAI protocol).
*/
export function resolveModelEnv(modelId: string, clientType?: string): ModelEnvInfo | undefined {
const t = (clientType || modelId).toLowerCase();
const explicitClientType = clientType?.toLowerCase();
const t = explicitClientType || modelId.toLowerCase();
const env = (prefix: string): ModelEnvInfo => ({
envKey: `${prefix}_API_KEY`,
envBaseUrlKey: `${prefix}_BASE_URL`,
Expand All @@ -1054,6 +1078,9 @@ export function resolveModelEnv(modelId: string, clientType?: string): ModelEnvI
// agenthub 0.4.1 routes kimi-k3 to its own client, which reads the same MOONSHOT_* pair.
if (t.includes("kimi-k3")) return env("MOONSHOT");
if (t.includes("kimi-k2.5") || t.includes("kimi-k2.6")) return env("MOONSHOT");
if (t === "minimax-m3" && modelId.toLowerCase() === "minimax-m3") {
return env("MINIMAX");
}
if (t.includes("deepseek-v4")) return env("DEEPSEEK");
if (t.includes("openai")) return env("OPENAI");
return undefined;
Expand All @@ -1064,8 +1091,8 @@ export function resolveModelEnv(modelId: string, clientType?: string): ModelEnvI
* config, avoiding duplicate hand-written copies). `provider` and `model_id` are persisted as
* separate fields (`model_id` is the plain upstream id); models whose upstream id can be
* auto-routed by AgentHub leave client_type unset; gateway models (OpenRouter / SiliconFlow)
* explicitly set client_type=openai and inline a preset base_url (no secrets included, so the
* user only needs to supply an API key).
* explicitly set client_type=openai and inline a preset base_url. The direct MiniMax M3 entry
* also pins its protocol and endpoint. No secrets are included, so only an API key is needed.
*/
export function presetModelEntries(): ModelEntry[] {
return MODEL_CATALOG.map((m) => ({
Expand Down
Loading