From 143b567a84bcb5f909fc7416e28032301d8fc4b3 Mon Sep 17 00:00:00 2001 From: Yige Date: Sun, 13 Sep 2026 22:05:51 -0400 Subject: [PATCH] feat(compute): add DeepSeek V4.1 Flash profile (#101) --- __tests__/validate.test.mjs | 39 +++++++++++++++++++- compute/model-specs/deepseek.json | 49 +++++++++++++++++++++++++ compute/providers/deepseek.json | 60 +++++++++++++++++++++++++++++++ compute/service-map.json | 2 +- manifest.json | 4 +-- 5 files changed, 150 insertions(+), 4 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index f7e1264..6a6a796 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, 47) + assert.equal(routed.length, 48) 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) }) @@ -295,6 +295,43 @@ describe('真实数据全量校验', () => { assert.equal('patterns' in flash.match, false) }) + it('DeepSeek V4.1 Flash 应使用官方模型 ID、视觉能力和分时价格', () => { + 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 serviceMap = JSON.parse(readFileSync(join(ROOT, 'compute', 'service-map.json'), 'utf8')) + const modelId = 'deepseek-flash' + const model = provider.models.find((item) => item.modelName === modelId) + const modelSpec = specFile.specs.find((item) => item.id === modelId) + + assert.equal(serviceMap.reasoning.modelName, modelId) + assert.ok(model, `provider 缺少 ${modelId}`) + assert.deepEqual(model.serviceType, ['chat', 'reasoning', 'vision']) + assert.equal(model.contextWindow, 1000000) + assert.equal(model.maxOutputTokens, 384000) + assert.ok(model.capabilities.includes('vision')) + assert.equal(model.inputPrice, 1) + assert.equal(model.outputPrice, 4) + assert.equal(model.extra.cacheHitPrice, 0.02) + assert.equal(model.extra.concurrencyLimit, 2500) + assert.deepEqual(model.extra.reasoning, { + supportedEfforts: ['high', 'max'], + defaultEffort: 'high', + }) + assert.deepEqual(model.extra.pricingTiers, [ + { condition: 'idle', inputPrice: 1, outputPrice: 4, cacheHitPrice: 0.02 }, + { condition: 'peak', inputPrice: 2, outputPrice: 8, cacheHitPrice: 0.04 }, + ]) + + assert.ok(modelSpec, `model-specs 缺少 ${modelId}`) + assert.deepEqual(modelSpec.match.exact, [modelId]) + assert.equal(modelSpec.spec.contextWindow, 1000000) + assert.equal(modelSpec.spec.maxOutputTokens, 384000) + assert.ok(modelSpec.spec.capabilities.includes('vision')) + assert.deepEqual(modelSpec.spec.serviceType, ['chat', 'reasoning', 'vision']) + assert.equal(modelSpec.spec.supportsReasoning, true) + assert.deepEqual(modelSpec.routing.reasoning.supportedModes, ['auto', 'high', 'max']) + }) + 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') diff --git a/compute/model-specs/deepseek.json b/compute/model-specs/deepseek.json index c0a317b..2cfd650 100644 --- a/compute/model-specs/deepseek.json +++ b/compute/model-specs/deepseek.json @@ -159,6 +159,55 @@ "supportsReasoning": true } }, + { + "id": "deepseek-flash", + "displayName": "DeepSeek V4.1 Flash", + "family": "deepseek-flash", + "match": { + "exact": [ + "deepseek-flash" + ] + }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "vision", + "multilingual", + "tool_use" + ], + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "defaultTemperature": 1, + "supportsReasoning": true, + "extra": { + "supportsThinking": true, + "thinkingDefault": true + }, + "description": "DeepSeek V4.1 Flash,支持文本与图像输入,100 万上下文" + }, + "routing": { + "tier": "lightweight", + "routingPriority": 35, + "eligibleForAgent": true, + "defaultReference": false, + "reasoning": { + "supportedModes": [ + "auto", + "high", + "max" + ], + "defaultMode": "high" + } + } + }, { "id": "deepseek-v4-flash", "displayName": "DeepSeek V4 Flash", diff --git a/compute/providers/deepseek.json b/compute/providers/deepseek.json index f027390..f4412d4 100644 --- a/compute/providers/deepseek.json +++ b/compute/providers/deepseek.json @@ -19,6 +19,66 @@ "deepseek-reasoner" ], "models": [ + { + "modelName": "deepseek-flash", + "displayName": "DeepSeek V4.1 Flash", + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "description": "DeepSeek V4.1 Flash,支持文本与图像输入,1M 上下文,最大输出 384K,并发上限 2500", + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "vision", + "long_context", + "multilingual", + "tool_use" + ], + "inputPrice": 1, + "outputPrice": 4, + "defaultTemperature": 1, + "defaultTopP": 1, + "extra": { + "cacheHitPrice": 0.02, + "concurrencyLimit": 2500, + "supportsThinking": true, + "thinkingDefault": true, + "reasoning": { + "supportedEfforts": [ + "high", + "max" + ], + "defaultEffort": "high" + }, + "pricingTiers": [ + { + "condition": "idle", + "inputPrice": 1, + "outputPrice": 4, + "cacheHitPrice": 0.02 + }, + { + "condition": "peak", + "inputPrice": 2, + "outputPrice": 8, + "cacheHitPrice": 0.04 + } + ], + "pricingNotes": "空闲时段为北京时间工作日 09:00-12:00、14:00-18:00 之外的时段;高峰时段价格为输入 2 元、输出 8 元、缓存命中输入 0.04 元/百万 tokens。", + "features": { + "jsonOutput": true, + "toolCalls": true, + "chatPrefixCompletion": "beta", + "fimCompletion": "non-thinking-only" + } + } + }, { "modelName": "deepseek-v4-flash-vision-exp", "displayName": "DeepSeek V4 Flash Vision Exp", diff --git a/compute/service-map.json b/compute/service-map.json index cdabdf2..5c59e67 100644 --- a/compute/service-map.json +++ b/compute/service-map.json @@ -4,7 +4,7 @@ "providerId": "provider-openai-001" }, "reasoning": { - "modelName": "deepseek-v4-flash", + "modelName": "deepseek-flash", "providerId": "provider-deepseek-001" }, "fast": { diff --git a/manifest.json b/manifest.json index c14b51f..0786681 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 114, - "updatedAt": "2026-09-13", + "presetDataVersion": 115, + "updatedAt": "2026-09-14", "description": "DesireCore 官方配置中心" }