mirror of
https://git.openapi.site/https://github.com/desirecore/config-center.git
synced 2026-12-05 13:40:29 +08:00
feat(compute): 新增 7 款模型并更新预设数据至 v134 (#127)
新增 7 个精确模型规格与对应原厂、订阅和聚合接入,保留独立参数与计价合同;MiniMax 套餐预置改用正式版,预设数据版本更新为 134。
This commit is contained in:
104 files changed
+8148
-363
No files matched your search
@@ -126,7 +126,7 @@ test('implemented Responses format handles explicit override and mandatory Respo
|
||||
const direct={...model,request:{apiFormatOverride:'openai-responses'}};assert.equal(resolveEffectiveModel(spec,direct,options).eligibleForCall,true);
|
||||
const only={...model,request:{responsesOnly:true}};const result=resolveEffectiveModel(spec,only,options);assert.equal(result.apiFormat,'openai-responses');assert.equal(result.request.apiFormatOverride,'openai-responses');assert.equal(result.eligibleForCall,true);
|
||||
assert.ok(resolveEffectiveModel(spec,{...model,request:{apiFormatOverride:'unimplemented-native-api'}},options).blockedReasons.includes('unknown-adapter'));
|
||||
const listed=catalog.accesses.flatMap(a=>a.models).filter(m=>m.request.responsesOnly);assert.equal(listed.length,3);for(const m of listed)assert.equal(m.metadata.recordedExtra.responsesOnly,undefined);
|
||||
const listed=catalog.accesses.flatMap(a=>a.models).filter(m=>m.request.responsesOnly);assert.equal(listed.length,4);for(const m of listed)assert.equal(m.metadata.recordedExtra.responsesOnly,undefined);
|
||||
});
|
||||
|
||||
test('root V1 is generated from canonical, rejects manual drift and never rewrites indexes or unrelated files',()=>{
|
||||
|
||||
@@ -4,6 +4,7 @@ import { readFileSync, readdirSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join } from 'node:path'
|
||||
import { parseSourcePage } from '../scripts/validate-sources.mjs'
|
||||
import { resolveEffectiveModel } from '../scripts/catalog-v2/effective-model.mjs'
|
||||
|
||||
const root = fileURLToPath(new URL('../', import.meta.url))
|
||||
const read = path => JSON.parse(readFileSync(join(root, path), 'utf8'))
|
||||
@@ -45,3 +46,133 @@ test('JavaScript shell pages cannot silently become verified Volcengine paramete
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const catalog = read('catalog/v2/catalog.json')
|
||||
const access = (file, id) => catalog.accesses.find(item => item.metadata.sourceFile === file).models.find(item => item.apiModelId === id)
|
||||
const effective = (file, id) => {
|
||||
const connection = catalog.accesses.find(item => item.metadata.sourceFile === file).connection
|
||||
const model = access(file, id)
|
||||
const spec = catalog.specs.find(item => item.modelRef === model.modelRef)
|
||||
return resolveEffectiveModel(spec, model, {
|
||||
publicationState: 'published', requiredClientVersion: '0.0.0', clientVersion: '999.0.0',
|
||||
now: '2026-10-28T00:00:00Z', connection,
|
||||
})
|
||||
}
|
||||
test('October additions are exact identities and do not enlarge default automatic routing', () => {
|
||||
const additions = ['gpt-6.1-terra', 'claude-haiku-5-5', 'MiniMax-M3.1-Flash', 'kimi-k3.1-pro', 'kimi-k3.1-pro-highspeed', 'gemini-4-argon', 'mistral-large-4']
|
||||
for (const id of additions) {
|
||||
const specs = catalog.specs.filter(item => item.identity.canonicalModelId === id)
|
||||
assert.equal(specs.length, 1, id)
|
||||
assert.equal(specs[0].routing.eligibleForAgent, false, id)
|
||||
assert.equal(specs[0].routing.defaultReference, false, id)
|
||||
assert.equal(specs[0].metadata.legacyIdentity.match.patterns, undefined, id)
|
||||
for (const endpoint of catalog.accesses) for (const model of endpoint.models.filter(item => item.modelRef === specs[0].modelRef)) {
|
||||
assert.equal(model.binding.kind, 'exact', model.apiModelId)
|
||||
const result = effective(endpoint.metadata.sourceFile, model.apiModelId)
|
||||
assert.equal(result.eligibleForCall, true, `${endpoint.id}:${model.apiModelId}`)
|
||||
assert.equal(result.eligibleForAutoRouting, false, model.apiModelId)
|
||||
assert.deepEqual(result.pendingOverrides, [], model.apiModelId)
|
||||
}
|
||||
}
|
||||
assert.equal(catalog.publication.state, 'candidate')
|
||||
assert.equal(catalog.publication.requiredClientVersion, null)
|
||||
})
|
||||
test('Terra native tools use Responses, independent input limit and subscription billing remain separate', () => {
|
||||
const result = effective('compute/providers/openai.json', 'gpt-6.1-terra')
|
||||
assert.equal(result.apiFormat, 'openai-responses')
|
||||
assert.equal(result.facts.contextWindow, 1050000)
|
||||
assert.equal(result.facts.maxInputTokens, 922000)
|
||||
assert.equal(result.facts.maxOutputTokens, 128000)
|
||||
assert.ok(result.request.reasoning.supportedEfforts.includes('none'))
|
||||
const api = read('compute/providers/openai.json').models.find(item => item.modelName === 'gpt-6.1-terra')
|
||||
assert.deepEqual([api.inputPrice, api.outputPrice, api.extra.cachedInputPrice], [1, 5, 0.05])
|
||||
const subscription = effective('compute/providers/openai-codex.json', 'gpt-6.1-terra')
|
||||
assert.equal(subscription.apiFormat, 'openai-codex-responses')
|
||||
assert.deepEqual(subscription.billing, [])
|
||||
assert.equal(subscription.request.reasoning.supportedEfforts.includes('none'), false)
|
||||
})
|
||||
test('Haiku tier and cache prices cannot collapse to its headline minimum or Batch output limit', () => {
|
||||
const model = read('compute/providers/anthropic.json').models.find(item => item.modelName === 'claude-haiku-5-5')
|
||||
assert.equal(model.maxOutputTokens, 128000)
|
||||
assert.deepEqual(model.extra.pricingTiers, [
|
||||
{ maxInputTokens: 100000, inputPrice: 0.1, outputPrice: 0.5, cacheReadPrice: 0.01 },
|
||||
{ maxInputTokens: 1000000, inputPrice: 0.5, outputPrice: 2.5, cacheReadPrice: 0.05 },
|
||||
])
|
||||
for (const file of ['compute/providers/anthropic.json', 'compute/providers/anthropic-claude.json']) {
|
||||
const result = effective(file, 'claude-haiku-5-5')
|
||||
assert.equal(result.request.adaptiveThinking, true)
|
||||
assert.equal(result.request.reasoning.defaultEffort, 'medium')
|
||||
assert.deepEqual(result.request.reasoning.supportedEfforts, ['low', 'medium', 'high', 'xhigh', 'max'])
|
||||
assert.equal(result.facts.constraints.samplingParametersDeprecated, true)
|
||||
assert.equal(result.facts.constraints.forcedToolChoiceUnsupported, undefined)
|
||||
assert.equal(result.request.thinkingRoundTrip.protocol, 'anthropic-messages')
|
||||
assert.equal(result.request.thinkingRoundTrip.enabled, true)
|
||||
assert.equal(result.request.thinkingToolTurnValidation, 'accepts-thinkless')
|
||||
}
|
||||
assert.equal(effective('compute/providers/openrouter.json', 'anthropic/claude-haiku-5.5').request.adaptiveThinking, undefined)
|
||||
})
|
||||
test('MiniMax GA replaces the retired preview without mixing the native and hosted window or prices', () => {
|
||||
const plan = read('compute/coding-plans/minimax-coding.json')
|
||||
assert.equal(plan.models.some(item => item.modelName === 'MiniMax-M3.1-Flash-Preview'), false)
|
||||
assert.ok(plan.tombstones.includes('MiniMax-M3.1-Flash-Preview'))
|
||||
assert.equal(catalog.specs.find(item => item.modelRef === 'minimax:MiniMax-M3.1-Flash-Preview').lifecycle.status, 'historical')
|
||||
for (const file of ['compute/providers/minimax.json', 'compute/coding-plans/minimax-coding.json']) {
|
||||
const result = effective(file, 'MiniMax-M3.1-Flash')
|
||||
assert.equal(result.facts.contextWindow, 1000000)
|
||||
assert.equal(result.facts.maxOutputTokens, 524288)
|
||||
assert.equal(result.facts.constraints.thinkingOnly, true)
|
||||
assert.equal(result.request.adaptiveThinking, true)
|
||||
assert.equal(result.request.reasoning.defaultEffort, 'max')
|
||||
}
|
||||
const native = read('compute/providers/minimax.json').models.find(item => item.modelName === 'MiniMax-M3.1-Flash')
|
||||
const hosted = read('compute/providers/openrouter.json').models.find(item => item.modelName === 'minimax/minimax-m3.1-flash')
|
||||
assert.deepEqual([native.inputPrice, native.outputPrice, native.extra.cacheReadPrice], [1, 4, 0.1])
|
||||
assert.deepEqual([hosted.inputPrice, hosted.outputPrice, hosted.extra.cachedInputPrice], [0.15, 0.6, 0.015])
|
||||
assert.equal(effective('compute/providers/openrouter.json', hosted.modelName).facts.contextWindow, 1048576)
|
||||
assert.equal(effective('compute/providers/openrouter.json', hosted.modelName).request.adaptiveThinking, undefined)
|
||||
})
|
||||
test('Kimi API and Code retain distinct request IDs, defaults, tier caps and unknown subscription output', () => {
|
||||
for (const [apiId, codeId, window, input, output] of [
|
||||
['kimi-k3.1-pro', 'k3.1-pro', 262144, 13, 68],
|
||||
['kimi-k3.1-pro-highspeed', 'k3.1-pro-highspeed', 1048576, 26, 136],
|
||||
]) {
|
||||
const api = effective('compute/providers/moonshot.json', apiId)
|
||||
const code = effective('compute/coding-plans/moonshot-coding.json', codeId)
|
||||
assert.equal(api.request.reasoning.defaultEffort, 'max')
|
||||
assert.equal(api.facts.maxOutputTokens, 1048576)
|
||||
assert.equal(code.request.reasoning.defaultEffort, 'high')
|
||||
assert.equal(code.apiModelId, codeId)
|
||||
assert.equal(code.facts.contextWindow, window)
|
||||
assert.equal(code.facts.maxOutputTokens, null)
|
||||
assert.deepEqual(code.billing, [])
|
||||
assert.equal(code.facts.constraints.thinkingOnly, true)
|
||||
const legacy = read('compute/coding-plans/moonshot-coding.json').models.find(item => item.modelName === codeId)
|
||||
assert.equal(legacy.maxOutputTokens, undefined)
|
||||
const row = read('compute/providers/moonshot.json').models.find(item => item.modelName === apiId)
|
||||
assert.deepEqual([row.inputPrice, row.outputPrice, row.extra.cacheHitPrice], [input, output, 1.3])
|
||||
assert.equal(api.request.thinking.preserveReasoningContent, true)
|
||||
}
|
||||
})
|
||||
test('Gemini synchronous access cannot claim long decode while the hosted output contract remains independent', () => {
|
||||
const native = effective('compute/providers/google.json', 'gemini-4-argon')
|
||||
assert.equal(native.apiFormat, 'google-generative-ai')
|
||||
assert.equal(native.facts.contextWindow, 1048576)
|
||||
assert.equal(native.facts.maxOutputTokens, 32768)
|
||||
assert.equal(native.request.reasoning.defaultEffort, 'medium')
|
||||
const hosted = effective('compute/providers/openrouter.json', 'google/gemini-4-argon')
|
||||
assert.equal(hosted.facts.maxOutputTokens, 943718)
|
||||
assert.deepEqual(hosted.pendingOverrides, [])
|
||||
assert.equal(catalog.specs.find(item => item.modelRef === 'google:gemini-4-argon').facts.maxOutputTokens, 65536)
|
||||
const row = read('compute/providers/google.json').models.find(item => item.modelName === 'gemini-4-argon')
|
||||
assert.match(row.extra.pricingNotes, /2026-11-30/)
|
||||
assert.match(row.extra.pricingNotes, /2026-12-01/)
|
||||
})
|
||||
test('Mistral original unknown budgets stay unknown rather than inheriting the gateway limits', () => {
|
||||
const native = effective('compute/providers/mistral.json', 'mistral-large-4')
|
||||
assert.equal(native.facts.contextWindow, undefined)
|
||||
assert.equal(native.facts.maxOutputTokens, undefined)
|
||||
assert.deepEqual(native.request.reasoning.supportedEfforts, ['none'])
|
||||
const hosted = effective('compute/providers/openrouter.json', 'mistralai/mistral-large-4-0')
|
||||
assert.equal(hosted.facts.contextWindow, 1048576)
|
||||
assert.equal(hosted.facts.maxOutputTokens, 262144)
|
||||
})
|
||||
@@ -58,6 +58,15 @@ test('拒绝第三方、社区、伪官方仓库和带凭据的来源 URL', () =
|
||||
assert.ok(sourceUrlError('openai', 'https://developers.openai.com/docs?api_key=secret'))
|
||||
})
|
||||
|
||||
test('订阅专属模型文档只接受对应供应商的精确官网域名', () => {
|
||||
assert.equal(sourceUrlError('moonshot', 'https://www.kimi.com/code/docs/en/kimi-code/models'), null)
|
||||
assert.equal(sourceUrlError('anthropic', 'https://code.claude.com/docs/en/model-config.md'), null)
|
||||
assert.ok(sourceUrlError('moonshot', 'https://www.kimi.com.example.org/code/docs/en/'))
|
||||
assert.ok(sourceUrlError('anthropic', 'https://code.claude.com.example.org/docs/en/'))
|
||||
assert.ok(sourceUrlError('openai', 'https://code.claude.com/docs/en/model-config.md'))
|
||||
assert.ok(sourceUrlError('anthropic', 'https://www.kimi.com/code/docs/en/'))
|
||||
})
|
||||
|
||||
test('端点变化也必须复核来源,即使模型参数完全未变', () => fixture(({ root, provider, dataPath }) => {
|
||||
assert.equal(validateSources(root).errors.length, 0)
|
||||
provider.baseUrl = 'https://api.openai.com/v1'
|
||||
|
||||
@@ -105,7 +105,7 @@ describe('真实数据全量校验', () => {
|
||||
if (spec.routing) routed.push(spec)
|
||||
}
|
||||
}
|
||||
assert.equal(routed.length, 60)
|
||||
assert.equal(routed.length, 67)
|
||||
assert.equal(routed.every((spec) => spec.routing.reasoning.supportedModes.includes(spec.routing.reasoning.defaultMode)), true)
|
||||
assert.equal(routed.every((spec) => Array.isArray(spec.spec.capabilities)), true)
|
||||
})
|
||||
@@ -798,7 +798,7 @@ describe('真实数据全量校验', () => {
|
||||
// docs.z.ai/devpack/latest-model)写明 /api/anthropic 以 thinking.type 与 output_config.effort 控制强度,
|
||||
// thinking.type=enabled 一律按默认 max 处理,budget_tokens 不是控制项;不声明 adaptive,客户端发出的
|
||||
// 档位在上游全部变成 max,且 max 档无法发出(desirecore 档位协商回退到 max 后在本机拒绝)。
|
||||
const adaptiveGeneration = /^claude-(?:fable|mythos)(?:$|-)|^claude-(?:opus|sonnet)-(?:[5-9]|[1-9]\d)(?:$|-)|^claude-opus-4-[78](?:$|-)|^minimax-m3-1-flash-preview$|^glm-5-3(?:-flashx?)?$/
|
||||
const adaptiveGeneration = /^claude-(?:fable|mythos)(?:$|-)|^claude-(?:opus|sonnet)-(?:[5-9]|[1-9]\d)(?:$|-)|^claude-haiku-5-5(?:$|-)|^claude-opus-4-[78](?:$|-)|^minimax-m3-1-flash(?:-preview)?$|^glm-5-3(?:-flashx?)?$/
|
||||
const thinkingOnlyGeneration = /^claude-(?:fable|mythos)(?:$|-)|^claude-opus-5-5(?:$|-)/
|
||||
// 与客户端匹配器同口径:小写、去 vendor 前缀、统一分隔符
|
||||
const normalizeId = (id) => id.toLowerCase().trim().split('/').at(-1).replace(/[._:\s]+/g, '-')
|
||||
@@ -808,7 +808,7 @@ describe('真实数据全量校验', () => {
|
||||
|
||||
it('规格按代际声明 adaptiveThinking,并标记始终开启思考的模型', () => {
|
||||
const adaptiveSpecIds = allSpecs.map((item) => item.id).filter((id) => adaptiveGeneration.test(normalizeId(id)))
|
||||
for (const id of ['claude-fable-5-1', 'claude-opus-5-5', 'claude-opus-5', 'claude-opus-4-8', 'claude-opus-4-7', 'claude-sonnet-5']) {
|
||||
for (const id of ['claude-fable-5-1', 'claude-opus-5-5', 'claude-opus-5', 'claude-opus-4-8', 'claude-opus-4-7', 'claude-sonnet-5', 'claude-haiku-5-5', 'MiniMax-M3.1-Flash']) {
|
||||
assert.ok(adaptiveSpecIds.includes(id), `model-specs 缺少 ${id}`)
|
||||
}
|
||||
for (const modelSpec of allSpecs) {
|
||||
@@ -945,9 +945,11 @@ describe('真实数据全量校验', () => {
|
||||
assert.equal(kimi.outputPrice, 100)
|
||||
assert.equal(kimi.extra.cacheHitPrice, 2)
|
||||
const previewId = 'MiniMax-M3.1-Flash-Preview'
|
||||
const preview = findModel('coding-plans', 'minimax-coding', previewId)
|
||||
assert.equal(preview.extra.thinkingOnly, true)
|
||||
assert.equal(preview.extra.reasoning.defaultEffort, 'max')
|
||||
const formal = findModel('coding-plans', 'minimax-coding', 'MiniMax-M3.1-Flash')
|
||||
assert.equal(formal.extra.thinkingOnly, true)
|
||||
assert.equal(formal.extra.reasoning.defaultEffort, 'max')
|
||||
assert.equal(read('coding-plans', 'minimax-coding').models.some((item) => item.modelName === previewId), false)
|
||||
assert.ok(read('coding-plans', 'minimax-coding').tombstones.includes(previewId))
|
||||
assert.equal(read('providers', 'minimax').models.some((item) => item.modelName === previewId), false)
|
||||
const embed = findModel('providers', 'cohere', 'embed-v5.0-pro')
|
||||
assert.equal(embed.extra.dimensions, undefined, '当前兼容 API 不支持 dimensions 参数')
|
||||
|
||||
Reference in new issue
Block a user