feat(minimax): add new models and update descriptions with pricing info

- Add MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5-highspeed, MiniMax-M2.1-highspeed models
- Update contextWindow for MiniMax-M2 and MiniMax-M2.1 from 192000 to 204800
- Add pricing links and TokenPlan billing notes to model descriptions
- Add highspeed subscription note to -highspeed models
- Update tests for new models and corrected contextWindow values
This commit is contained in:
Александр Родионов 2026-04-06 19:43:21 +03:00
parent 137d3f4fd8
commit f5b20199e7
3 changed files with 181 additions and 14 deletions

View file

@ -1,9 +1,9 @@
import type { ModelInfo } from "../model.js"
// Minimax
// https://platform.minimax.io/docs/guides/pricing
// https://platform.minimax.io/docs/api-reference/text-openai-api
// https://platform.minimax.io/docs/api-reference/text-anthropic-api
// https://platform.minimax.io/docs/guides/models-intro
// https://platform.minimax.io/docs/guides/pricing-paygo
// https://platform.minimax.io/docs/guides/pricing-tokenplan
export type MinimaxModelId = keyof typeof minimaxModels
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.5"
@ -21,11 +21,56 @@ export const minimaxModels = {
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2.5, the latest MiniMax model with enhanced coding and agentic capabilities, building on the strengths of the M2 series.",
"MiniMax M2.5, the latest MiniMax model with enhanced coding and agentic capabilities, building on the strengths of the M2 series. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2.5-highspeed": {
maxTokens: 16_384,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.6,
outputPrice: 2.4,
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2.5 highspeed: same performance as M2.5 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2.7": {
maxTokens: 16_384,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.3,
outputPrice: 1.2,
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.06,
description:
"MiniMax M2.7, the latest MiniMax model with recursive self-improvement capabilities. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2.7-highspeed": {
maxTokens: 16_384,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.6,
outputPrice: 2.4,
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.06,
description:
"MiniMax M2.7 highspeed: same performance as M2.7 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2": {
maxTokens: 16_384,
contextWindow: 192_000,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
@ -36,11 +81,11 @@ export const minimaxModels = {
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2, a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed.",
"MiniMax M2, a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2-Stable": {
maxTokens: 16_384,
contextWindow: 192_000,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
@ -51,11 +96,11 @@ export const minimaxModels = {
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2 Stable (High Concurrency, Commercial Use), a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed.",
"MiniMax M2 Stable (High Concurrency, Commercial Use), a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2.1": {
maxTokens: 16_384,
contextWindow: 192_000,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
@ -66,7 +111,22 @@ export const minimaxModels = {
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2.1 builds on M2 with improved overall performance for agentic coding tasks and significantly faster response times.",
"MiniMax M2.1 builds on M2 with improved overall performance for agentic coding tasks and significantly faster response times. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2.1-highspeed": {
maxTokens: 16_384,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.6,
outputPrice: 2.4,
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.03,
description:
"MiniMax M2.1 highspeed: same performance as M2.1 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.",
},
} as const satisfies Record<string, ModelInfo>

View file

@ -112,7 +112,7 @@ describe("MiniMaxHandler", () => {
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(minimaxModels[testModelId])
expect(model.info.contextWindow).toBe(192_000)
expect(model.info.contextWindow).toBe(204_800)
expect(model.info.maxTokens).toBe(16_384)
expect(model.info.supportsPromptCache).toBe(true)
expect(model.info.cacheWritesPrice).toBe(0.375)
@ -128,7 +128,7 @@ describe("MiniMaxHandler", () => {
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(minimaxModels[testModelId])
expect(model.info.contextWindow).toBe(192_000)
expect(model.info.contextWindow).toBe(204_800)
expect(model.info.maxTokens).toBe(16_384)
expect(model.info.supportsPromptCache).toBe(true)
expect(model.info.cacheWritesPrice).toBe(0.375)
@ -399,7 +399,7 @@ describe("MiniMaxHandler", () => {
it("should correctly configure MiniMax-M2 model properties", () => {
const model = minimaxModels["MiniMax-M2"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(192_000)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.3)
@ -411,7 +411,7 @@ describe("MiniMaxHandler", () => {
it("should correctly configure MiniMax-M2-Stable model properties", () => {
const model = minimaxModels["MiniMax-M2-Stable"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(192_000)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.3)
@ -419,5 +419,63 @@ describe("MiniMaxHandler", () => {
expect(model.cacheWritesPrice).toBe(0.375)
expect(model.cacheReadsPrice).toBe(0.03)
})
it("should correctly configure MiniMax-M2.7 model properties", () => {
const model = minimaxModels["MiniMax-M2.7"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.3)
expect(model.outputPrice).toBe(1.2)
expect(model.cacheWritesPrice).toBe(0.375)
expect(model.cacheReadsPrice).toBe(0.06)
})
it("should correctly configure MiniMax-M2.7-highspeed model properties", () => {
const model = minimaxModels["MiniMax-M2.7-highspeed"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.6)
expect(model.outputPrice).toBe(2.4)
expect(model.cacheWritesPrice).toBe(0.375)
expect(model.cacheReadsPrice).toBe(0.06)
})
it("should correctly configure MiniMax-M2.5-highspeed model properties", () => {
const model = minimaxModels["MiniMax-M2.5-highspeed"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.6)
expect(model.outputPrice).toBe(2.4)
expect(model.cacheWritesPrice).toBe(0.375)
expect(model.cacheReadsPrice).toBe(0.03)
})
it("should correctly configure MiniMax-M2.1-highspeed model properties", () => {
const model = minimaxModels["MiniMax-M2.1-highspeed"]
expect(model.maxTokens).toBe(16_384)
expect(model.contextWindow).toBe(204_800)
expect(model.supportsImages).toBe(false)
expect(model.supportsPromptCache).toBe(true)
expect(model.inputPrice).toBe(0.6)
expect(model.outputPrice).toBe(2.4)
expect(model.cacheWritesPrice).toBe(0.375)
expect(model.cacheReadsPrice).toBe(0.03)
})
it("should correctly configure MiniMax-M2.1 model properties with updated context window", () => {
const model = minimaxModels["MiniMax-M2.1"]
expect(model.contextWindow).toBe(204_800)
})
it("should correctly configure MiniMax-M2 model properties with updated context window", () => {
const model = minimaxModels["MiniMax-M2"]
expect(model.contextWindow).toBe(204_800)
})
})
})

View file

@ -11,6 +11,8 @@ import {
BEDROCK_1M_CONTEXT_MODEL_IDS,
litellmDefaultModelInfo,
openAiModelInfoSaneDefaults,
minimaxDefaultModelId,
minimaxModels,
} from "@roo-code/types"
import { useSelectedModel } from "../useSelectedModel"
@ -725,4 +727,51 @@ describe("useSelectedModel", () => {
expect(result.current.info).toEqual(customModelInfo)
})
})
describe("minimax provider", () => {
beforeEach(() => {
mockUseRouterModels.mockReturnValue({
data: {
openrouter: {},
requesty: {},
litellm: {},
},
isLoading: false,
isError: false,
} as any)
mockUseOpenRouterModelProviders.mockReturnValue({
data: {},
isLoading: false,
isError: false,
} as any)
})
it("should return default minimax model when no custom model is specified", () => {
const apiConfiguration: ProviderSettings = {
apiProvider: "minimax",
}
const wrapper = createWrapper()
const { result } = renderHook(() => useSelectedModel(apiConfiguration), { wrapper })
expect(result.current.provider).toBe("minimax")
expect(result.current.id).toBe(minimaxDefaultModelId)
expect(result.current.info).toEqual(minimaxModels[minimaxDefaultModelId])
})
it("should use custom model ID and info when model exists in minimaxModels", () => {
const apiConfiguration: ProviderSettings = {
apiProvider: "minimax",
apiModelId: "MiniMax-M2.7",
}
const wrapper = createWrapper()
const { result } = renderHook(() => useSelectedModel(apiConfiguration), { wrapper })
expect(result.current.provider).toBe("minimax")
expect(result.current.id).toBe("MiniMax-M2.7")
expect(result.current.info).toEqual(minimaxModels["MiniMax-M2.7"])
})
})
})