Skip to content

Commit 61ee507

Browse files
committed
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 (was M2.5) - Update cache read pricing for M2.7 models ($0.06/M tokens) - Keep all previous models as alternatives - Update related unit tests
1 parent 137d3f4 commit 61ee507

2 files changed

Lines changed: 104 additions & 3 deletions

File tree

packages/types/src/providers/minimax.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,39 @@ import type { ModelInfo } from "../model.js"
55
// https://platform.minimax.io/docs/api-reference/text-openai-api
66
// https://platform.minimax.io/docs/api-reference/text-anthropic-api
77
export type MinimaxModelId = keyof typeof minimaxModels
8-
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.5"
8+
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.7"
99

1010
export const minimaxModels = {
11+
"MiniMax-M2.7": {
12+
maxTokens: 16_384,
13+
contextWindow: 204_800,
14+
supportsImages: false,
15+
supportsPromptCache: true,
16+
includedTools: ["search_and_replace"],
17+
excludedTools: ["apply_diff"],
18+
preserveReasoning: true,
19+
inputPrice: 0.3,
20+
outputPrice: 1.2,
21+
cacheWritesPrice: 0.375,
22+
cacheReadsPrice: 0.06,
23+
description:
24+
"MiniMax M2.7, the latest flagship model with enhanced reasoning and coding capabilities, building on the strengths of the M2 series.",
25+
},
26+
"MiniMax-M2.7-highspeed": {
27+
maxTokens: 16_384,
28+
contextWindow: 204_800,
29+
supportsImages: false,
30+
supportsPromptCache: true,
31+
includedTools: ["search_and_replace"],
32+
excludedTools: ["apply_diff"],
33+
preserveReasoning: true,
34+
inputPrice: 0.6,
35+
outputPrice: 2.4,
36+
cacheWritesPrice: 0.375,
37+
cacheReadsPrice: 0.06,
38+
description:
39+
"MiniMax M2.7 High-speed version of M2.7 for low-latency scenarios.",
40+
},
1141
"MiniMax-M2.5": {
1242
maxTokens: 16_384,
1343
contextWindow: 204_800,

src/api/providers/__tests__/minimax.spec.ts

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,40 @@ describe("MiniMaxHandler", () => {
8787
expect(model.info).toEqual(minimaxModels[testModelId])
8888
})
8989

90+
it("should return MiniMax-M2.7 model with correct configuration", () => {
91+
const testModelId: MinimaxModelId = "MiniMax-M2.7"
92+
const handlerWithModel = new MiniMaxHandler({
93+
apiModelId: testModelId,
94+
minimaxApiKey: "test-minimax-api-key",
95+
})
96+
const model = handlerWithModel.getModel()
97+
expect(model.id).toBe(testModelId)
98+
expect(model.info).toEqual(minimaxModels[testModelId])
99+
expect(model.info.contextWindow).toBe(204_800)
100+
expect(model.info.maxTokens).toBe(16_384)
101+
expect(model.info.supportsPromptCache).toBe(true)
102+
expect(model.info.cacheWritesPrice).toBe(0.375)
103+
expect(model.info.cacheReadsPrice).toBe(0.06)
104+
})
105+
106+
it("should return MiniMax-M2.7-highspeed model with correct configuration", () => {
107+
const testModelId: MinimaxModelId = "MiniMax-M2.7-highspeed"
108+
const handlerWithModel = new MiniMaxHandler({
109+
apiModelId: testModelId,
110+
minimaxApiKey: "test-minimax-api-key",
111+
})
112+
const model = handlerWithModel.getModel()
113+
expect(model.id).toBe(testModelId)
114+
expect(model.info).toEqual(minimaxModels[testModelId])
115+
expect(model.info.contextWindow).toBe(204_800)
116+
expect(model.info.maxTokens).toBe(16_384)
117+
expect(model.info.supportsPromptCache).toBe(true)
118+
expect(model.info.inputPrice).toBe(0.6)
119+
expect(model.info.outputPrice).toBe(2.4)
120+
expect(model.info.cacheWritesPrice).toBe(0.375)
121+
expect(model.info.cacheReadsPrice).toBe(0.06)
122+
})
123+
90124
it("should return MiniMax-M2.5 model with correct configuration", () => {
91125
const testModelId: MinimaxModelId = "MiniMax-M2.5"
92126
const handlerWithModel = new MiniMaxHandler({
@@ -191,10 +225,23 @@ describe("MiniMaxHandler", () => {
191225
expect(model.info).toEqual(minimaxModels[minimaxDefaultModelId])
192226
})
193227

194-
it("should default to MiniMax-M2.5 model", () => {
228+
it("should default to MiniMax-M2.7 model", () => {
195229
const handlerDefault = new MiniMaxHandler({ minimaxApiKey: "test-minimax-api-key" })
196230
const model = handlerDefault.getModel()
197-
expect(model.id).toBe("MiniMax-M2.5")
231+
expect(model.id).toBe("MiniMax-M2.7")
232+
})
233+
234+
it("should have M2.7 as first model in the list", () => {
235+
const modelIds = Object.keys(minimaxModels)
236+
expect(modelIds[0]).toBe("MiniMax-M2.7")
237+
expect(modelIds[1]).toBe("MiniMax-M2.7-highspeed")
238+
})
239+
240+
it("should retain all previous models", () => {
241+
expect("MiniMax-M2.5" in minimaxModels).toBe(true)
242+
expect("MiniMax-M2" in minimaxModels).toBe(true)
243+
expect("MiniMax-M2-Stable" in minimaxModels).toBe(true)
244+
expect("MiniMax-M2.1" in minimaxModels).toBe(true)
198245
})
199246
})
200247

@@ -396,6 +443,30 @@ describe("MiniMaxHandler", () => {
396443
})
397444

398445
describe("Model Configuration", () => {
446+
it("should correctly configure MiniMax-M2.7 model properties", () => {
447+
const model = minimaxModels["MiniMax-M2.7"]
448+
expect(model.maxTokens).toBe(16_384)
449+
expect(model.contextWindow).toBe(204_800)
450+
expect(model.supportsImages).toBe(false)
451+
expect(model.supportsPromptCache).toBe(true)
452+
expect(model.inputPrice).toBe(0.3)
453+
expect(model.outputPrice).toBe(1.2)
454+
expect(model.cacheWritesPrice).toBe(0.375)
455+
expect(model.cacheReadsPrice).toBe(0.06)
456+
})
457+
458+
it("should correctly configure MiniMax-M2.7-highspeed model properties", () => {
459+
const model = minimaxModels["MiniMax-M2.7-highspeed"]
460+
expect(model.maxTokens).toBe(16_384)
461+
expect(model.contextWindow).toBe(204_800)
462+
expect(model.supportsImages).toBe(false)
463+
expect(model.supportsPromptCache).toBe(true)
464+
expect(model.inputPrice).toBe(0.6)
465+
expect(model.outputPrice).toBe(2.4)
466+
expect(model.cacheWritesPrice).toBe(0.375)
467+
expect(model.cacheReadsPrice).toBe(0.06)
468+
})
469+
399470
it("should correctly configure MiniMax-M2 model properties", () => {
400471
const model = minimaxModels["MiniMax-M2"]
401472
expect(model.maxTokens).toBe(16_384)

0 commit comments

Comments
 (0)