From 5a9b9c87c4ba6fb719836e6505e9fc96362790e8 Mon Sep 17 00:00:00 2001 From: Yige Date: Fri, 10 Jul 2026 11:47:40 +0800 Subject: [PATCH] fix: align DeepSeek V4 model specs with official profile Align the shared DeepSeek V4 Pro and Flash specifications with the official 1M context, 384K output, and high/max reasoning profile. Consolidate duplicate specs, add regression coverage, and bump presetDataVersion to 72. --- __tests__/validate.test.mjs | 33 +++++++++++++++++++++++++++++++ compute/model-specs/deepseek.json | 33 +++++++++++++++---------------- manifest.json | 4 ++-- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 48e8d5b..1452f4b 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -101,6 +101,39 @@ describe('真实数据全量校验', () => { const result = validateFile(join(ROOT, 'runtimes', 'versions-fallback.json'), validators) assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) }) + + it('DeepSeek V4 Pro/Flash 应与官方的 1M/384K reasoning profile 一致', () => { + 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 modelIds = ['deepseek-v4-pro', 'deepseek-v4-flash'] + + for (const modelId of modelIds) { + const model = provider.models.find((item) => item.modelName === modelId) + assert.ok(model, `provider 缺少 ${modelId}`) + assert.equal(model.contextWindow, 1000000) + assert.equal(model.maxOutputTokens, 384000) + assert.ok(model.capabilities.includes('reasoning')) + assert.ok(model.capabilities.includes('deep_thinking')) + assert.ok(model.serviceType.includes('reasoning')) + assert.equal(model.extra.supportsThinking, true) + assert.equal(model.extra.thinkingDefault, true) + assert.deepEqual(model.extra.reasoningEffort, ['high', 'max']) + + const specs = specFile.specs.filter((item) => item.id === modelId) + assert.equal(specs.length, 1, `model-specs 中 ${modelId} 应且仅应有一条规格`) + for (const { spec } of specs) { + assert.equal(spec.contextWindow, 1000000) + assert.equal(spec.maxOutputTokens, 384000) + assert.equal(spec.supportsReasoning, true) + assert.ok(spec.capabilities.includes('reasoning')) + assert.ok(spec.capabilities.includes('deep_thinking')) + assert.ok(spec.serviceType.includes('reasoning')) + assert.equal(spec.extra.supportsThinking, true) + assert.equal(spec.extra.thinkingDefault, true) + assert.deepEqual(spec.extra.reasoningEffort, ['high', 'max']) + } + } + }) }) // ==================== Runtime 清单反例 ==================== diff --git a/compute/model-specs/deepseek.json b/compute/model-specs/deepseek.json index fb64a44..4067e5c 100644 --- a/compute/model-specs/deepseek.json +++ b/compute/model-specs/deepseek.json @@ -7,11 +7,17 @@ "family": "deepseek-v4", "match": { "exact": ["deepseek-v4-pro"], "patterns": ["deepseek-v4-pro*"] }, "spec": { - "contextWindow": 1048576, + "contextWindow": 1000000, "maxOutputTokens": 384000, - "capabilities": ["reasoning", "deep_thinking", "code", "math", "science", "multilingual", "tool_use"], - "serviceType": ["reasoning"], + "capabilities": ["chat", "reasoning", "deep_thinking", "code", "math", "science", "multilingual", "tool_use"], + "serviceType": ["chat", "reasoning"], + "defaultTemperature": 1, "supportsReasoning": true, + "extra": { + "supportsThinking": true, + "thinkingDefault": true, + "reasoningEffort": ["high", "max"] + }, "description": "DeepSeek V4 Pro,1.6T MoE 架构,100 万上下文" } }, @@ -42,30 +48,23 @@ "supportsReasoning": true } }, - { - "id": "deepseek-v4-pro", - "displayName": "DeepSeek V4 Pro", - "family": "deepseek-v4", - "spec": { - "contextWindow": 1000000, - "maxOutputTokens": 384000, - "capabilities": ["chat", "code", "reasoning", "deep_thinking", "multilingual", "tool_use", "math"], - "serviceType": ["chat", "reasoning"], - "defaultTemperature": 1, - "supportsReasoning": true - } - }, { "id": "deepseek-v4-flash", "displayName": "DeepSeek V4 Flash", "family": "deepseek-v4", + "match": { "exact": ["deepseek-v4-flash"], "patterns": ["deepseek-v4-flash*"] }, "spec": { "contextWindow": 1000000, "maxOutputTokens": 384000, "capabilities": ["chat", "code", "reasoning", "deep_thinking", "multilingual", "tool_use"], "serviceType": ["chat", "reasoning"], "defaultTemperature": 1, - "supportsReasoning": true + "supportsReasoning": true, + "extra": { + "supportsThinking": true, + "thinkingDefault": true, + "reasoningEffort": ["high", "max"] + } } } ] diff --git a/manifest.json b/manifest.json index b6548ba..0be9748 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 71, - "updatedAt": "2026-07-09", + "presetDataVersion": 72, + "updatedAt": "2026-07-10", "description": "DesireCore 官方配置中心" }