Skip to content

feat(ModelBind): anthropic 定价行进 Model Bind 下拉、Models 页 Label 列、下拉按 vendor 分组、Model Mapping 按 target 设并发度(v0.6.20) - #356

Merged
ThreeFish-AI merged 3 commits into
feature/1.x.xfrom
fix-model-bind-haiku
Dec 5, 2026
Merged

ThreeFish-AI merged 3 commits into
feature/1.x.xfrom
fix-model-bind-haiku

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

变更摘要

  • Model Bind 下拉补齐 anthropic 新型号:pricing 行派生条件改为「vendor 在激活链 且 model 以该 vendor 原生前缀族开头」,claude-haiku-5-5、claude-fable-5-2 等在 Models 页配价即进下拉,不再依赖改内置目录 _ANTHROPIC 或 session_policies.bindable_models;copilot / antigravity / gemini 等无前缀族 vendor 的行(上游回报名)仍不派生,identity 规则合成范围不变。
  • Models 页新增 Label 列:ModelPricingEntry.label(默认空),表格 Model 右侧显示、行展开可编辑(已保存行仅 vendor / model 锁定);下拉 label 优先级 bindable_models > pricing label(offline_key 归一互配)> 内置 label > model 名。
  • 下拉按 vendor 分组排序:按归属 vendor 在激活链(tiers,订阅状态顺序)中的位次分组,组内版本降序;中继条目与无归属 custom 条目排最后。
  • Model Mapping 子页签按 target 设并发度:支持并发配置的 vendor(zhipu)每条规则多一列「Concurrency」,留空沿用 default(显示「默认 N」),读写 vendors.<type>.concurrency.models[target],与 Overview Model Calling 内联编辑同源;anthropic 等 monitor 模式 vendor 无此列。
  • zhipu 预建并发槽位:显式配置上限的模型无流量即出现在 Model Calling 实时状态。
  • 版本 0.6.20,CHANGELOG 新增条目;session-model-bind.md / config-reference.md 同步。

动机

Session 页 Model Bind 下拉选不到 Models 清单里的 Haiku 5.5:派生条目只取 native 系 vendor,anthropic 被排除。顺带消除「每次新增模型都要改代码或加 bindable_models」的维护负担,并按用户要求补齐 Label 美化、分组排序与 target 级并发度配置。

验证

  • uv run pytest:2491 passed(新增 test_model_catalog.py 派生 / label 优先级 / 分组排序用例、test_zhipu_concurrency.py 预建槽位用例、test_dashboard_config_tab.py Label 列与 Concurrency 列 Node harness 用例);ruff check / format 通过。
  • 临时实例(工作区代码 + 本机配置副本,端口 3399)浏览器核对:Models › Anthropic 显示 Label 列(Opus 5.5 / Sonnet 5.5 / Haiku 5.5 / Fable 5.2 …);Sessions 下拉选项为 Sonnet 5.5 · anthropic, Opus 5.5, Haiku 5.5, Fable 5.2, … 后接 GLM 5.4 · zhipu, …;Vendors › Zhipu › Model Mapping 带 Concurrency 列(1 / 5 / 1),展开行有可编辑数字字段,Anthropic 子页签无此列;Overview Model Calling 显示 glm-5.4 0 / 5、glm-5.3-flash 0 / 1(无流量)。
  • 本机现有 70 条 pricing 行已通过 PUT /api/config 写入推断 label(pricing revision 13 → 14),写入前快照留档。

风险点

  • 下拉顺序由「跨 vendor 全局按版本」改为「按 vendor 分组」,纯展示变化,无 API 语义变化。
  • zhipu 并发默认语义保持(未单独配置的模型仍用 default),本次未改。
  • copilot 等别名行(claude-haiku-4.5、Claude Haiku 4.5)的 label 按 offline_key 归一后作用于同名内置条目,多行同名时取首个非空 label。

…拉按 vendor 分组排序;

- 派生条件改为「vendor 在激活链 且 model 以该 vendor 原生前缀族开头」:anthropic 的 claude-haiku-5-5 等新型号不再需要改内置目录或 bindable_models;copilot / antigravity / gemini 等无前缀族 vendor 行不派生,identity 规则合成范围不变;
- ModelPricingEntry 增 label(默认空):Models 页 Label 列 + 行展开可编辑(已保存行仅 vendor / model 锁定);下拉 label 优先级 bindable_models > pricing label(offline_key 归一互配)> 内置 label > model 名;
- 下拉按归属 vendor 在激活链(订阅状态顺序)中的位次分组、组内版本降序,中继条目与无归属 custom 条目排最后;
- Model Mapping 子页签每条 target 增「Concurrency」列(仅注册表点名 concurrency 的 vendor),读写 vendors.<type>.concurrency.models[target],留空沿用默认,与 Overview Model Calling 内联编辑同源;
- 测试:派生 / label 优先级 / 分组排序用例,Config 页 Label 列与 Concurrency 列 Node harness 用例;文档同步;

🤖 Generated with [Claude Code](https://claude.com/claude-code), [CodeX](https://openai.com), [Gemini Code Assistant](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
…bel 列、下拉按 vendor 分组、Model Mapping 子页签按 target 设并发度;

🤖 Generated with [Claude Code](https://claude.com/claude-code), [CodeX](https://openai.com), [Gemini Code Assistant](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
@ThreeFish-AI
ThreeFish-AI merged commit b10fcec into feature/1.x.x Dec 5, 2026
6 checks passed
@ThreeFish-AI
ThreeFish-AI deleted the fix-model-bind-haiku branch December 5, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant