From 6bc7bcb6787f680d733f39ec102a60d471127100 Mon Sep 17 00:00:00 2001 From: Lukin Date: Tue, 27 Oct 2026 22:37:58 +0800 Subject: [PATCH] fix: group functional lanes before vendor models Keep economy, balanced, premium first, then functional lanes, then vendor/model lanes. Preserve within-group order and routing behavior. Co-Authored-By: Codex --- config/lanes.yaml | 127 ++++++++++++----------- docs/04-routing-and-lanes.md | 4 +- implementation-notes.md | 2 +- packages/core/src/config/samples.test.ts | 15 ++- 4 files changed, 79 insertions(+), 69 deletions(-) diff --git a/config/lanes.yaml b/config/lanes.yaml index 359fb9d5..ca9dd371 100644 --- a/config/lanes.yaml +++ b/config/lanes.yaml @@ -23,7 +23,8 @@ # and lands on a deterministic json-capable model (docs/02: `*/auto` only at the # tail). -# Show economy, balanced, premium first, then the remaining lanes alphabetically. +# Show quality tiers first, functional lanes second, then vendor/model lanes. +# Preserve the existing relative order within the functional and vendor groups. # Upstream model IDs remain versioned. @@ -69,6 +70,68 @@ premium: require_tools: false require_json: false require_vision: false + +coding: + purpose: Coding-capable models for code generation / editing + # GPT-6 Astra is the flagship coding/reasoning model. The legacy `*-codex` slugs + # are not used here because the ChatGPT-account backend historically rejected them. + reasoning_effort: high + primary: gpt-astra + fallback: + - premium + - balanced + constraints: + require_tools: false + require_json: false + require_vision: false + +json: + purpose: Strict structured-output (JSON) responses + # Sol supports JSON schema on Responses. The capability filter prunes + # incompatible fallbacks and the */auto tails for strict JSON requests. + primary: gpt-sol + fallback: + - claude-sonnet + - openrouter/deepseek-v4-flash + - balanced + constraints: + require_json: true + require_tools: false + require_vision: false + +tool_use: + purpose: Reliable function / tool calling + reasoning_effort: medium + primary: gpt-astra + fallback: + - premium + constraints: + require_tools: true + require_json: false + require_vision: false + +transcription-file: + primary: bailian/qwen3-asr-flash-filetrans + fallback: [] + +transcription-short: + primary: bailian/qwen3-asr-flash + fallback: [] + +vision: + purpose: Multimodal / image understanding + # Subscription-first: Sol handles everyday vision requests; Grok + # image input has also been verified live. Claude subscriptions cover structured + # and long-context vision without automatically invoking a paid ZenMux model. + primary: gpt-sol + fallback: + - grok + - claude-sonnet + - claude-opus + constraints: + require_vision: true + require_tools: false + require_json: false bailian-speech: primary: bailian/qwen-audio-3.1-tts-flash fallback: [] @@ -139,20 +202,6 @@ claude-sonnet: require_json: false require_vision: false -coding: - purpose: Coding-capable models for code generation / editing - # GPT-6 Astra is the flagship coding/reasoning model. The legacy `*-codex` slugs - # are not used here because the ChatGPT-account backend historically rejected them. - reasoning_effort: high - primary: gpt-astra - fallback: - - premium - - balanced - constraints: - require_tools: false - require_json: false - require_vision: false - gemini-flash: purpose: Google Gemini Flash tier — fast multimodal primary: zenmux-vertex/gemini-3.5-flash @@ -357,20 +406,6 @@ grok-imagine-video-1.5-preview: require_json: false require_vision: false -json: - purpose: Strict structured-output (JSON) responses - # Sol supports JSON schema on Responses. The capability filter prunes - # incompatible fallbacks and the */auto tails for strict JSON requests. - primary: gpt-sol - fallback: - - claude-sonnet - - openrouter/deepseek-v4-flash - - balanced - constraints: - require_json: true - require_tools: false - require_vision: false - minimax-speech: primary: minimax/speech-2.8-hd fallback: [] @@ -421,40 +456,6 @@ seedream-pro: require_json: false require_vision: false -tool_use: - purpose: Reliable function / tool calling - reasoning_effort: medium - primary: gpt-astra - fallback: - - premium - constraints: - require_tools: true - require_json: false - require_vision: false - -transcription-file: - primary: bailian/qwen3-asr-flash-filetrans - fallback: [] - -transcription-short: - primary: bailian/qwen3-asr-flash - fallback: [] - -vision: - purpose: Multimodal / image understanding - # Subscription-first: Sol handles everyday vision requests; Grok - # image input has also been verified live. Claude subscriptions cover structured - # and long-context vision without automatically invoking a paid ZenMux model. - primary: gpt-sol - fallback: - - grok - - claude-sonnet - - claude-opus - constraints: - require_vision: true - require_tools: false - require_json: false - wan-video: primary: bailian/wan3.0-video fallback: [] diff --git a/docs/04-routing-and-lanes.md b/docs/04-routing-and-lanes.md index 4106b935..cb6aa52c 100644 --- a/docs/04-routing-and-lanes.md +++ b/docs/04-routing-and-lanes.md @@ -295,7 +295,9 @@ The version-independent GPT lanes are `gpt-astra`, `gpt-luna`, `gpt-sol`, and and `gpt-6.1-terra` upstream models respectively. Versioned client model IDs, including dated and `openai.` variants, remain compatible through `model-aliases.yaml`. Lane entries show `economy`, `balanced`, and `premium` first, in that order, -then the remaining lanes alphabetically. Execution order still follows each +then functional lanes (coding, JSON, tool use, vision, and transcription), +then vendor/model lanes. Preserve the existing relative order within the latter +two groups. Execution order still follows each lane's primary and fallback list. Vendor-family lanes diff --git a/implementation-notes.md b/implementation-notes.md index b2625aad..b13d86dd 100644 --- a/implementation-notes.md +++ b/implementation-notes.md @@ -9,7 +9,7 @@ ## 2026-10-27 · GPT lane 去版本化并按优先档位排序(docs/04、06、11) -- **命名**:`gpt-6-astra`、`gpt-6-luna`、`gpt-6.1-sol`、`gpt-6.1-terra` lane 分别改成 `gpt-astra`、`gpt-luna`、`gpt-sol`、`gpt-terra`;lane 配置先按 `economy`、`balanced`、`premium` 排列,其余按名称字母顺序排列。旧模型名、日期及 `openai.` 客户端别名继续映射到新 lane。 +- **命名**:`gpt-6-astra`、`gpt-6-luna`、`gpt-6.1-sol`、`gpt-6.1-terra` lane 分别改成 `gpt-astra`、`gpt-luna`、`gpt-sol`、`gpt-terra`;lane 配置先按 `economy`、`balanced`、`premium` 排列,其次是 coding、JSON、tool use、vision、transcription 等功能 lane,最后是厂商/模型 lane;功能组与厂商组分别保留原有相对顺序。旧模型名、日期及 `openai.` 客户端别名继续映射到新 lane。 - **边界**:只改 lane 名和引用,不改真实上游 model ID、价格、能力、reasoning effort 或 fallback 顺序。Admin、Portal 与模型发现继续读取配置;192.168.8.4 的 Helm 串联模型与目录键同步改名,避免把新 lane 名直接发送给真实模型上游。 - **部署**:检查所有配置引用与现役 key 的 lane 作用域,保留无关自定义配置。v0.30.58 按发布工具同步稳定快照,分别读回两台服务器的排序与路由,并验证新名称及旧别名的真实流式响应。后续显示顺序修正直接更新现役配置,保持 v0.30.58 镜像与路由内容不变。 diff --git a/packages/core/src/config/samples.test.ts b/packages/core/src/config/samples.test.ts index 6d0a4b5a..693b4957 100644 --- a/packages/core/src/config/samples.test.ts +++ b/packages/core/src/config/samples.test.ts @@ -71,11 +71,18 @@ describe("checked-in config samples", () => { expect(expandLaneChain(current, lanes)[0]).toBe(`openai-codex/${upstream}`); } const priorityLanes = ["economy", "balanced", "premium"]; + const functionalLanes = [ + "coding", + "json", + "tool_use", + "transcription-file", + "transcription-short", + "vision", + ]; + const leadingLanes = [...priorityLanes, ...functionalLanes]; expect(Object.keys(lanes)).toEqual([ - ...priorityLanes, - ...Object.keys(lanes) - .filter((name) => !priorityLanes.includes(name)) - .sort(), + ...leadingLanes, + ...Object.keys(lanes).filter((name) => !leadingLanes.includes(name)), ]); for (const [model, lane] of Object.entries({ "gpt-6-astra": "gpt-astra",