From f01aaf0a0677cffa8410c9d34a9bfb3884b1b4a4 Mon Sep 17 00:00:00 2001 From: octo-patch <266937838+octo-patch@users.noreply.github.com> Date: Fri, 4 Sep 2026 12:00:13 +0800 Subject: [PATCH] docs(minimax): refresh current model metadata --- README.md | 2 +- src/config.ts | 8 +++--- src/services/ai/providers/minimax.ts | 38 ++++++++++++++++++++++++++++ tests/minimax-provider.test.ts | 29 ++++++++++++++++++++- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 42b6ce2..cb6c524 100644 --- a/README.md +++ b/README.md @@ -414,7 +414,7 @@ Manual `memoryProvider` modes: - `openai-chat`: OpenAI Chat Completions compatible API with tool/function calling. This can work with compatible proxies such as LiteLLM only when the selected upstream model and proxy preserve tool calls. - `openai-responses`: OpenAI Responses API with function-call output. - `anthropic`: Anthropic Messages API with tool use. -- `minimax`: MiniMax Anthropic Messages-compatible endpoint. Set `memoryApiUrl` to the global endpoint (`https://api.minimax.io`) or the China endpoint (`https://api.minimaxi.com`); the `/anthropic/v1/messages` path and `x-api-key` header are applied automatically. MiniMax text models such as `MiniMax-M3` support the adaptive thinking modes used by this plugin via `memoryExtraParams`. +- `minimax`: MiniMax Anthropic Messages-compatible endpoint. Set `memoryApiUrl` to the global endpoint (`https://api.minimax.io/anthropic`) or the China endpoint (`https://api.minimaxi.com/anthropic`); the `/v1/messages` path and `x-api-key` header are applied automatically. Current models include `MiniMax-M3` (1,000,000-token context; text, image, and video input; adaptive or disabled thinking) and `MiniMax-M2.7` (204,800-token context; text input; always-on thinking). `MiniMax-M3` supports adaptive thinking through `memoryExtraParams`. - `orcarouter`: OpenAI-compatible model gateway with namespaced model IDs. `memoryApiUrl` and `memoryModel` are optional — they default to `https://api.orcarouter.ai/v1` and `orcarouter/auto` (a routing alias that selects a capable model per request). If you set `memoryModel`, use a namespaced ID such as `openai/gpt-5.5` or `deepseek/deepseek-v4-flash`; OrcaRouter rejects bare model names. Example: ```jsonc "memoryProvider": "orcarouter", diff --git a/src/config.ts b/src/config.ts index 46b9278..519dfa5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -416,10 +416,12 @@ const CONFIG_TEMPLATE = `{ // MiniMax (Anthropic Messages-compatible endpoint, with session support): // "memoryProvider": "minimax" - // "memoryModel": "MiniMax-M3" - // "memoryApiUrl": "https://api.minimax.io" // global endpoint + // "memoryModel": "MiniMax-M3" // 1,000,000-token context; text, image, video + // // Alternative: "MiniMax-M2.7" // 204,800-token context; text + // "memoryApiUrl": "https://api.minimax.io/anthropic" // global endpoint // "memoryApiKey": "" - // // China endpoint: "memoryApiUrl": "https://api.minimaxi.com" + // // China endpoint: "memoryApiUrl": "https://api.minimaxi.com/anthropic" + // // MiniMax-M3 supports adaptive or disabled thinking; MiniMax-M2.7 thinking is always on. // // Optional adaptive thinking for MiniMax-M3: // "memoryExtraParams": { "thinking": { "type": "adaptive" } } diff --git a/src/services/ai/providers/minimax.ts b/src/services/ai/providers/minimax.ts index afe5711..b59bdf7 100644 --- a/src/services/ai/providers/minimax.ts +++ b/src/services/ai/providers/minimax.ts @@ -3,6 +3,44 @@ import { AISessionManager } from "../session/ai-session-manager.js"; import { AnthropicMessagesProvider } from "./anthropic-messages.js"; import type { AIProviderType } from "../session/session-types.js"; +export interface MiniMaxModelMetadata { + contextWindow: number; + pricingUsdPerMillionTokens: { + input: number; + output: number; + cacheRead: number; + cacheWrite: number | null; + }; + inputModalities: readonly string[]; + thinkingModes: readonly string[]; +} + +/** Current text model capabilities and pricing. */ +export const MINIMAX_MODEL_METADATA = { + "MiniMax-M3": { + contextWindow: 1_000_000, + pricingUsdPerMillionTokens: { + input: 0.6, + output: 2.4, + cacheRead: 0.12, + cacheWrite: null, + }, + inputModalities: ["text", "image", "video"], + thinkingModes: ["adaptive", "disabled"], + }, + "MiniMax-M2.7": { + contextWindow: 204_800, + pricingUsdPerMillionTokens: { + input: 0.3, + output: 1.2, + cacheRead: 0.06, + cacheWrite: 0.375, + }, + inputModalities: ["text"], + thinkingModes: ["always_on"], + }, +} as const satisfies Record; + /** * MiniMax provider. * diff --git a/tests/minimax-provider.test.ts b/tests/minimax-provider.test.ts index b928706..5ce213f 100644 --- a/tests/minimax-provider.test.ts +++ b/tests/minimax-provider.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from "bun:test"; -import { MiniMaxProvider } from "../src/services/ai/providers/minimax.js"; +import { MINIMAX_MODEL_METADATA, MiniMaxProvider } from "../src/services/ai/providers/minimax.js"; import { AIProviderFactory } from "../src/services/ai/ai-provider-factory.js"; import type { ChatCompletionTool } from "../src/services/ai/tools/tool-schema.js"; @@ -214,6 +214,33 @@ describe("MiniMaxProvider", () => { }); }); +describe("MiniMax model metadata", () => { + it("describes the current models", () => { + expect(MINIMAX_MODEL_METADATA["MiniMax-M3"]).toEqual({ + contextWindow: 1_000_000, + pricingUsdPerMillionTokens: { + input: 0.6, + output: 2.4, + cacheRead: 0.12, + cacheWrite: null, + }, + inputModalities: ["text", "image", "video"], + thinkingModes: ["adaptive", "disabled"], + }); + expect(MINIMAX_MODEL_METADATA["MiniMax-M2.7"]).toEqual({ + contextWindow: 204_800, + pricingUsdPerMillionTokens: { + input: 0.3, + output: 1.2, + cacheRead: 0.06, + cacheWrite: 0.375, + }, + inputModalities: ["text"], + thinkingModes: ["always_on"], + }); + }); +}); + describe("AIProviderFactory minimax wiring", () => { it("creates a MiniMax provider and lists it as supported", () => { const provider = AIProviderFactory.createProvider("minimax", {