From 96842d2080cc816a02b21a21aa52188df7afc23b Mon Sep 17 00:00:00 2001 From: Yige Date: Fri, 24 Jul 2026 00:30:47 +0800 Subject: [PATCH 01/10] feat: configure tiered web search providers (#64) --- __tests__/validate.test.mjs | 60 +++++++++++++++++++++++ api-providers/web-search/_index.json | 2 +- api-providers/web-search/brave.json | 35 ++++++++++++++ api-providers/web-search/serper.json | 2 +- compute/providers/anthropic.json | 30 ++++++++++++ compute/providers/openai.json | 72 ++++++++++++++++++++++++++-- manifest.json | 4 +- 7 files changed, 197 insertions(+), 8 deletions(-) create mode 100644 api-providers/web-search/brave.json diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 52201af..bbf5c96 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -102,6 +102,66 @@ describe('真实数据全量校验', () => { assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) }) + it('WebSearch 服务端能力仅标记官方直连 Anthropic/OpenAI 模型', () => { + const anthropic = JSON.parse(readFileSync(join(ROOT, 'compute', 'providers', 'anthropic.json'), 'utf8')) + const openai = JSON.parse(readFileSync(join(ROOT, 'compute', 'providers', 'openai.json'), 'utf8')) + const openaiCodex = JSON.parse(readFileSync(join(ROOT, 'compute', 'providers', 'openai-codex.json'), 'utf8')) + + const enabled = (provider) => provider.models + .filter((model) => model.extra?.serverSideWebSearch?.enabled === true) + .map((model) => model.modelName) + + assert.deepEqual(enabled(anthropic), [ + 'claude-fable-5', + 'claude-opus-4-8', + 'claude-sonnet-5', + 'claude-opus-4-7', + 'claude-sonnet-4-6', + ]) + assert.deepEqual(enabled(openai), [ + 'gpt-5.5', + 'gpt-5.5-pro', + 'gpt-5.4', + 'gpt-5.4-pro', + 'gpt-5.4-mini', + 'gpt-5.4-nano', + 'gpt-5', + 'gpt-4.1', + 'gpt-4.1-mini', + 'o4-mini', + ]) + assert.deepEqual(enabled(openaiCodex), []) + + for (const model of anthropic.models.filter((item) => enabled(anthropic).includes(item.modelName))) { + assert.equal(model.extra.serverSideWebSearch.dialect, 'anthropic-messages') + assert.equal(model.extra.serverSideWebSearch.toolType, 'web_search_20260318') + assert.equal('maxUses' in model.extra.serverSideWebSearch, false) + } + for (const model of openai.models.filter((item) => enabled(openai).includes(item.modelName))) { + assert.equal(model.extra.serverSideWebSearch.dialect, 'openai-responses') + assert.equal(model.extra.serverSideWebSearch.toolType, 'web_search') + assert.equal('maxUses' in model.extra.serverSideWebSearch, false) + } + }) + + it('Brave Search API 使用显式密钥声明且默认关闭', () => { + const brave = JSON.parse(readFileSync(join(ROOT, 'api-providers', 'web-search', 'brave.json'), 'utf8')) + const index = JSON.parse(readFileSync(join(ROOT, 'api-providers', 'web-search', '_index.json'), 'utf8')) + + assert.equal(brave.enabled, false) + assert.equal(brave.endpoint, 'https://api.search.brave.com/res/v1/web/search') + assert.deepEqual(brave.auth, { + type: 'header', + headerName: 'X-Subscription-Token', + apiKeyRef: 'brave', + }) + assert.deepEqual(index.order, ['tavily', 'brave', 'serper']) + assert.equal( + validateFile(join(ROOT, 'api-providers', 'web-search', 'brave.json'), validators).ok, + true, + ) + }) + 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')) diff --git a/api-providers/web-search/_index.json b/api-providers/web-search/_index.json index 60e0fd3..e9d7d89 100644 --- a/api-providers/web-search/_index.json +++ b/api-providers/web-search/_index.json @@ -1,4 +1,4 @@ { "description": "web_search 工具后端加载顺序索引", - "order": ["tavily", "serper"] + "order": ["tavily", "brave", "serper"] } diff --git a/api-providers/web-search/brave.json b/api-providers/web-search/brave.json new file mode 100644 index 0000000..a3389e1 --- /dev/null +++ b/api-providers/web-search/brave.json @@ -0,0 +1,35 @@ +{ + "id": "brave", + "name": "Brave Search API", + "capability": "web_search", + "enabled": false, + "builtin": true, + "priority": 20, + "endpoint": "https://api.search.brave.com/res/v1/web/search", + "method": "GET", + "auth": { + "type": "header", + "headerName": "X-Subscription-Token", + "apiKeyRef": "brave" + }, + "request": { + "headers": { + "Accept": "application/json", + "Accept-Encoding": "gzip" + }, + "queryParams": { + "q": "${query}", + "count": "${maxResults}" + } + }, + "response": { + "resultsPath": "web.results", + "item": { + "titlePath": "title", + "urlPath": "url", + "snippetPath": "description", + "pageAgePath": "page_age" + } + }, + "timeoutMs": 10000 +} diff --git a/api-providers/web-search/serper.json b/api-providers/web-search/serper.json index cf3671f..c2c781c 100644 --- a/api-providers/web-search/serper.json +++ b/api-providers/web-search/serper.json @@ -4,7 +4,7 @@ "capability": "web_search", "enabled": false, "builtin": true, - "priority": 20, + "priority": 30, "endpoint": "https://google.serper.dev/search", "method": "POST", "auth": { "type": "header", "headerName": "X-API-KEY", "apiKeyRef": "serper" }, diff --git a/compute/providers/anthropic.json b/compute/providers/anthropic.json index 9455297..391a3e7 100644 --- a/compute/providers/anthropic.json +++ b/compute/providers/anthropic.json @@ -35,6 +35,12 @@ "inputPrice": 10, "outputPrice": 50, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 1, + "toolType": "web_search_20260318" + }, "cachePricing": { "write5m": 12.5, "write1h": 20, @@ -66,6 +72,12 @@ "inputPrice": 5, "outputPrice": 25, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 2, + "toolType": "web_search_20260318" + }, "cachePricing": { "write5m": 6.25, "write1h": 10, @@ -100,6 +112,12 @@ "inputPrice": 2, "outputPrice": 10, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 3, + "toolType": "web_search_20260318" + }, "cachePricing": { "write5m": 2.5, "write1h": 4, @@ -133,6 +151,12 @@ "inputPrice": 5, "outputPrice": 25, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 4, + "toolType": "web_search_20260318" + }, "cachePricing": { "write5m": 6.25, "write1h": 10, @@ -163,6 +187,12 @@ "outputPrice": 15, "defaultTemperature": 1, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 5, + "toolType": "web_search_20260318" + }, "cachePricing": { "write5m": 3.75, "write1h": 6, diff --git a/compute/providers/openai.json b/compute/providers/openai.json index b6b5517..75b0634 100644 --- a/compute/providers/openai.json +++ b/compute/providers/openai.json @@ -46,6 +46,12 @@ "inputPrice": 5, "outputPrice": 30, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 1, + "toolType": "web_search" + }, "cachedInputPrice": 0.5, "reasoningEffort": [ "none", @@ -79,6 +85,12 @@ "inputPrice": 30, "outputPrice": 180, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 2, + "toolType": "web_search" + }, "responsesOnly": true, "reasoningEffort": [ "medium", @@ -110,6 +122,12 @@ "inputPrice": 2.5, "outputPrice": 15, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 3, + "toolType": "web_search" + }, "cachedInputPrice": 0.25, "reasoningEffort": [ "none", @@ -140,6 +158,12 @@ "inputPrice": 30, "outputPrice": 180, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 4, + "toolType": "web_search" + }, "responsesOnly": true, "reasoningEffort": [ "medium", @@ -172,6 +196,12 @@ "inputPrice": 0.75, "outputPrice": 4.5, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 5, + "toolType": "web_search" + }, "cachedInputPrice": 0.075, "reasoningEffort": [ "none", @@ -201,6 +231,12 @@ "inputPrice": 0.2, "outputPrice": 1.25, "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 6, + "toolType": "web_search" + }, "cachedInputPrice": 0.02, "reasoningEffort": [ "none", @@ -395,7 +431,14 @@ ], "inputPrice": 1.25, "outputPrice": 10, - "extra": {} + "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 7, + "toolType": "web_search" + } + } }, { "modelName": "gpt-5-pro", @@ -477,7 +520,14 @@ "outputPrice": 8, "defaultTemperature": 1, "defaultTopP": 1, - "extra": {} + "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 8, + "toolType": "web_search" + } + } }, { "modelName": "gpt-4.1-mini", @@ -499,7 +549,14 @@ "outputPrice": 1.6, "defaultTemperature": 1, "defaultTopP": 1, - "extra": {} + "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 9, + "toolType": "web_search" + } + } }, { "modelName": "gpt-4.1-nano", @@ -754,7 +811,14 @@ ], "inputPrice": 1.1, "outputPrice": 4.4, - "extra": {} + "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "openai-responses", + "fallbackPriority": 10, + "toolType": "web_search" + } + } } ], "tombstones": [ diff --git a/manifest.json b/manifest.json index 6081df0..b85db5d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 79, - "updatedAt": "2026-07-20", + "presetDataVersion": 80, + "updatedAt": "2026-07-23", "description": "DesireCore 官方配置中心" } From 2ddf3045d60ebf35908177de1502cf34b574e1b9 Mon Sep 17 00:00:00 2001 From: Yige Date: Fri, 24 Jul 2026 12:28:07 +0800 Subject: [PATCH 02/10] fix: account for native search request pricing (#65) --- __tests__/validate.test.mjs | 2 ++ compute/providers/anthropic.json | 5 +++++ compute/providers/openai.json | 10 ++++++++++ manifest.json | 4 ++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index bbf5c96..c69957f 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -135,11 +135,13 @@ describe('真实数据全量校验', () => { for (const model of anthropic.models.filter((item) => enabled(anthropic).includes(item.modelName))) { assert.equal(model.extra.serverSideWebSearch.dialect, 'anthropic-messages') assert.equal(model.extra.serverSideWebSearch.toolType, 'web_search_20260318') + assert.equal(model.extra.serverSideWebSearch.searchRequestPriceUsd, 0.01) assert.equal('maxUses' in model.extra.serverSideWebSearch, false) } for (const model of openai.models.filter((item) => enabled(openai).includes(item.modelName))) { assert.equal(model.extra.serverSideWebSearch.dialect, 'openai-responses') assert.equal(model.extra.serverSideWebSearch.toolType, 'web_search') + assert.equal(model.extra.serverSideWebSearch.searchRequestPriceUsd, 0.01) assert.equal('maxUses' in model.extra.serverSideWebSearch, false) } }) diff --git a/compute/providers/anthropic.json b/compute/providers/anthropic.json index 391a3e7..7427de3 100644 --- a/compute/providers/anthropic.json +++ b/compute/providers/anthropic.json @@ -39,6 +39,7 @@ "enabled": true, "dialect": "anthropic-messages", "fallbackPriority": 1, + "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, "cachePricing": { @@ -76,6 +77,7 @@ "enabled": true, "dialect": "anthropic-messages", "fallbackPriority": 2, + "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, "cachePricing": { @@ -116,6 +118,7 @@ "enabled": true, "dialect": "anthropic-messages", "fallbackPriority": 3, + "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, "cachePricing": { @@ -155,6 +158,7 @@ "enabled": true, "dialect": "anthropic-messages", "fallbackPriority": 4, + "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, "cachePricing": { @@ -191,6 +195,7 @@ "enabled": true, "dialect": "anthropic-messages", "fallbackPriority": 5, + "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, "cachePricing": { diff --git a/compute/providers/openai.json b/compute/providers/openai.json index 75b0634..6fa90f0 100644 --- a/compute/providers/openai.json +++ b/compute/providers/openai.json @@ -50,6 +50,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 1, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "cachedInputPrice": 0.5, @@ -89,6 +90,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 2, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "responsesOnly": true, @@ -126,6 +128,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 3, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "cachedInputPrice": 0.25, @@ -162,6 +165,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 4, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "responsesOnly": true, @@ -200,6 +204,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 5, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "cachedInputPrice": 0.075, @@ -235,6 +240,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 6, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" }, "cachedInputPrice": 0.02, @@ -436,6 +442,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 7, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" } } @@ -525,6 +532,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 8, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" } } @@ -554,6 +562,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 9, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" } } @@ -816,6 +825,7 @@ "enabled": true, "dialect": "openai-responses", "fallbackPriority": 10, + "searchRequestPriceUsd": 0.01, "toolType": "web_search" } } diff --git a/manifest.json b/manifest.json index b85db5d..f78c295 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 80, - "updatedAt": "2026-07-23", + "presetDataVersion": 81, + "updatedAt": "2026-07-24", "description": "DesireCore 官方配置中心" } From 130b8f9ef946d1fd41251ffe15254e1b02e5cf74 Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 25 Jul 2026 15:31:40 +0800 Subject: [PATCH 03/10] =?UTF-8?q?feat(compute):=20=E6=B7=BB=E5=8A=A0=20qwe?= =?UTF-8?q?n3.8-max-preview=20=E6=A8=A1=E5=9E=8B=20(#66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 Qwen3.8-Max Preview 到 dashscope provider 和 model-specs - 100万上下文,支持视觉理解(serviceType 含 vision)、Agent、推理 - supportsReasoning: true - 定价:输入 ¥12/M token,输出 ¥36/M token - presetDataVersion 81 → 82 --- compute/model-specs/qwen.json | 16 ++++++++++++++++ compute/providers/dashscope.json | 26 ++++++++++++++++++++++++++ manifest.json | 4 ++-- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/compute/model-specs/qwen.json b/compute/model-specs/qwen.json index 30f114e..69c1c3e 100644 --- a/compute/model-specs/qwen.json +++ b/compute/model-specs/qwen.json @@ -1,6 +1,22 @@ { "description": "阿里通义千问 Qwen 系列模型规格。参数来源:config-center compute/providers/dashscope.json。", "specs": [ + { + "id": "qwen3.8-max-preview", + "displayName": "Qwen3.8 Max Preview", + "family": "qwen3.8", + "match": { "exact": ["qwen3.8-max-preview"], "patterns": ["qwen3.8-max-preview*"] }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 65536, + "capabilities": ["chat", "reasoning", "code", "multilingual", "tool_use", "long_context", "agent", "vision"], + "serviceType": ["chat"], + "defaultTemperature": 0.6, + "defaultTopP": 0.95, + "supportsReasoning": true, + "description": "通义千问 Qwen3.8 Max 预览版,100 万上下文,支持视觉理解" + } + }, { "id": "qwen3.7-max", "displayName": "Qwen3.7 Max", diff --git a/compute/providers/dashscope.json b/compute/providers/dashscope.json index f71da81..b456e55 100644 --- a/compute/providers/dashscope.json +++ b/compute/providers/dashscope.json @@ -33,6 +33,32 @@ "qwen3-max-trans" ], "models": [ + { + "modelName": "qwen3.8-max-preview", + "displayName": "阿里云 Qwen3.8-Max (Preview)", + "serviceType": [ + "chat", + "vision" + ], + "description": "通义千问3.8 Max 预览版,面向复杂推理与长程 Agent 任务的旗舰模型,100万上下文,支持视觉理解、内置工具和 Function Calling", + "contextWindow": 1000000, + "maxOutputTokens": 65536, + "capabilities": [ + "chat", + "reasoning", + "code", + "multilingual", + "long_context", + "tool_use", + "agent", + "vision" + ], + "inputPrice": 12, + "outputPrice": 36, + "defaultTemperature": 0.6, + "defaultTopP": 0.95, + "extra": {} + }, { "modelName": "qwen3.7-max", "displayName": "阿里云 Qwen3.7-Max", diff --git a/manifest.json b/manifest.json index f78c295..848af83 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 81, - "updatedAt": "2026-07-24", + "presetDataVersion": 82, + "updatedAt": "2026-07-25", "description": "DesireCore 官方配置中心" } From 89b292dc12f3b006d9eed44098be82ec129f0f92 Mon Sep 17 00:00:00 2001 From: Yige Date: Tue, 28 Jul 2026 09:47:26 +0800 Subject: [PATCH 04/10] fix: correct MiMo V2.5 Pro multimodal capability (#69) --- __tests__/validate.test.mjs | 23 +++++++++++++++++++++++ compute/model-specs/xiaomi.json | 8 +++----- compute/providers/xiaomi.json | 3 +-- manifest.json | 4 ++-- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index c69957f..8581604 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -207,6 +207,29 @@ describe('真实数据全量校验', () => { assert.ok(specs[0].spec.capabilities.includes('asr')) }) + it('MiMo V2.5 仅非 Pro 型号应声明多模态能力', () => { + const provider = JSON.parse(readFileSync(join(ROOT, 'compute', 'providers', 'xiaomi.json'), 'utf8')) + const specFile = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'xiaomi.json'), 'utf8')) + const specFor = (modelId) => specFile.specs.find((item) => item.id === modelId) + + const mimoV25 = specFor('mimo-v2.5') + assert.ok(mimoV25, 'model-specs 缺少 mimo-v2.5') + assert.ok(mimoV25.spec.capabilities.includes('vision')) + assert.ok(mimoV25.spec.serviceType.includes('vision')) + + for (const modelId of ['mimo-v2.5-pro', 'mimo-v2-pro']) { + const modelSpec = specFor(modelId) + assert.ok(modelSpec, `model-specs 缺少 ${modelId}`) + assert.equal(modelSpec.spec.capabilities.includes('vision'), false) + assert.equal(modelSpec.spec.serviceType.includes('vision'), false) + } + + const pro = provider.models.find((item) => item.modelName === 'mimo-v2.5-pro') + assert.ok(pro, 'provider 缺少 mimo-v2.5-pro') + assert.equal(pro.capabilities.includes('vision'), false) + assert.equal(pro.serviceType.includes('vision'), false) + }) + it('所有 Provider 应按供应商归属计价,模型来源不覆盖供应商币种', () => { const expectedCurrencies = { anthropic: 'USD', diff --git a/compute/model-specs/xiaomi.json b/compute/model-specs/xiaomi.json index 73b212e..877f4e9 100644 --- a/compute/model-specs/xiaomi.json +++ b/compute/model-specs/xiaomi.json @@ -18,8 +18,7 @@ "chat", "reasoning", "tool_use", - "code", - "vision" + "code" ], "serviceType": [ "chat", @@ -27,7 +26,7 @@ ], "defaultTemperature": 1, "supportsReasoning": true, - "description": "小米 MiMo 旗舰推理模型,支持文本/图像/工具调用" + "description": "小米 MiMo 旗舰推理模型,支持文本/工具调用" } }, { @@ -78,8 +77,7 @@ "chat", "reasoning", "tool_use", - "code", - "vision" + "code" ], "serviceType": [ "chat", diff --git a/compute/providers/xiaomi.json b/compute/providers/xiaomi.json index b36a223..bae4bac 100644 --- a/compute/providers/xiaomi.json +++ b/compute/providers/xiaomi.json @@ -31,8 +31,7 @@ "chat", "reasoning", "tool_use", - "code", - "vision" + "code" ], "extra": {} }, diff --git a/manifest.json b/manifest.json index 848af83..9300af9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 82, - "updatedAt": "2026-07-25", + "presetDataVersion": 83, + "updatedAt": "2026-07-28", "description": "DesireCore 官方配置中心" } From 6befa8ebb64f533d72797f9bedecf8379f31f68b Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 8 Aug 2026 17:12:10 +0800 Subject: [PATCH 05/10] =?UTF-8?q?feat(compute):=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=8F=91=E5=B8=83=20Claude=20=E8=AE=A2=E9=98=85=20provider?= =?UTF-8?q?=EF=BC=88anthropic-claude=EF=BC=89=EF=BC=8CpresetDataVersion=20?= =?UTF-8?q?=E2=86=92=2084=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #47/#48/#49 曾因 credentialSource 硬 enum 毒丸老客户端而被 #50 回滚。毒丸根因已由 客户端 desirecore#1021 系统性修复(credentialSource 改开放 string + 合并 salvage + 能力门控降级),claude-oauth 检测器与 SDK 网关由 desirecore#1008 提供, requiredClientVersion 运行时门槛由 desirecore#1038 提供,三者同在 v10.0.83 发布。 本次重新发布相较 #47 的变化: - 声明 requiredClientVersion = 10.0.83,低版本客户端优雅门控为「需更新客户端」 - displayName 去掉冗余 (订阅) 后缀,对齐 #58 的 Codex 命名约定 - 文件名 anthropic-claude.json 与 _index.json basename 一致(#48 的修正一并纳入) --- __tests__/validate.test.mjs | 1 + compute/providers/_index.json | 1 + compute/providers/anthropic-claude.json | 106 ++++++++++++++++++++++++ manifest.json | 4 +- schemas/provider.schema.json | 4 +- 5 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 compute/providers/anthropic-claude.json diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 8581604..999e048 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -233,6 +233,7 @@ describe('真实数据全量校验', () => { it('所有 Provider 应按供应商归属计价,模型来源不覆盖供应商币种', () => { const expectedCurrencies = { anthropic: 'USD', + 'anthropic-claude': 'USD', baichuan: 'CNY', baidu: 'CNY', cohere: 'USD', diff --git a/compute/providers/_index.json b/compute/providers/_index.json index 20a9ea2..a737bd9 100644 --- a/compute/providers/_index.json +++ b/compute/providers/_index.json @@ -4,6 +4,7 @@ "openai", "openai-codex", "anthropic", + "anthropic-claude", "deepseek", "dashscope", "volcengine", diff --git a/compute/providers/anthropic-claude.json b/compute/providers/anthropic-claude.json new file mode 100644 index 0000000..4f909c5 --- /dev/null +++ b/compute/providers/anthropic-claude.json @@ -0,0 +1,106 @@ +{ + "id": "provider-anthropic-claude-plan-001", + "provider": "anthropic-claude", + "brandGroup": "anthropic", + "label": "Claude 订阅 (Claude Code)", + "baseUrl": "https://api.anthropic.com", + "apiFormat": "anthropic-messages", + "apiKeyRef": "anthropic-claude-oauth-token", + "apiKeyVerified": false, + "enabled": false, + "status": "unconfigured", + "priceCurrency": "USD", + "accessMode": "coding-plan", + "credentialSource": "claude-oauth", + "requiredClientVersion": "10.0.83", + "codingPlan": { + "quotas": {}, + "usageTracking": { + "method": "none", + "consoleUrl": "https://claude.ai/settings/usage" + } + }, + "services": [ + "chat", + "reasoning" + ], + "models": [ + { + "modelName": "claude-fable-5", + "displayName": "Claude Fable 5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,Anthropic 最高能力公开模型,面向长程智能体与高难推理,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-opus-4-8", + "displayName": "Claude Opus 4.8", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,Opus 级复杂智能体编码与企业任务模型,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-sonnet-5", + "displayName": "Claude Sonnet 5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,速度与智能平衡模型,支持长上下文智能体任务", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-haiku-4-5", + "displayName": "Claude Haiku 4.5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,最快模型,具备接近前沿模型的智能水平,200K 上下文", + "contextWindow": 200000, + "maxOutputTokens": 64000, + "capabilities": [ + "chat", + "code", + "vision", + "tool_use" + ], + "source": "preset" + } + ] +} diff --git a/manifest.json b/manifest.json index 9300af9..1eb1703 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 83, - "updatedAt": "2026-07-28", + "presetDataVersion": 84, + "updatedAt": "2026-08-08", "description": "DesireCore 官方配置中心" } diff --git a/schemas/provider.schema.json b/schemas/provider.schema.json index 6f197d3..f3e337f 100644 --- a/schemas/provider.schema.json +++ b/schemas/provider.schema.json @@ -83,8 +83,8 @@ }, "credentialSource": { "type": "string", - "enum": ["codex-cli"], - "description": "凭证托管来源。codex-cli:密钥由客户端本地 Codex CLI 凭证检测器托管(读取 ~/.codex/auth.json 自动刷新写回,fresh token 同步 secrets.json)。需 requiredClientVersion ≥ 引入此字段的客户端版本——老客户端不识别本字段,必须先发版铺开 compute.json 韧性(容忍未知字段)再推送本数据" + "enum": ["codex-cli", "claude-oauth"], + "description": "凭证托管来源。codex-cli:密钥由客户端本地 Codex CLI 凭证检测器托管(读取 ~/.codex/auth.json 自动刷新写回,fresh token 同步 secrets.json)。claude-oauth:Claude 订阅接入,由客户端 claude-auth 检测器托管——首选复用本机 Claude Code 登录(Agent SDK 自读,不写不刷新),或应用内 OAuth / setup-token 兜底;模型调用经 compat-proxy 内 claude-agent-sdk 后端履约,不直连。需 requiredClientVersion ≥ 引入此字段的客户端版本——老客户端不识别本字段,必须先发版铺开 compute.json 韧性(容忍未知字段)再推送本数据" }, "codingPlan": { "type": "object", From a752fddd0b8afe4582504380870f0a88a825f4ef Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 8 Aug 2026 17:59:09 +0800 Subject: [PATCH 06/10] =?UTF-8?q?feat(compute):=20=E6=96=B0=E5=A2=9E=20Cla?= =?UTF-8?q?ude=20Opus=205=20+=20=E8=A1=A5=E9=BD=90=20Claude=20=E7=B3=BB?= =?UTF-8?q?=E5=88=97=20effort=20=E6=A1=A3=E4=BD=8D=EF=BC=8CpresetDataVersi?= =?UTF-8?q?on=20=E2=86=92=2085=20(#71)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opus 5 是 Anthropic Opus 系列当前旗舰(1M 上下文 / 128K 输出 / $5·$25 per MTok, 与 Opus 4.8 同价),此前 config-center 完全缺失,用户在模型选择器里看不到它。 变更: - compute/providers/anthropic.json:新增 claude-opus-5(排在 fable-5 之后、 opus-4-8 之前);serverSideWebSearch.fallbackPriority 顺延重排 - compute/providers/anthropic-claude.json:Claude 订阅 provider 同步新增 claude-opus-5 - compute/model-specs/anthropic.json:补 claude-opus-5 与 claude-sonnet-5 规格 (sonnet-5 此前只有 provider 条目、没有规格) - 补 extra.reasoning.supportedEfforts:客户端 parseReasoningEffortConfig 只读 extra.reasoning,原有的顶层 extra.defaultEffort 不被消费,导致 Claude 模型的 effort 档位在 UI 上始终不可选。按各模型实际支持声明档位(sonnet-4-6 无 xhigh) - __tests__/validate.test.mjs:WebSearch 允许名单登记 claude-opus-5 - manifest.json:presetDataVersion 84 → 85 --- __tests__/validate.test.mjs | 1 + compute/model-specs/anthropic.json | 28 ++++++ compute/providers/anthropic-claude.json | 73 +++++++++++++++ compute/providers/anthropic.json | 112 ++++++++++++++++++++++-- manifest.json | 2 +- 5 files changed, 209 insertions(+), 7 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 999e048..3b1a324 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -113,6 +113,7 @@ describe('真实数据全量校验', () => { assert.deepEqual(enabled(anthropic), [ 'claude-fable-5', + 'claude-opus-5', 'claude-opus-4-8', 'claude-sonnet-5', 'claude-opus-4-7', diff --git a/compute/model-specs/anthropic.json b/compute/model-specs/anthropic.json index 8314569..70bc816 100644 --- a/compute/model-specs/anthropic.json +++ b/compute/model-specs/anthropic.json @@ -15,6 +15,20 @@ "description": "Anthropic 最强模型,基于 Mythos 架构,支持自主知识工作" } }, + { + "id": "claude-opus-5", + "displayName": "Claude Opus 5", + "family": "claude-opus", + "match": { "patterns": ["claude-opus-5*"] }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": ["chat", "reasoning", "code", "vision", "tool_use", "long_context"], + "serviceType": ["chat"], + "supportsReasoning": true, + "description": "Claude Opus 5,Anthropic Opus 系列当前旗舰;思考默认开启,effort 支持到 max" + } + }, { "id": "claude-opus-4-8", "displayName": "Claude Opus 4.8", @@ -44,6 +58,20 @@ "description": "Anthropic 当前最强通用模型,适合复杂推理和智能体编码任务" } }, + { + "id": "claude-sonnet-5", + "displayName": "Claude Sonnet 5", + "family": "claude-sonnet", + "match": { "patterns": ["claude-sonnet-5*"] }, + "spec": { + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": ["chat", "reasoning", "code", "vision", "tool_use", "computer_use", "long_context"], + "serviceType": ["chat"], + "supportsReasoning": true, + "description": "Claude Sonnet 5,速度与智能平衡;思考默认开启,effort 支持到 max" + } + }, { "id": "claude-sonnet-4-6", "displayName": "Claude Sonnet 4.6", diff --git a/compute/providers/anthropic-claude.json b/compute/providers/anthropic-claude.json index 4f909c5..88c06a0 100644 --- a/compute/providers/anthropic-claude.json +++ b/compute/providers/anthropic-claude.json @@ -43,6 +43,53 @@ "agent", "long_context" ], + "extra": { + "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + } + }, + "source": "preset" + }, + { + "modelName": "claude-opus-5", + "displayName": "Claude Opus 5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,Opus 系列当前旗舰,复杂智能体编码与长程任务首选,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "extra": { + "adaptiveThinking": true, + "thinkingOnByDefault": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + } + }, "source": "preset" }, { @@ -63,6 +110,19 @@ "agent", "long_context" ], + "extra": { + "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + } + }, "source": "preset" }, { @@ -83,6 +143,19 @@ "agent", "long_context" ], + "extra": { + "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + } + }, "source": "preset" }, { diff --git a/compute/providers/anthropic.json b/compute/providers/anthropic.json index 7427de3..9cb52b7 100644 --- a/compute/providers/anthropic.json +++ b/compute/providers/anthropic.json @@ -48,6 +48,67 @@ "read": 1 }, "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + }, + "samplingParametersDeprecated": true, + "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." + } + }, + { + "modelName": "claude-opus-5", + "displayName": "Claude Opus 5", + "serviceType": [ + "chat" + ], + "description": "Anthropic Opus 系列当前旗舰,复杂智能体编码与长程任务能力显著强于 Opus 4.8,价格不变,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "inputPrice": 5, + "outputPrice": 25, + "extra": { + "serverSideWebSearch": { + "enabled": true, + "dialect": "anthropic-messages", + "fallbackPriority": 2, + "searchRequestPriceUsd": 0.01, + "toolType": "web_search_20260318" + }, + "cachePricing": { + "write5m": 6.25, + "write1h": 10, + "read": 0.5 + }, + "promptCacheMinTokens": 512, + "adaptiveThinking": true, + "thinkingOnByDefault": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + }, + "defaultEffort": "high", "samplingParametersDeprecated": true, "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." } @@ -76,7 +137,7 @@ "serverSideWebSearch": { "enabled": true, "dialect": "anthropic-messages", - "fallbackPriority": 2, + "fallbackPriority": 3, "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, @@ -86,6 +147,16 @@ "read": 0.5 }, "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + }, "defaultEffort": "high", "samplingParametersDeprecated": true, "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." @@ -117,7 +188,7 @@ "serverSideWebSearch": { "enabled": true, "dialect": "anthropic-messages", - "fallbackPriority": 3, + "fallbackPriority": 4, "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, @@ -131,6 +202,16 @@ "standardInputPrice": 3, "standardOutputPrice": 15, "adaptiveThinking": true, + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + }, "defaultEffort": "high", "samplingParametersDeprecated": true } @@ -157,7 +238,7 @@ "serverSideWebSearch": { "enabled": true, "dialect": "anthropic-messages", - "fallbackPriority": 4, + "fallbackPriority": 5, "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, @@ -166,7 +247,17 @@ "write1h": 10, "read": 0.5 }, - "pricingNotes": "Prices are per 1M tokens. Opus 4.7 includes the full 1M context window at standard pricing." + "pricingNotes": "Prices are per 1M tokens. Opus 4.7 includes the full 1M context window at standard pricing.", + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultEffort": "high" + } } }, { @@ -194,7 +285,7 @@ "serverSideWebSearch": { "enabled": true, "dialect": "anthropic-messages", - "fallbackPriority": 5, + "fallbackPriority": 6, "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, @@ -203,7 +294,16 @@ "write1h": 6, "read": 0.3 }, - "pricingNotes": "Prices are per 1M tokens. Sonnet 4.6 includes the full 1M context window at standard pricing." + "pricingNotes": "Prices are per 1M tokens. Sonnet 4.6 includes the full 1M context window at standard pricing.", + "reasoning": { + "supportedEfforts": [ + "low", + "medium", + "high", + "max" + ], + "defaultEffort": "high" + } } }, { diff --git a/manifest.json b/manifest.json index 1eb1703..f064f31 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 84, + "presetDataVersion": 85, "updatedAt": "2026-08-08", "description": "DesireCore 官方配置中心" } From 7832ae26a9a51b0b985e7650016e8655e565a6ef Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 8 Aug 2026 18:44:57 +0800 Subject: [PATCH 07/10] =?UTF-8?q?feat(compute):=20=E4=B8=8B=E7=BA=BF=20Opu?= =?UTF-8?q?s=204.8=20/=20Opus=204.7=20/=20Sonnet=204.6=EF=BC=8CpresetDataV?= =?UTF-8?q?ersion=20=E2=86=92=2086=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anthropic provider 保留 Fable 5 / Opus 5 / Sonnet 5 / Haiku 4.5;Claude 订阅 provider 保留 Fable 5 / Opus 5 / Sonnet 5 / Haiku 4.5。 三个模型同时写入 provider.tombstones —— 仅从 models 数组删除只会触发 deprecated 软降级(保留本地数据),写入 tombstones 才是真删除,且客户端 resolver 的 resolveMappingModel() 只对 tombstone 模型执行「回退到同 serviceType 的其他可用 模型」,未 tombstone 的缺失模型会原样透传。因此写 tombstones 才能让存量会话平滑 迁移到 Opus 5,而不是继续指向一个已消失的模型名。 model-specs/anthropic.json 中三者的规格条目保留:规格库按 model_name 匹配任意 上游(含 OpenRouter 风格 vendor 前缀),与 provider 清单解耦——该文件本来就有 claude-sonnet-4-5 这类无 provider 条目的规格。删除会让经其他网关访问这些模型的 用户丢失上下文窗口/能力元数据。 用户侧 user-added / synced / ollama-discovery 来源的同名模型不受 tombstones 影响。 --- __tests__/validate.test.mjs | 3 - compute/providers/anthropic-claude.json | 36 +----- compute/providers/anthropic.json | 146 +----------------------- manifest.json | 2 +- 4 files changed, 10 insertions(+), 177 deletions(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 3b1a324..a6aec77 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -114,10 +114,7 @@ describe('真实数据全量校验', () => { assert.deepEqual(enabled(anthropic), [ 'claude-fable-5', 'claude-opus-5', - 'claude-opus-4-8', 'claude-sonnet-5', - 'claude-opus-4-7', - 'claude-sonnet-4-6', ]) assert.deepEqual(enabled(openai), [ 'gpt-5.5', diff --git a/compute/providers/anthropic-claude.json b/compute/providers/anthropic-claude.json index 88c06a0..f480fce 100644 --- a/compute/providers/anthropic-claude.json +++ b/compute/providers/anthropic-claude.json @@ -92,39 +92,6 @@ }, "source": "preset" }, - { - "modelName": "claude-opus-4-8", - "displayName": "Claude Opus 4.8", - "serviceType": [ - "chat" - ], - "description": "Claude 订阅额度计费,Opus 级复杂智能体编码与企业任务模型,1M 上下文", - "contextWindow": 1000000, - "maxOutputTokens": 128000, - "capabilities": [ - "chat", - "reasoning", - "code", - "vision", - "tool_use", - "agent", - "long_context" - ], - "extra": { - "adaptiveThinking": true, - "reasoning": { - "supportedEfforts": [ - "low", - "medium", - "high", - "xhigh", - "max" - ], - "defaultEffort": "high" - } - }, - "source": "preset" - }, { "modelName": "claude-sonnet-5", "displayName": "Claude Sonnet 5", @@ -175,5 +142,8 @@ ], "source": "preset" } + ], + "tombstones": [ + "claude-opus-4-8" ] } diff --git a/compute/providers/anthropic.json b/compute/providers/anthropic.json index 9cb52b7..0a702f5 100644 --- a/compute/providers/anthropic.json +++ b/compute/providers/anthropic.json @@ -113,55 +113,6 @@ "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." } }, - { - "modelName": "claude-opus-4-8", - "displayName": "Claude Opus 4.8", - "serviceType": [ - "chat" - ], - "description": "Anthropic Opus 级复杂智能体编码与企业任务模型,1M 上下文", - "contextWindow": 1000000, - "maxOutputTokens": 128000, - "capabilities": [ - "chat", - "reasoning", - "code", - "vision", - "tool_use", - "agent", - "long_context" - ], - "inputPrice": 5, - "outputPrice": 25, - "extra": { - "serverSideWebSearch": { - "enabled": true, - "dialect": "anthropic-messages", - "fallbackPriority": 3, - "searchRequestPriceUsd": 0.01, - "toolType": "web_search_20260318" - }, - "cachePricing": { - "write5m": 6.25, - "write1h": 10, - "read": 0.5 - }, - "adaptiveThinking": true, - "reasoning": { - "supportedEfforts": [ - "low", - "medium", - "high", - "xhigh", - "max" - ], - "defaultEffort": "high" - }, - "defaultEffort": "high", - "samplingParametersDeprecated": true, - "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." - } - }, { "modelName": "claude-sonnet-5", "displayName": "Claude Sonnet 5", @@ -188,7 +139,7 @@ "serverSideWebSearch": { "enabled": true, "dialect": "anthropic-messages", - "fallbackPriority": 4, + "fallbackPriority": 3, "searchRequestPriceUsd": 0.01, "toolType": "web_search_20260318" }, @@ -216,96 +167,6 @@ "samplingParametersDeprecated": true } }, - { - "modelName": "claude-opus-4-7", - "displayName": "Claude Opus 4.7", - "serviceType": [ - "chat" - ], - "description": "Anthropic 当前最强通用模型,适合复杂推理和智能体编码任务", - "contextWindow": 1000000, - "maxOutputTokens": 128000, - "capabilities": [ - "chat", - "reasoning", - "code", - "vision", - "tool_use" - ], - "inputPrice": 5, - "outputPrice": 25, - "extra": { - "serverSideWebSearch": { - "enabled": true, - "dialect": "anthropic-messages", - "fallbackPriority": 5, - "searchRequestPriceUsd": 0.01, - "toolType": "web_search_20260318" - }, - "cachePricing": { - "write5m": 6.25, - "write1h": 10, - "read": 0.5 - }, - "pricingNotes": "Prices are per 1M tokens. Opus 4.7 includes the full 1M context window at standard pricing.", - "reasoning": { - "supportedEfforts": [ - "low", - "medium", - "high", - "xhigh", - "max" - ], - "defaultEffort": "high" - } - } - }, - { - "modelName": "claude-sonnet-4-6", - "displayName": "Claude Sonnet 4.6", - "serviceType": [ - "chat", - "computer_use" - ], - "description": "Anthropic 高智能高速度模型,适合编码、工具使用和智能体任务", - "contextWindow": 1000000, - "maxOutputTokens": 64000, - "capabilities": [ - "chat", - "reasoning", - "code", - "vision", - "tool_use", - "computer_use" - ], - "inputPrice": 3, - "outputPrice": 15, - "defaultTemperature": 1, - "extra": { - "serverSideWebSearch": { - "enabled": true, - "dialect": "anthropic-messages", - "fallbackPriority": 6, - "searchRequestPriceUsd": 0.01, - "toolType": "web_search_20260318" - }, - "cachePricing": { - "write5m": 3.75, - "write1h": 6, - "read": 0.3 - }, - "pricingNotes": "Prices are per 1M tokens. Sonnet 4.6 includes the full 1M context window at standard pricing.", - "reasoning": { - "supportedEfforts": [ - "low", - "medium", - "high", - "max" - ], - "defaultEffort": "high" - } - } - }, { "modelName": "claude-haiku-4-5", "displayName": "Claude Haiku 4.5", @@ -335,5 +196,10 @@ "pricingNotes": "Prices are per 1M tokens." } } + ], + "tombstones": [ + "claude-opus-4-8", + "claude-opus-4-7", + "claude-sonnet-4-6" ] } diff --git a/manifest.json b/manifest.json index f064f31..424ba1e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 85, + "presetDataVersion": 86, "updatedAt": "2026-08-08", "description": "DesireCore 官方配置中心" } From 78ed93f127042b176fdea11d7e12e942b2e31154 Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 8 Aug 2026 18:52:31 +0800 Subject: [PATCH 08/10] =?UTF-8?q?feat(compute):=20Claude=20=E7=B3=BB?= =?UTF-8?q?=E5=88=97=20defaultEffort=20=E7=BB=9F=E4=B8=80=E4=B8=BA=20xhigh?= =?UTF-8?q?=EF=BC=8CpresetDataVersion=20=E2=86=92=2087=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anthropic 对 Fable 5 / Opus 5 / Sonnet 5 的建议是编程与智能体场景用 xhigh (Claude Code 自身默认即 xhigh),而此前沿用的是 API 默认值 high。DesireCore 是智能体操作系统,主力场景就是编程与长程智能体任务,故对齐到 xhigh。 两个 Anthropic provider 的 fable-5 / opus-5 / sonnet-5 同步调整, extra.reasoning.defaultEffort 与顶层文档性 extra.defaultEffort 保持一致。 Haiku 4.5 不支持 effort 参数,无 reasoning 声明,不受影响。 注意:这会抬高默认 token 消耗;用户仍可在模型选择器按会话下调档位。 OpenAI Codex 的 per-model defaultEffort(low/medium/medium)是按模型分别调过的, 不属于本次对齐范围。 --- compute/providers/anthropic-claude.json | 6 +++--- compute/providers/anthropic.json | 10 +++++----- manifest.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compute/providers/anthropic-claude.json b/compute/providers/anthropic-claude.json index f480fce..8c7e2fb 100644 --- a/compute/providers/anthropic-claude.json +++ b/compute/providers/anthropic-claude.json @@ -53,7 +53,7 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" } }, "source": "preset" @@ -87,7 +87,7 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" } }, "source": "preset" @@ -120,7 +120,7 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" } }, "source": "preset" diff --git a/compute/providers/anthropic.json b/compute/providers/anthropic.json index 0a702f5..9250101 100644 --- a/compute/providers/anthropic.json +++ b/compute/providers/anthropic.json @@ -56,7 +56,7 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" }, "samplingParametersDeprecated": true, "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." @@ -106,9 +106,9 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" }, - "defaultEffort": "high", + "defaultEffort": "xhigh", "samplingParametersDeprecated": true, "pricingNotes": "Prices are per 1M tokens. Full 1M context is billed at standard pricing." } @@ -161,9 +161,9 @@ "xhigh", "max" ], - "defaultEffort": "high" + "defaultEffort": "xhigh" }, - "defaultEffort": "high", + "defaultEffort": "xhigh", "samplingParametersDeprecated": true } }, diff --git a/manifest.json b/manifest.json index 424ba1e..e9e9fc7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 86, + "presetDataVersion": 87, "updatedAt": "2026-08-08", "description": "DesireCore 官方配置中心" } From d6f939af523de6ee02d68448b80eab04228a6dd9 Mon Sep 17 00:00:00 2001 From: Yige Date: Mon, 10 Aug 2026 17:03:06 +0800 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20=E4=B8=8B=E5=8F=91=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E8=B7=AF=E7=94=B1=E6=A8=A1=E5=9E=8B=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=20(#74)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +- __tests__/validate.test.mjs | 65 ++ compute/smart-routing/model-catalog.json | 1099 ++++++++++++++++++++++ manifest.json | 4 +- schemas/smart-model-catalog.schema.json | 273 ++++++ scripts/validate.mjs | 1 + 6 files changed, 1454 insertions(+), 3 deletions(-) create mode 100644 compute/smart-routing/model-catalog.json create mode 100644 schemas/smart-model-catalog.schema.json diff --git a/README.md b/README.md index a9916de..c629167 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ PR #1 曾把 reasoning 模型的 `defaultTemperature` / `defaultTopP` 写为 `nu | `provider.schema.json` | `compute/providers/*.json`、`compute/coding-plans/*.json` | `defaultTemperature`/`defaultTopP` 必须是 number,禁止 null/string;`additionalProperties: false` | | `manifest.schema.json` | `manifest.json` | `presetDataVersion` 必须是递增整数 | | `service-map.schema.json` | `compute/service-map.json` | 每条映射须含 `modelName` + `providerId` | +| `smart-model-catalog.schema.json` | `compute/smart-routing/model-catalog.json` | 智能路由三档量级、接入面、exact model 能力和稳定优先级 | | `providers-index.schema.json` | 两个 `_index.json` | `order` 数组无重复 | | `pricing.schema.json` | `compute/pricing.json` | `markupRatio` / `usdToCny` 为正数 | @@ -62,6 +63,17 @@ PR #1 曾把 reasoning 模型的 `defaultTemperature` / `defaultTopP` 写为 `nu 否则老客户端会因未知字段校验失败死锁。 +### 智能路由目录的边界 + +`compute/smart-routing/model-catalog.json` 是路由器直接消费的、按接入面核对过的策略快照: + +- `tier`、`routingPriority`、`eligibleForAgent` 和 `defaultReference` 属于路由策略; +- `capabilities`、上下文和 reasoning 是该 `providerId + model` 接入面的可用能力快照; +- 它不声明 API key、baseUrl、登录状态、用户额度或实时计价;`desirecore-cloud` 的连接与计费状态仍由登录后的 Provider 接口动态下发; +- Codex、Claude 条目必须能在对应 `compute/providers/*.json` 中按 exact model 找到,测试会阻止已下线模型继续参与路由。 + +客户端把本文件作为可热更新主数据源,并保留同 Schema 的内置离线兜底。调整 Provider 或 model-spec 的能力事实时,应同步审阅本目录,避免路由快照漂移。 + --- ## 本地校验 @@ -78,7 +90,7 @@ CI(GitHub Actions)会在每个 PR 自动运行 `validate` 和 `test`,不 ## 数据修改流程 -1. 编辑 `compute/providers/.json`、`compute/coding-plans/.json` 或 `compute/service-map.json` +1. 编辑 `compute/providers/.json`、`compute/coding-plans/.json`、`compute/service-map.json` 或 `compute/smart-routing/model-catalog.json` 2. 编辑 `compute/providers/_index.json` 或 `coding-plans/_index.json`(新增/删除 provider 时) 3. **必须**递增 `manifest.json#presetDataVersion`,并更新 `updatedAt` 4. `npm run validate` 本地确认通过 @@ -95,3 +107,4 @@ CI(GitHub Actions)会在每个 PR 自动运行 `validate` 和 `test`,不 - **构建期同步**:`npm run sync-config-center` 把数据复制到 desirecore 主仓 `lib/agent-service/defaults/` - **运行时同步**:客户端启动后后台 git fetch 本仓库,每 30 分钟检查一次远程更新 - **版本比对**:`presetDataVersion`(递增整数)+ digest(SHA-256)双重校验 +- **智能路由目录**:新客户端按文件 mtime 热加载 `compute/smart-routing/model-catalog.json`;缺失或校验失败时使用随客户端发布的内置 JSON diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index a6aec77..cb3f871 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -85,6 +85,49 @@ describe('真实数据全量校验', () => { assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) }) + it('智能路由模型目录应通过 smart-model-catalog schema', () => { + const result = validateFile( + join(ROOT, 'compute', 'smart-routing', 'model-catalog.json'), + validators, + ) + assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) + + const catalog = JSON.parse(readFileSync( + join(ROOT, 'compute', 'smart-routing', 'model-catalog.json'), + 'utf8', + )) + assert.deepEqual(catalog.tiers.map((tier) => tier.id), [ + 'flagship', + 'balanced', + 'lightweight', + ]) + assert.deepEqual(catalog.providers.map((provider) => provider.provider), [ + 'openai-codex', + 'anthropic-claude', + 'desirecore-cloud', + ]) + assert.equal( + catalog.providers.flatMap((provider) => provider.models).length, + 37, + ) + + for (const provider of catalog.providers.filter((item) => item.provider !== 'desirecore-cloud')) { + const providerFile = JSON.parse(readFileSync( + join(ROOT, 'compute', 'providers', `${provider.provider}.json`), + 'utf8', + )) + assert.equal(providerFile.id, provider.providerId) + const publishedModels = new Set(providerFile.models.map((model) => model.modelName)) + for (const model of provider.models) { + assert.equal( + publishedModels.has(model.model), + true, + `${provider.providerId}/${model.model} 必须存在于对应接入面 Provider 清单`, + ) + } + } + }) + it('两个 _index.json 应通过 providers-index schema', () => { const r1 = validateFile(join(ROOT, 'compute', 'providers', '_index.json'), validators) const r2 = validateFile(join(ROOT, 'compute', 'coding-plans', '_index.json'), validators) @@ -304,6 +347,28 @@ describe('真实数据全量校验', () => { }) }) +describe('智能路由模型目录 schema 反例', () => { + const validate = compile('smart-model-catalog') + + it('拒绝未声明的策略字段,避免新旧客户端静默分叉', () => { + const data = JSON.parse(readFileSync( + join(ROOT, 'compute', 'smart-routing', 'model-catalog.json'), + 'utf8', + )) + data.providers[0].models[0].unknownRoutingPolicy = true + assert.equal(validate(data), false) + }) + + it('拒绝当前客户端未声明支持的目录版本', () => { + const data = JSON.parse(readFileSync( + join(ROOT, 'compute', 'smart-routing', 'model-catalog.json'), + 'utf8', + )) + data.version = 2 + assert.equal(validate(data), false) + }) +}) + // ==================== Runtime 清单反例 ==================== describe('runtime-recommended schema 反例', () => { diff --git a/compute/smart-routing/model-catalog.json b/compute/smart-routing/model-catalog.json new file mode 100644 index 0000000..c8e230b --- /dev/null +++ b/compute/smart-routing/model-catalog.json @@ -0,0 +1,1099 @@ +{ + "$schema": "https://desirecore.net/schemas/smart-model-catalog.json", + "version": 1, + "updatedAt": "2026-08-09T13:45:49.000Z", + "source": "config-center", + "tiers": [ + { + "id": "flagship", + "label": "旗舰", + "labelEn": "Flagship", + "description": "最高能力,优先用于复杂推理、关键交付和长程智能体任务。", + "defaultReasoning": "high" + }, + { + "id": "balanced", + "label": "均衡", + "labelEn": "Balanced", + "description": "质量、速度与成本平衡,适合大多数日常任务。", + "defaultReasoning": "medium" + }, + { + "id": "lightweight", + "label": "轻量", + "labelEn": "Lightweight", + "description": "优先低延迟与低成本,适合明确、短链路和批量任务。", + "defaultReasoning": "low" + } + ], + "providers": [ + { + "providerId": "provider-openai-codex-plan-001", + "provider": "openai-codex", + "displayName": "ChatGPT 订阅 (Codex)", + "models": [ + { + "model": "gpt-5.6-sol", + "displayName": "GPT-5.6 Sol", + "tier": "flagship", + "routingPriority": 10, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "agent" + ], + "contextWindow": 1050000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "low", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.6-terra", + "displayName": "GPT-5.6 Terra", + "tier": "balanced", + "routingPriority": 10, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "agent" + ], + "contextWindow": 1050000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.6-luna", + "displayName": "GPT-5.6 Luna", + "tier": "lightweight", + "routingPriority": 10, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "fast" + ], + "contextWindow": 1050000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.5", + "displayName": "GPT-5.5", + "tier": "flagship", + "routingPriority": 60, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "agent" + ], + "contextWindow": 1050000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.4", + "displayName": "GPT-5.4", + "tier": "balanced", + "routingPriority": 60, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "agent" + ], + "contextWindow": 1050000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.4-mini", + "displayName": "GPT-5.4 Mini", + "tier": "lightweight", + "routingPriority": 25, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "long_context", + "tool_use", + "fast" + ], + "contextWindow": 400000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "low", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "gpt-5.3-codex-spark", + "displayName": "GPT-5.3 Codex Spark(Pro 专属)", + "tier": "lightweight", + "routingPriority": 30, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "code", + "tool_use", + "fast" + ], + "contextWindow": 128000, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": true, + "defaultReference": false + } + ] + }, + { + "providerId": "provider-anthropic-claude-plan-001", + "provider": "anthropic-claude", + "displayName": "Claude 订阅 (Claude Code)", + "models": [ + { + "model": "claude-fable-5", + "displayName": "Claude Fable 5", + "tier": "flagship", + "routingPriority": 20, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "xhigh", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "claude-opus-5", + "displayName": "Claude Opus 5", + "tier": "flagship", + "routingPriority": 25, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "xhigh", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "claude-sonnet-5", + "displayName": "Claude Sonnet 5", + "tier": "balanced", + "routingPriority": 20, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "defaultReasoning": "xhigh", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "claude-haiku-4-5", + "displayName": "Claude Haiku 4.5", + "tier": "lightweight", + "routingPriority": 20, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "code", + "vision", + "tool_use" + ], + "contextWindow": 200000, + "maxOutputTokens": 64000, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": true, + "defaultReference": false + } + ] + }, + { + "providerId": "desirecore-cloud", + "provider": "desirecore-cloud", + "displayName": "官方算力", + "models": [ + { + "model": "wan2.7-image-pro", + "displayName": "通义万相 2.7 Pro", + "tier": "flagship", + "routingPriority": 100, + "serviceTypes": [ + "image_gen" + ], + "capabilities": [ + "chat", + "image_generation", + "chinese_optimized", + "high_quality" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "MiniMax-Hailuo-2.3-fast", + "displayName": "海螺视频 2.3 快速版", + "tier": "lightweight", + "routingPriority": 101, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "image_to_video", + "camera_control", + "fast", + "chinese_optimized" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "MiniMax-Hailuo-2.3", + "displayName": "海螺视频 2.3", + "tier": "balanced", + "routingPriority": 102, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "text_to_video", + "image_to_video", + "camera_control", + "chinese_optimized", + "high_quality" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "mimo-v2.5-pro", + "displayName": "MiMo V2.5 Pro", + "tier": "flagship", + "routingPriority": 50, + "serviceTypes": [ + "chat", + "reasoning" + ], + "capabilities": [ + "chat", + "reasoning", + "tool_use", + "code" + ], + "contextWindow": 1000000, + "maxOutputTokens": 131072, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "qwen3.7-plus", + "displayName": "Qwen3.7 Plus", + "tier": "balanced", + "routingPriority": 35, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "multilingual", + "tool_use", + "long_context" + ], + "contextWindow": 1000000, + "maxOutputTokens": 65536, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "mimo-v2.5", + "displayName": "MiMo V2.5", + "tier": "lightweight", + "routingPriority": 40, + "serviceTypes": [ + "chat", + "vision" + ], + "capabilities": [ + "chat", + "reasoning", + "vision", + "tool_use", + "code" + ], + "contextWindow": 1000000, + "maxOutputTokens": 131072, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "low", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "MiniMax-M3", + "displayName": "MiniMax M3", + "tier": "balanced", + "routingPriority": 30, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "video_understanding", + "tool_use", + "long_context" + ], + "contextWindow": 1048576, + "maxOutputTokens": 512000, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "wan2.7-image", + "displayName": "通义万相 2.7", + "tier": "balanced", + "routingPriority": 107, + "serviceTypes": [ + "image_gen" + ], + "capabilities": [ + "chat", + "image_generation", + "chinese_optimized" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "glm-5.1", + "displayName": "GLM-5.1", + "tier": "balanced", + "routingPriority": 65, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "multilingual", + "deep_thinking", + "long_context", + "math", + "tool_use", + "agent" + ], + "contextWindow": 200000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "deepseek-v4-flash", + "displayName": "DeepSeek V4 Flash", + "tier": "lightweight", + "routingPriority": 35, + "serviceTypes": [ + "chat", + "reasoning" + ], + "capabilities": [ + "chat", + "code", + "reasoning", + "deep_thinking", + "multilingual", + "tool_use" + ], + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "supportedReasoning": [ + "auto", + "high", + "max" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "deepseek-v4-pro", + "displayName": "DeepSeek V4 Pro", + "tier": "flagship", + "routingPriority": 30, + "serviceTypes": [ + "chat", + "reasoning" + ], + "capabilities": [ + "chat", + "reasoning", + "deep_thinking", + "code", + "math", + "science", + "multilingual", + "tool_use" + ], + "contextWindow": 1000000, + "maxOutputTokens": 384000, + "supportedReasoning": [ + "auto", + "high", + "max" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": true + }, + { + "model": "kimi-k2.6", + "displayName": "Kimi K2.6", + "tier": "balanced", + "routingPriority": 45, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "tool_use", + "agent", + "long_context", + "vision" + ], + "contextWindow": 262144, + "maxOutputTokens": 16384, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "kimi-k2.7-code", + "displayName": "Kimi K2.7 Code", + "tier": "balanced", + "routingPriority": 50, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "code", + "vision", + "tool_use" + ], + "contextWindow": 262144, + "maxOutputTokens": 16384, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "image-01", + "displayName": "MiniMax Image 01", + "tier": "balanced", + "routingPriority": 113, + "serviceTypes": [ + "image_gen" + ], + "capabilities": [ + "chat", + "image_generation", + "subject_reference", + "chinese_optimized" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "mimo-v2.5-tts", + "displayName": "MiMo V2.5 TTS", + "tier": "lightweight", + "routingPriority": 114, + "serviceTypes": [ + "tts" + ], + "capabilities": [ + "chat", + "tts", + "multilingual", + "style_control" + ], + "contextWindow": 8192, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "happyhorse-1.1-i2v", + "displayName": "HappyHorse 1.1 I2V", + "tier": "flagship", + "routingPriority": 115, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "image_to_video", + "high_quality" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "happyhorse-1.1-t2v", + "displayName": "HappyHorse 1.1 T2V", + "tier": "flagship", + "routingPriority": 116, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "text_to_video", + "high_quality" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "happyhorse-1.1-r2v", + "displayName": "HappyHorse 1.1 R2V", + "tier": "flagship", + "routingPriority": 117, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "reference_to_video", + "multi_image", + "high_quality" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "doubao-seedance-2.0-mini", + "displayName": "Seedance 2.0 Mini", + "tier": "lightweight", + "routingPriority": 118, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "image_to_video", + "text_to_video", + "video_editing", + "video_extension", + "audio_generation", + "first_last_frame", + "fast", + "cost_effective" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "doubao-seedance-2.0-fast", + "displayName": "Seedance 2.0 Fast", + "tier": "balanced", + "routingPriority": 119, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "image_to_video", + "text_to_video", + "video_editing", + "video_extension", + "audio_generation", + "first_last_frame", + "fast" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "doubao-seedance-2.0", + "displayName": "Seedance 2.0", + "tier": "flagship", + "routingPriority": 120, + "serviceTypes": [ + "video_gen" + ], + "capabilities": [ + "chat", + "video_generation", + "image_to_video", + "text_to_video", + "video_editing", + "video_extension", + "audio_generation", + "first_last_frame" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "glm-5.2", + "displayName": "GLM-5.2", + "tier": "flagship", + "routingPriority": 45, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "deep_thinking", + "code", + "multilingual", + "tool_use", + "long_context" + ], + "contextWindow": 1048576, + "maxOutputTokens": 32768, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "kimi-k3", + "displayName": "Kimi K3", + "tier": "flagship", + "routingPriority": 35, + "serviceTypes": [ + "reasoning" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "tool_use", + "agent", + "long_context", + "vision" + ], + "contextWindow": 1048576, + "maxOutputTokens": 131072, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "mimo-v2.5-asr", + "displayName": "MiMo V2.5 ASR", + "tier": "lightweight", + "routingPriority": 123, + "serviceTypes": [ + "asr" + ], + "capabilities": [ + "chat", + "asr", + "multilingual" + ], + "contextWindow": null, + "maxOutputTokens": null, + "supportedReasoning": [ + "auto" + ], + "defaultReasoning": "auto", + "eligibleForAgent": false, + "defaultReference": false + }, + { + "model": "qwen3.8-max-preview", + "displayName": "Qwen3.8 Max Preview", + "tier": "flagship", + "routingPriority": 40, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "multilingual", + "tool_use", + "long_context", + "agent", + "vision" + ], + "contextWindow": 1000000, + "maxOutputTokens": 65536, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "high", + "eligibleForAgent": true, + "defaultReference": false + }, + { + "model": "doubao-seed-2.1-turbo", + "displayName": "Doubao Seed 2.1 Turbo", + "tier": "balanced", + "routingPriority": 40, + "serviceTypes": [ + "chat" + ], + "capabilities": [ + "chat", + "reasoning", + "code", + "multilingual", + "long_context", + "tool_use", + "vision" + ], + "contextWindow": 256000, + "maxOutputTokens": 128000, + "supportedReasoning": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "defaultReasoning": "medium", + "eligibleForAgent": true, + "defaultReference": false + } + ] + } + ] +} diff --git a/manifest.json b/manifest.json index e9e9fc7..6caed51 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 87, - "updatedAt": "2026-08-08", + "presetDataVersion": 88, + "updatedAt": "2026-08-10", "description": "DesireCore 官方配置中心" } diff --git a/schemas/smart-model-catalog.schema.json b/schemas/smart-model-catalog.schema.json new file mode 100644 index 0000000..b7ee989 --- /dev/null +++ b/schemas/smart-model-catalog.schema.json @@ -0,0 +1,273 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://desirecore.net/schemas/smart-model-catalog.json", + "title": "SmartModelCatalog", + "description": "智能路由量级、Provider 和模型能力目录;Config Center、内置兜底与未来接口共用此契约。", + "type": "object", + "required": [ + "version", + "updatedAt", + "source", + "tiers", + "providers" + ], + "properties": { + "$schema": { + "type": "string", + "description": "本数据对应的 JSON Schema 标识。" + }, + "version": { + "type": "integer", + "minimum": 1, + "maximum": 1, + "description": "目录结构版本;当前客户端只接受 v1,不兼容的新语义必须递增版本并由新客户端接入。" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "本目录最近一次人工/自动核对时间。" + }, + "source": { + "type": "string", + "enum": [ + "builtin", + "config-center", + "provider-api" + ], + "description": "目录来源:config-center=配置中心下发,builtin=客户端离线兜底,provider-api=未来接口实时数据。" + }, + "tiers": { + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": { + "type": "object", + "required": [ + "id", + "label", + "labelEn", + "description", + "defaultReasoning" + ], + "properties": { + "id": { + "type": "string", + "enum": [ + "flagship", + "balanced", + "lightweight" + ], + "description": "智能路由量级:flagship=最高能力,balanced=质量与成本平衡,lightweight=最快最省。" + }, + "label": { + "type": "string", + "minLength": 1, + "description": "中文量级标签。" + }, + "labelEn": { + "type": "string", + "minLength": 1, + "description": "英文量级标签。" + }, + "description": { + "type": "string", + "minLength": 1, + "description": "该量级的任务选择目标。" + }, + "defaultReasoning": { + "type": "string", + "enum": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "description": "该量级在模型支持时优先采用的默认思考深度。" + } + }, + "additionalProperties": false + }, + "description": "三档量级的自描述定义。" + }, + "providers": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": [ + "providerId", + "provider", + "displayName", + "models" + ], + "properties": { + "providerId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "description": "compute.json 中的 Provider 唯一 ID。" + }, + "provider": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "Provider 协议标识。" + }, + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "description": "Provider 展示名称。" + }, + "models": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": [ + "model", + "displayName", + "tier", + "routingPriority", + "serviceTypes", + "capabilities", + "contextWindow", + "maxOutputTokens", + "supportedReasoning", + "defaultReasoning", + "eligibleForAgent", + "defaultReference" + ], + "properties": { + "model": { + "type": "string", + "minLength": 1, + "maxLength": 300, + "description": "传给对应 Provider 的真实 modelName;禁止使用 smart 等虚拟名称。" + }, + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "description": "客户端展示名称。" + }, + "tier": { + "type": "string", + "enum": [ + "flagship", + "balanced", + "lightweight" + ], + "description": "此模型在智能路由中的能力量级。" + }, + "routingPriority": { + "type": "integer", + "minimum": 0, + "maximum": 10000, + "description": "同一量级内的稳定选择顺序,数值越小越优先;凭据与硬能力校验仍先于此排序。" + }, + "serviceTypes": { + "type": "array", + "minItems": 1, + "maxItems": 16, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9_]+$", + "description": "可用于任务硬约束匹配的规范能力标签,例如 vision、code、tool_use、long_context。" + }, + "description": "模型服务类型快照,例如 chat、reasoning、image_gen、video_gen。" + }, + "capabilities": { + "type": "array", + "maxItems": 64, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-z0-9_]+$", + "description": "可用于任务硬约束匹配的规范能力标签,例如 vision、code、tool_use、long_context。" + }, + "description": "模型能力快照;任务 requiredCapabilities 必须全部命中。" + }, + "contextWindow": { + "type": [ + "integer", + "null" + ], + "minimum": 1, + "maximum": 10000000, + "description": "上下文窗口 token 数;非文本模型或未知时为 null。" + }, + "maxOutputTokens": { + "type": [ + "integer", + "null" + ], + "minimum": 1, + "maximum": 1000000, + "description": "最大输出 token 数;未知或不适用时为 null。" + }, + "supportedReasoning": { + "type": "array", + "minItems": 1, + "maxItems": 8, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "description": "本次 Run 或当前 assignment 的思考深度;最终值仍受目标 Provider × Model 能力矩阵约束。" + }, + "description": "该 Provider × Model 接入面声明的可用 reasoning 档位。" + }, + "defaultReasoning": { + "type": "string", + "enum": [ + "auto", + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "description": "未显式指定时的模型参考 reasoning;路由还会结合量级默认值并做能力协商。" + }, + "eligibleForAgent": { + "type": "boolean", + "description": "是否可作为 Agent 主模型。图像/视频生成、ASR/TTS 等专用模型为 false。" + }, + "defaultReference": { + "type": "boolean", + "description": "是否为 Provider/defaultServiceMap 给出的默认参考。它只影响同级排序,不是强制答案。" + } + }, + "additionalProperties": false + }, + "description": "该接入面当前已核对的模型目录。" + } + }, + "additionalProperties": false + }, + "description": "参与智能路由和能力匹配的 Provider 目录。" + } + }, + "additionalProperties": false +} diff --git a/scripts/validate.mjs b/scripts/validate.mjs index d872fa3..5ffb1c2 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -46,6 +46,7 @@ function pickSchemaKey(absPath) { if (rel === 'manifest.json') return 'manifest' if (rel === 'compute/pricing.json') return 'pricing' if (rel === 'compute/service-map.json') return 'service-map' + if (rel === 'compute/smart-routing/model-catalog.json') return 'smart-model-catalog' if (rel === 'compute/providers/_index.json') return 'providers-index' if (rel === 'runtimes/recommended.json') return 'runtime-recommended' if (rel === 'runtimes/versions-fallback.json') return 'runtime-versions-fallback' From ed0aeccf2985f324fea50ed889fafd5b62cc369e Mon Sep 17 00:00:00 2001 From: Johnson-LYS Date: Mon, 10 Aug 2026 17:10:47 +0800 Subject: [PATCH 10/10] feat: add qwen3.8 max preview (#67) --- __tests__/validate.test.mjs | 28 +++++++++++++++ .../coding-plans/dashscope-token-plan.json | 36 +++++++++++++++++++ manifest.json | 2 +- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index cb3f871..93a243e 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -271,6 +271,34 @@ describe('真实数据全量校验', () => { assert.equal(pro.serviceType.includes('vision'), false) }) + it('Qwen3.8 Max Preview 应在 Token Plan 中提供完整的推理与视觉规格', () => { + const tokenPlan = JSON.parse(readFileSync(join(ROOT, 'compute', 'coding-plans', 'dashscope-token-plan.json'), 'utf8')) + const specFile = JSON.parse(readFileSync(join(ROOT, 'compute', 'model-specs', 'qwen.json'), 'utf8')) + const modelId = 'qwen3.8-max-preview' + const model = tokenPlan.models.find((item) => item.modelName === modelId) + + assert.ok(model, `Token Plan 缺少 ${modelId}`) + assert.equal(model.contextWindow, 983616) + assert.equal(model.defaultTemperature, 0.6) + assert.ok(model.capabilities.includes('reasoning')) + assert.ok(model.capabilities.includes('vision')) + assert.ok(model.serviceType.includes('reasoning')) + assert.ok(model.serviceType.includes('vision')) + assert.deepEqual(model.extra.reasoning.supportedEfforts, ['low', 'high', 'xhigh']) + assert.equal(model.extra.reasoning.defaultEffort, 'xhigh') + assert.equal(model.extra.thinkingOnly, true) + assert.equal(model.extra.thinkingMaxTokens, 262144) + assert.equal(model.extra.preserveThinkingDefault, true) + assert.equal(model.extra.supportsParallelToolCalls, false) + + const specs = specFile.specs.filter((item) => item.id === modelId) + assert.equal(specs.length, 1, `model-specs 中 ${modelId} 应且仅应有一条规格`) + assert.equal(specs[0].spec.contextWindow, 1000000) + assert.equal(specs[0].spec.defaultTemperature, 0.6) + assert.equal(specs[0].spec.supportsReasoning, true) + assert.ok(specs[0].spec.capabilities.includes('vision')) + }) + it('所有 Provider 应按供应商归属计价,模型来源不覆盖供应商币种', () => { const expectedCurrencies = { anthropic: 'USD', diff --git a/compute/coding-plans/dashscope-token-plan.json b/compute/coding-plans/dashscope-token-plan.json index 01d7f6b..fa86501 100644 --- a/compute/coding-plans/dashscope-token-plan.json +++ b/compute/coding-plans/dashscope-token-plan.json @@ -26,6 +26,42 @@ } }, "models": [ + { + "modelName": "qwen3.8-max-preview", + "displayName": "Qwen3.8 Max Preview (Token Plan)", + "serviceType": [ + "chat", + "reasoning", + "vision" + ], + "description": "百炼 Token Plan,通义千问 3.8 Max 预览版,支持文本与视觉输入,始终开启深度思考", + "contextWindow": 983616, + "maxOutputTokens": 65536, + "capabilities": [ + "chat", + "reasoning", + "deep_thinking", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "defaultTemperature": 0.6, + "extra": { + "reasoning": { + "supportedEfforts": ["low", "high", "xhigh"], + "defaultEffort": "xhigh" + }, + "supportsThinking": true, + "thinkingDefault": true, + "thinkingOnly": true, + "thinkingMaxTokens": 262144, + "preserveThinkingDefault": true, + "supportsParallelToolCalls": false + }, + "source": "preset" + }, { "modelName": "qwen3.7-max", "displayName": "Qwen3.7 Max (Token Plan)", diff --git a/manifest.json b/manifest.json index 6caed51..b811b83 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 88, + "presetDataVersion": 89, "updatedAt": "2026-08-10", "description": "DesireCore 官方配置中心" }