Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(minimax): add MiniMax M3.1 Flash (#21216)

SaladDay91db0483fac1
diff --git a/packages/model-bank/src/aiModels/minimax.ts b/packages/model-bank/src/aiModels/minimax.ts
index b0b105a3eef..66f43aade9c 100644
--- a/packages/model-bank/src/aiModels/minimax.ts
+++ b/packages/model-bank/src/aiModels/minimax.ts
@@ -5,6 +5,37 @@ import {
} from '../types/aiModel';
const minimaxChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ video: true,
+ vision: true,
+ },
+ contextWindowTokens: 1_000_000,
+ description:
+ 'MiniMax M3.1 Flash is a fast, low-cost multimodal model with native image and video understanding and tunable thinking depth.',
+ displayName: 'MiniMax M3.1 Flash',
+ enabled: true,
+ family: 'minimax',
+ generation: 'minimax-m3.1',
+ id: 'MiniMax-M3.1-Flash',
+ maxOutput: 524_288,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-10-19',
+ settings: {
+ disabledParams: ['temperature'],
+ extendParams: ['gpt6ReasoningEffort'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -55,6 +86,7 @@ const minimaxChatModels: AIChatModelCard[] = [
},
releasedAt: '2026-06-01',
settings: {
+ disabledParams: ['temperature'],
extendParams: ['enableReasoning'],
},
type: 'chat',
diff --git a/packages/model-runtime/src/providers/minimax/index.test.ts b/packages/model-runtime/src/providers/minimax/index.test.ts
index f3a4a11175a..24089bc2230 100644
--- a/packages/model-runtime/src/providers/minimax/index.test.ts
+++ b/packages/model-runtime/src/providers/minimax/index.test.ts
@@ -420,7 +420,7 @@ describe('LobeMinimaxAI - handlePayload', () => {
expect(result.max_tokens).toBeUndefined();
expect(result.reasoning_split).toBe(true);
expect(result.preserveThinking).toBeUndefined();
- expect(result.temperature).toBe(0);
+ expect(result.temperature).toBeUndefined();
expect(result.thinking).toEqual({ type: 'adaptive' });
expect(result.top_p).toBe(1);
});
@@ -435,6 +435,22 @@ describe('LobeMinimaxAI - handlePayload', () => {
expect(result.thinking).toEqual({ type: 'disabled' });
});
+ it('sends reasoning_effort and never disabled thinking or temperature for MiniMax-M3.1-Flash', () => {
+ const result = handlePayload({
+ max_tokens: 4096,
+ messages: [{ content: 'hi', role: 'user' }],
+ model: 'MiniMax-M3.1-Flash',
+ reasoning_effort: 'max',
+ temperature: 1,
+ thinking: { budget_tokens: 0, type: 'disabled' },
+ } as any);
+
+ expect(result.max_completion_tokens).toBe(4096);
+ expect(result.reasoning_effort).toBe('max');
+ expect(result.temperature).toBeUndefined();
+ expect(result.thinking).toBeUndefined();
+ });
+
it('passes through MiniMax-M3 multimodal user content', () => {
const content = [
{ text: 'describe this media', type: 'text' },
@@ -512,10 +528,27 @@ describe('LobeMinimaxAnthropicAI - handlePayload', () => {
{} as any,
);
- expect(result.temperature).toBe(0.8);
+ expect(result.temperature).toBeUndefined();
expect(result.top_p).toBe(0.9);
});
+ it('maps reasoning_effort to output_config.effort for MiniMax-M3.1-Flash', async () => {
+ const result = await handleAnthropicPayload(
+ {
+ max_tokens: 4096,
+ messages: [{ content: 'hi', role: 'user' }],
+ model: 'MiniMax-M3.1-Flash',
+ reasoning_effort: 'xhigh',
+ temperature: 1,
+ } as any,
+ {} as any,
+ );
+
+ expect((result as any).output_config).toEqual({ effort: 'xhigh' });
+ expect(result.temperature).toBeUndefined();
+ expect(result.thinking).toBeUndefined();
+ });
+
it('converts assistant reasoning history to Anthropic thinking blocks', async () => {
const result = await handleAnthropicPayload(
{
diff --git a/packages/model-runtime/src/providers/minimax/index.ts b/packages/model-runtime/src/providers/minimax/index.ts
index 785bfaec02a..1228a0f7d77 100644
--- a/packages/model-runtime/src/providers/minimax/index.ts
+++ b/packages/model-runtime/src/providers/minimax/index.ts
@@ -25,6 +25,8 @@ const MINIMAX_ANTHROPIC_MODEL_BASE_URL_PATTERN = /\/anthropic(?:\/v1\/messages)?
const MINIMAX_ANTHROPIC_MESSAGES_PATH_PATTERN = /\/v1\/messages\/?$/;
const isMiniMaxM3Model = (model: string) => model.toLowerCase() === 'minimax-m3';
+// M3.1 Flash always thinks: it rejects disabled thinking and takes `reasoning_effort` instead.
+const isMiniMaxM3FlashModel = (model: string) => model.toLowerCase() === 'minimax-m3.1-flash';
type MiniMaxSDKType = 'anthropic' | 'openai';
@@ -137,8 +139,12 @@ export const buildMiniMaxAnthropicPayload = async (
)) ??
64_000;
+ const isFlash = isMiniMaxM3FlashModel(payload.model);
const basePayload = await buildDefaultAnthropicPayload({
...payload,
+ ...(isFlash && payload.reasoning_effort
+ ? { effort: payload.reasoning_effort as ChatStreamPayload['effort'] }
+ : {}),
enabledSearch: false,
max_tokens: resolvedMaxTokens,
messages: normalizeMessagesForAnthropic(payload.messages),
@@ -154,8 +160,11 @@ export const buildMiniMaxAnthropicPayload = async (
topPRange: { max: 1, min: 0.01 },
},
);
+ // Open-weight M3 models do not support temperature
const finalTemperature =
- resolvedParams.temperature !== undefined && resolvedParams.temperature <= 0
+ isFlash ||
+ isMiniMaxM3Model(payload.model) ||
+ (resolvedParams.temperature !== undefined && resolvedParams.temperature <= 0)
? undefined
: resolvedParams.temperature;
@@ -177,7 +186,8 @@ export const buildMiniMaxOpenAIPayload = (payload: ChatStreamPayload) => {
...params
} = payload;
- const isM3 = isMiniMaxM3Model(payload.model);
+ const isFlash = isMiniMaxM3FlashModel(payload.model);
+ const isM3 = isMiniMaxM3Model(payload.model) || isFlash;
// Interleaved thinking
const processedMessages = messages.map((message: any) => {
@@ -236,21 +246,23 @@ export const buildMiniMaxOpenAIPayload = (payload: ChatStreamPayload) => {
},
);
- // Minimax doesn't support temperature <= 0
+ // Minimax doesn't support temperature <= 0; open-weight M3 models do not support temperature
const finalTemperature =
- !isM3 && resolvedParams.temperature !== undefined && resolvedParams.temperature <= 0
+ isM3 || (resolvedParams.temperature !== undefined && resolvedParams.temperature <= 0)
? undefined
: resolvedParams.temperature;
- const finalThinking = isM3
- ? thinking?.type === 'disabled'
- ? { thinking: { type: 'disabled' } }
- : thinking?.type === 'enabled' || thinking?.type === 'adaptive'
- ? { thinking: { type: 'adaptive' } }
- : {}
- : thinking
- ? { thinking }
- : {};
+ const finalThinking = isFlash
+ ? {}
+ : isM3
+ ? thinking?.type === 'disabled'
+ ? { thinking: { type: 'disabled' } }
+ : thinking?.type === 'enabled' || thinking?.type === 'adaptive'
+ ? { thinking: { type: 'adaptive' } }
+ : {}
+ : thinking
+ ? { thinking }
+ : {};
const outputLimitParam = isM3
? { max_completion_tokens: resolvedParams.max_tokens }