Files
config-center/__tests__/vendor-interface-boundaries.test.mjs
Yige 127bb62932 fix(compute): MiniMax M2.x 单次输出上限按官网更正为 204800,已下线型号写入 tombstones (#126)
MiniMax 官网 Messages API 参数参考(国内与国际站同页,OpenAI 兼容
max_completion_tokens 同值)写明:除 M3.1-Flash-Preview 与 M3 外的其他模型
max_tokens 推荐 65536、上限 204800,同页 model 枚举列出 M2.7、M2.5、M2.1、M2
及各 highspeed。本仓 maxOutputTokens 是单次输出上限,登记上限而非推荐值
(与 #125 的 M3 处理一致)。

- M2.7、M2.7-highspeed、M2.5、M2.5-highspeed、M2.1、M2.1-highspeed、M2 七个
  规格 maxOutputTokens 131072 → 204800;直连与 Token Plan 条目没有输出覆盖,
  随规格变化。上下文窗口 204800 复核一致。
- 官网模型列表把 MiniMax-M2.1、M2.1-highspeed、M2、M2-her 列为已下线:
  直连 provider-minimax-001 移除这 4 条并写入 tombstones(只删除本地
  source=preset 的同名条目),共享规格保留。
- M2-her 官方指南只给出 64 K 上下文(简写)、未给输出上限,且走 OpenAI 兼容
  接口、不在 /anthropic 支持型号内;规格原 204800 / 131072 无来源,改为未声明。
- 官网概览页通知 M2.5、M2.7 系列 2026-10-19 起停止向新用户开放、2026-11-18
  正式下线,M Plan/Token Plan 请求自 2026-10-19 起路由至 M3.1 Flash Preview;
  尚未到下线日,只在直连与 Token Plan 条目描述中写明。
- 来源记录新增 minimax-model-list、minimax-text-chat,刷新 minimax-models;
  规格决策清单补 M2.x verifiedLimits;presetDataVersion 133。

火山/腾讯/百度套餐中无本地数值的 minimax-m2.5/m2.7 在旧版匹配器下会继承
新上限,这些平台自身的上限未核。未做账号实测。
2026-10-18 18:39:08 +08:00

56 lines
3.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test } from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
const read = (path) => JSON.parse(readFileSync(new URL(`../${path}`, import.meta.url), 'utf8'))
test('Cohere compatibility provider excludes native rerank and tombstones old preset', () => {
const d = read('compute/providers/cohere.json')
assert.ok(d.tombstones.includes('rerank-v3.5'))
assert.equal(d.models.some((r) => r.serviceType.includes('rerank')), false)
assert.equal(read('compute/model-specs/cohere.json').specs.find((r) => r.id === 'rerank-v3.5').spec.contextWindow, 4096)
})
test('MiniMax SDK text-only M2 models cannot advertise image/video input', () => {
for (const path of ['compute/providers/minimax.json', 'compute/coding-plans/minimax-coding.json', 'compute/model-specs/minimax.json']) {
const d = read(path)
for (const row of d.models ?? d.specs) {
if (!/^MiniMax-M2(?:\.|$)/.test(row.modelName ?? row.id)) continue
const caps = (row.spec ?? row).capabilities
assert.equal(caps.some((v) => ['vision', 'image_understanding', 'video_understanding'].includes(v)), false)
}
}
assert.equal(read('compute/model-specs/minimax.json').specs.find((r) => r.id === 'MiniMax-M3').spec.contextWindow, 1000000)
})
test('MiniMax M2.x output limit follows the official max_tokens cap and retired models are tombstoned', () => {
// 官网 Messages API 参数参考:除 M3.1-Flash-Preview / M3 外的其他模型 max_tokens 上限 204800(2026-10-18)
const specs = read('compute/model-specs/minimax.json').specs
const m2 = ['MiniMax-M2.7', 'MiniMax-M2.7-highspeed', 'MiniMax-M2.5', 'MiniMax-M2.5-highspeed', 'MiniMax-M2.1', 'MiniMax-M2.1-highspeed', 'MiniMax-M2']
for (const id of m2) {
const spec = specs.find((r) => r.id === id).spec
assert.equal(spec.maxOutputTokens, 204800, id)
assert.equal(spec.contextWindow, 204800, id)
}
for (const path of ['compute/providers/minimax.json', 'compute/coding-plans/minimax-coding.json']) {
for (const row of read(path).models.filter((r) => m2.includes(r.modelName))) assert.equal(row.maxOutputTokens, 204800, `${path}#${row.modelName}`)
}
// 模型列表页标为已下线:直连移除并写入 tombstones,规格保留;M2-her 撤去与官网 64 K 窗口矛盾的数值
const retired = ['MiniMax-M2.1', 'MiniMax-M2.1-highspeed', 'MiniMax-M2', 'M2-her']
const direct = read('compute/providers/minimax.json')
for (const id of retired) {
assert.equal(direct.models.some((r) => r.modelName === id), false, id)
assert.ok(direct.tombstones.includes(id), id)
assert.ok(specs.some((r) => r.id === id), id)
}
const her = specs.find((r) => r.id === 'M2-her').spec
assert.equal(her.contextWindow, undefined)
assert.equal(her.maxOutputTokens, undefined)
})
test('North canonical IDs match official API IDs without broad alias inheritance', () => {
const rows = read('compute/model-specs/cohere.json').specs
assert.equal(rows.some((r) => r.id === 'north-mini-code'), false)
const mini = rows.find((r) => r.id === 'north-mini-code-1-0')
assert.deepEqual(mini.match.exact, ['north-mini-code-1-0', 'north-mini-code'])
assert.equal(mini.match.patterns, undefined)
assert.equal(mini.spec.supportsReasoning, undefined)
assert.deepEqual(rows.find((r) => r.id === 'north-small-translate-1-0').match.exact, ['north-small-translate-1-0'])
assert.equal(read('compute/providers/cohere.json').models.some((r) => r.modelName.startsWith('north-')), false)
})