diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 0ee66ae..fa6a0cd 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -105,7 +105,7 @@ describe('真实数据全量校验', () => { if (spec.routing) routed.push(spec) } } - assert.equal(routed.length, 43) + assert.equal(routed.length, 46) 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) }) @@ -234,6 +234,37 @@ describe('真实数据全量校验', () => { } }) + it('DeepSeek V4 Flash Vision Exp 应提供独立的视觉规格', () => { + const provider = JSON.parse(readFileSync(join(ROOT, 'compute', 'providers', 'deepseek.json'), 'utf8')) + const specFile = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'deepseek.json'), 'utf8')) + const modelId = 'deepseek-v4-flash-vision-exp' + const model = provider.models.find((item) => item.modelName === modelId) + + assert.ok(provider.services.includes('vision')) + assert.ok(model, `provider 缺少 ${modelId}`) + assert.equal(model.contextWindow, 1000000) + assert.equal(model.maxOutputTokens, 384000) + assert.ok(model.capabilities.includes('vision')) + assert.ok(model.serviceType.includes('vision')) + assert.equal(model.extra.supportsThinking, true) + assert.equal(model.extra.thinkingDefault, true) + + const specs = specFile.specs.filter((item) => item.id === modelId) + assert.equal(specs.length, 1, `model-specs 中 ${modelId} 应且仅应有一条规格`) + assert.deepEqual(specs[0].match.exact, [modelId]) + assert.equal('patterns' in specs[0].match, false) + assert.equal(specs[0].family, modelId) + assert.equal(specs[0].spec.contextWindow, 1000000) + assert.equal(specs[0].spec.maxOutputTokens, 384000) + assert.equal(specs[0].spec.supportsReasoning, true) + assert.ok(specs[0].spec.capabilities.includes('vision')) + assert.ok(specs[0].spec.serviceType.includes('vision')) + + const flash = specFile.specs.find((item) => item.id === 'deepseek-v4-flash') + assert.deepEqual(flash.match.exact, ['deepseek-v4-flash']) + assert.equal('patterns' in flash.match, false) + }) + it('MiMo V2.5 ASR 应有独立精确规格,避免回落到 MiMo V2.5 family', () => { const specFile = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'xiaomi.json'), 'utf8')) const specs = specFile.specs.filter((item) => item.id === 'mimo-v2.5-asr') @@ -324,6 +355,29 @@ describe('真实数据全量校验', () => { assert.ok(specs[0].spec.capabilities.includes('vision')) }) + it('Qwen3.8 Flash 应提供完整的多模态推理规格', () => { + const specFile = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'qwen.json'), 'utf8')) + const modelId = 'qwen3.8-flash' + const specs = specFile.specs.filter((item) => item.id === modelId) + + assert.equal(specs.length, 1, `model-specs 中 ${modelId} 应且仅应有一条规格`) + const modelSpec = specs[0] + assert.deepEqual(modelSpec.match.exact, [modelId]) + assert.equal('patterns' in modelSpec.match, false) + assert.equal(modelSpec.family, modelId) + assert.equal(modelSpec.spec.contextWindow, 1000000) + assert.equal(modelSpec.spec.maxOutputTokens, 131072) + assert.equal(modelSpec.spec.supportsReasoning, true) + assert.equal(modelSpec.spec.releasedAt, '2026-08-26') + assert.ok(modelSpec.spec.capabilities.includes('vision')) + assert.ok(modelSpec.spec.capabilities.includes('video_understanding')) + assert.ok(modelSpec.spec.capabilities.includes('fast')) + assert.deepEqual(modelSpec.spec.serviceType, ['chat', 'reasoning', 'vision']) + assert.equal(modelSpec.spec.extra.thinkingMaxTokens, 262144) + assert.equal(modelSpec.routing.tier, 'lightweight') + assert.equal(modelSpec.routing.reasoning.defaultMode, 'xhigh') + }) + it('基础模型与后缀版本应使用独立精确规格,避免互相误匹配', () => { const qwen = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'qwen.json'), 'utf8')) const deepseek = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'deepseek.json'), 'utf8')) @@ -333,12 +387,16 @@ describe('真实数据全量校验', () => { const qwenPreview = specFor(qwen, 'qwen3.8-max-preview') const deepseekBase = specFor(deepseek, 'deepseek-v4-pro') const deepseek0813 = specFor(deepseek, 'deepseek-v4-pro-0813') + const deepseekFlash = specFor(deepseek, 'deepseek-v4-flash') + const deepseekFlash0731 = specFor(deepseek, 'deepseek-v4-flash-0731') for (const [id, modelSpec] of [ ['qwen3.8-max', qwenBase], ['qwen3.8-max-preview', qwenPreview], ['deepseek-v4-pro', deepseekBase], ['deepseek-v4-pro-0813', deepseek0813], + ['deepseek-v4-flash', deepseekFlash], + ['deepseek-v4-flash-0731', deepseekFlash0731], ]) { assert.ok(modelSpec, `model-specs 缺少 ${id}`) assert.deepEqual(modelSpec.match.exact, [id]) @@ -347,10 +405,14 @@ describe('真实数据全量校验', () => { assert.equal('patterns' in deepseekBase.match, false) assert.equal('patterns' in deepseek0813.match, false) + assert.equal('patterns' in deepseekFlash.match, false) + assert.equal('patterns' in deepseekFlash0731.match, false) assert.equal(qwenBase.spec.contextWindow, qwenPreview.spec.contextWindow) assert.equal(qwenBase.spec.maxOutputTokens, qwenPreview.spec.maxOutputTokens) assert.equal(deepseekBase.spec.contextWindow, deepseek0813.spec.contextWindow) assert.equal(deepseekBase.spec.maxOutputTokens, deepseek0813.spec.maxOutputTokens) + assert.equal(deepseekFlash.spec.contextWindow, deepseekFlash0731.spec.contextWindow) + assert.equal(deepseekFlash.spec.maxOutputTokens, deepseekFlash0731.spec.maxOutputTokens) }) it('所有 Provider 应按供应商归属计价,模型来源不覆盖供应商币种', () => { diff --git a/compute/model-specs/deepseek.json b/compute/model-specs/deepseek.json index 5c289d7..c0a317b 100644 --- a/compute/model-specs/deepseek.json +++ b/compute/model-specs/deepseek.json @@ -162,13 +162,10 @@ { "id": "deepseek-v4-flash", "displayName": "DeepSeek V4 Flash", - "family": "deepseek-v4", + "family": "deepseek-v4-flash", "match": { "exact": [ "deepseek-v4-flash" - ], - "patterns": [ - "deepseek-v4-flash*" ] }, "spec": { @@ -211,6 +208,111 @@ "defaultMode": "high" } } + }, + { + "id": "deepseek-v4-flash-0731", + "displayName": "DeepSeek V4 Flash 0731", + "family": "deepseek-v4-flash-0731", + "match": { + "exact": [ + "deepseek-v4-flash-0731" + ] + }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "multilingual", + "tool_use" + ], + "serviceType": [ + "chat", + "reasoning" + ], + "defaultTemperature": 1, + "supportsReasoning": true, + "extra": { + "supportsThinking": true, + "thinkingDefault": true, + "reasoningEffort": [ + "high", + "max" + ] + }, + "description": "DeepSeek V4 Flash 0731 固定版本,100 万上下文" + }, + "routing": { + "tier": "lightweight", + "routingPriority": 35, + "eligibleForAgent": true, + "defaultReference": false, + "reasoning": { + "supportedModes": [ + "auto", + "high", + "max" + ], + "defaultMode": "high" + } + } + }, + { + "id": "deepseek-v4-flash-vision-exp", + "displayName": "DeepSeek V4 Flash Vision Exp", + "family": "deepseek-v4-flash-vision-exp", + "match": { + "exact": [ + "deepseek-v4-flash-vision-exp" + ] + }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "vision", + "multilingual", + "tool_use" + ], + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "defaultTemperature": 1, + "supportsReasoning": true, + "releasedAt": "2026-08-21", + "extra": { + "supportsThinking": true, + "thinkingDefault": true, + "reasoningEffort": [ + "high", + "max" + ] + }, + "description": "DeepSeek V4 Flash 实验性视觉版本,支持文本与图像输入,文本能力与 V4 Flash 一致" + }, + "routing": { + "tier": "lightweight", + "routingPriority": 35, + "eligibleForAgent": true, + "defaultReference": false, + "reasoning": { + "supportedModes": [ + "auto", + "high", + "max" + ], + "defaultMode": "high" + } + } } ] } diff --git a/compute/model-specs/qwen.json b/compute/model-specs/qwen.json index 40e3a7a..38ecbdb 100644 --- a/compute/model-specs/qwen.json +++ b/compute/model-specs/qwen.json @@ -50,6 +50,66 @@ } } }, + { + "id": "qwen3.8-flash", + "displayName": "Qwen3.8 Flash", + "family": "qwen3.8-flash", + "match": { + "exact": [ + "qwen3.8-flash" + ] + }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 131072, + "capabilities": [ + "chat", + "reasoning", + "deep_thinking", + "code", + "multilingual", + "tool_use", + "long_context", + "agent", + "vision", + "video_understanding", + "fast" + ], + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "defaultTemperature": 0.6, + "defaultTopP": 0.95, + "supportsReasoning": true, + "extra": { + "thinkingDefault": true, + "thinkingMaxTokens": 262144 + }, + "releasedAt": "2026-08-26", + "description": "通义千问 Qwen3.8 Flash,高性价比多模态推理模型,支持 100 万上下文及文本、图像、视频输入" + }, + "routing": { + "tier": "lightweight", + "routingPriority": 40, + "eligibleForAgent": true, + "defaultReference": false, + "reasoning": { + "supportedModes": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultMode": "xhigh" + } + } + }, { "id": "qwen3.8-max-preview", "displayName": "Qwen3.8 Max Preview", diff --git a/compute/providers/deepseek.json b/compute/providers/deepseek.json index b7c0ec9..f027390 100644 --- a/compute/providers/deepseek.json +++ b/compute/providers/deepseek.json @@ -11,13 +11,56 @@ "priceCurrency": "CNY", "services": [ "chat", - "reasoning" + "reasoning", + "vision" ], "tombstones": [ "deepseek-chat", "deepseek-reasoner" ], "models": [ + { + "modelName": "deepseek-v4-flash-vision-exp", + "displayName": "DeepSeek V4 Flash Vision Exp", + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "description": "DeepSeek V4 Flash 实验性视觉版本,支持文本与图像输入,文本能力与 V4 Flash 一致,1M 上下文,并发上限 2500", + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "vision", + "long_context", + "multilingual", + "tool_use" + ], + "inputPrice": 1.008, + "outputPrice": 2.016, + "defaultTemperature": 1, + "defaultTopP": 1, + "extra": { + "cacheHitPrice": 0.02016, + "concurrencyLimit": 2500, + "supportsThinking": true, + "thinkingDefault": true, + "reasoningEffort": [ + "high", + "max" + ], + "features": { + "jsonOutput": true, + "toolCalls": true, + "chatPrefixCompletion": "beta", + "fimCompletion": false + } + } + }, { "modelName": "deepseek-v4-flash", "displayName": "DeepSeek V4 Flash", diff --git a/manifest.json b/manifest.json index 889a263..a712161 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 95, - "updatedAt": "2026-08-26", + "presetDataVersion": 98, + "updatedAt": "2026-08-27", "description": "DesireCore 官方配置中心" }