mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
feat(ai): add MiniMax-M3.1-Flash and hide only old MiniMax models
Replace the direct minimax allowlist with a denylist of the older M2, M2.1, M2.5, and M2.5-highspeed models, applied where MiniMax models are built. MiniMax models with models.dev effort levels use adaptive thinking with output_config.effort and mark thinking off as unsupported, since MiniMax-M3.1-Flash rejects thinking.type=disabled. closes #11121
This commit is contained in:
parent
e28e708049
commit
d2e7d8b7c1
3 changed files with 13 additions and 14 deletions
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
- Added `AI_TELEMETRY_SCHEMA` and opt-in `pi.ai.request`/`pi.ai.poll` tracing around Models requests, with content-free first-event, block-size, and final usage attributes, plus duration, token, and USD cost metrics through `telemetry.metrics`.
|
||||
- Failed model request spans report `provider_error` status with up to 500 error-message characters; cancelled requests keep `ok` status with `stop: "aborted"`.
|
||||
- Added `MiniMax-M3.1-Flash` to the `minimax` and `minimax-cn` providers, with thinking levels low through max sent as `output_config.effort`. Thinking cannot be turned off for this model. New MiniMax models from models.dev now appear without a manual allowlist entry; only the older M2, M2.1, M2.5, and M2.5-highspeed models stay hidden ([#11121](https://github.com/earendil-works/pi/issues/11121))
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
|||
|
|
@ -2405,12 +2405,17 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
|||
{ key: "minimax", provider: "minimax", baseUrl: "https://api.minimax.io/anthropic" },
|
||||
{ key: "minimax-cn", provider: "minimax-cn", baseUrl: "https://api.minimaxi.com/anthropic" },
|
||||
] as const;
|
||||
// MiniMax asked to hide older models from its direct providers (#2596).
|
||||
const minimaxHiddenIds = new Set(["MiniMax-M2", "MiniMax-M2.1", "MiniMax-M2.5", "MiniMax-M2.5-highspeed"]);
|
||||
|
||||
for (const { key, provider, baseUrl } of minimaxVariants) {
|
||||
if (data[key]?.models) {
|
||||
for (const [modelId, model] of Object.entries(data[key].models)) {
|
||||
const m = model as ModelsDevModel;
|
||||
if (m.tool_call !== true) continue;
|
||||
if (m.tool_call !== true || minimaxHiddenIds.has(modelId)) continue;
|
||||
// Models with effort levels (e.g. MiniMax-M3.1-Flash) take adaptive thinking with
|
||||
// output_config.effort and reject thinking.type="disabled" (no "none" effort, so off is null).
|
||||
const thinkingLevelMap = getEffortThinkingLevelMap(m.reasoning_options ?? []);
|
||||
|
||||
models.push({
|
||||
id: modelId,
|
||||
|
|
@ -2424,8 +2429,8 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
|||
cost: getModelsDevCost(m.cost),
|
||||
contextWindow: m.limit?.context || 4096,
|
||||
maxTokens: m.limit?.output || 4096,
|
||||
...(thinkingLevelMap ? { thinkingLevelMap, compat: { forceAdaptiveThinking: true } } : {}),
|
||||
});
|
||||
recordModelsDevReasoningOptions(provider, modelId, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3137,18 +3142,6 @@ async function generateModels() {
|
|||
}
|
||||
}
|
||||
|
||||
const minimaxDirectSupportedIds = new Set(["MiniMax-M2.7", "MiniMax-M2.7-highspeed", "MiniMax-M3"]);
|
||||
|
||||
for (let i = allModels.length - 1; i >= 0; i--) {
|
||||
const candidate = allModels[i];
|
||||
if (
|
||||
(candidate.provider === "minimax" || candidate.provider === "minimax-cn") &&
|
||||
!minimaxDirectSupportedIds.has(candidate.id)
|
||||
) {
|
||||
allModels.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// OpenAI Codex (ChatGPT OAuth) models
|
||||
// NOTE: These are not fetched from models.dev; we keep a small, explicit list to avoid aliases.
|
||||
// Older model limits are based on observed server behavior; GPT-5.6 and GPT-6 use Codex's 272k default catalog limit.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ const EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS = [
|
|||
"fireworks/accounts/fireworks/models/deepseek-v4p1-flash",
|
||||
"fireworks/accounts/fireworks/models/gpt-oss-120b",
|
||||
"fireworks/accounts/fireworks/models/qwen3p8-max",
|
||||
"minimax-cn/MiniMax-M3.1-Flash",
|
||||
"minimax/MiniMax-M3.1-Flash",
|
||||
"opencode/claude-opus-4-8",
|
||||
"opencode/claude-opus-5",
|
||||
"vercel-ai-gateway/anthropic/claude-opus-4.8",
|
||||
|
|
@ -38,6 +40,9 @@ describe("Anthropic adaptive thinking model metadata", () => {
|
|||
// Regression for #9323: Fireworks uses catalog effort metadata and
|
||||
// verified fallbacks, not a fixed set of adaptive model names.
|
||||
modelId.startsWith("fireworks/") ||
|
||||
// #11121: MiniMax models with catalog effort levels require adaptive thinking.
|
||||
modelId.startsWith("minimax/") ||
|
||||
modelId.startsWith("minimax-cn/") ||
|
||||
/(opus[-.](4[-.][678]|5)|sonnet[-.]4[-.]6|sonnet[-.]5|haiku[-.]5[-.]5|fable[-.]5)/.test(modelId),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue