feat: upgrade MiniMax default model to M2.7

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model
- Update cache read pricing from $0.03 to $0.06 per M tokens for M2.7
- Keep all previous models (M2.5, M2, M2-Stable, M2.1) as alternatives
- Update related unit tests
This commit is contained in:
PR Bot 2026-03-19 19:23:05 +08:00
parent 137d3f4fd8
commit fcb6710651
2 changed files with 61 additions and 7 deletions

View file

@ -5,9 +5,39 @@ import type { ModelInfo } from "../model.js"
// https://platform.minimax.io/docs/api-reference/text-openai-api
// https://platform.minimax.io/docs/api-reference/text-anthropic-api
export type MinimaxModelId = keyof typeof minimaxModels
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.5"
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.7"
export const minimaxModels = {
"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 flagship model with enhanced reasoning and coding capabilities.",
},
"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:
"High-speed version of M2.7 for low-latency scenarios.",
},
"MiniMax-M2.5": {
maxTokens: 16_384,
contextWindow: 204_800,
@ -21,7 +51,7 @@ 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, a capable model with strong coding and agentic capabilities, building on the strengths of the M2 series.",
},
"MiniMax-M2": {
maxTokens: 16_384,

View file

@ -87,8 +87,8 @@ describe("MiniMaxHandler", () => {
expect(model.info).toEqual(minimaxModels[testModelId])
})
it("should return MiniMax-M2.5 model with correct configuration", () => {
const testModelId: MinimaxModelId = "MiniMax-M2.5"
it("should return MiniMax-M2.7 model with correct configuration", () => {
const testModelId: MinimaxModelId = "MiniMax-M2.7"
const handlerWithModel = new MiniMaxHandler({
apiModelId: testModelId,
minimaxApiKey: "test-minimax-api-key",
@ -100,7 +100,7 @@ describe("MiniMaxHandler", () => {
expect(model.info.maxTokens).toBe(16_384)
expect(model.info.supportsPromptCache).toBe(true)
expect(model.info.cacheWritesPrice).toBe(0.375)
expect(model.info.cacheReadsPrice).toBe(0.03)
expect(model.info.cacheReadsPrice).toBe(0.06)
})
it("should return MiniMax-M2 model with correct configuration", () => {
@ -191,10 +191,10 @@ describe("MiniMaxHandler", () => {
expect(model.info).toEqual(minimaxModels[minimaxDefaultModelId])
})
it("should default to MiniMax-M2.5 model", () => {
it("should default to MiniMax-M2.7 model", () => {
const handlerDefault = new MiniMaxHandler({ minimaxApiKey: "test-minimax-api-key" })
const model = handlerDefault.getModel()
expect(model.id).toBe("MiniMax-M2.5")
expect(model.id).toBe("MiniMax-M2.7")
})
})
@ -396,6 +396,30 @@ describe("MiniMaxHandler", () => {
})
describe("Model Configuration", () => {
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 model properties", () => {
const model = minimaxModels["MiniMax-M2"]
expect(model.maxTokens).toBe(16_384)