wizardchen
a1b0d0cb6c
fix(models): serve qwen3-rerank on the native DashScope rerank protocol
...
The catalog rebuild marked qwen3-rerank unsupported because Alibaba also
documents a flat /compatible-api/v1/reranks shape for it. The native
text-rerank endpoint serves the same model with identical scores (#3558 ),
and v0.8.0 routed it there, so existing Aliyun rerank rows naming it
failed with "failed to get rerank model" after upgrading.
Drop the unsupported override and the deprecated flag so the model
resolves to dashscope-rerank again and shows up in the picker.
2026-09-24 14:18:55 +08:00
lyingbug
e179f44445
refactor(models): separate provider definitions, model catalogs, and runtime configuration ( #3589 )
...
* refactor(models): separate providers, catalog and runtime configuration
* refactor(models): isolate provider definitions and runtime catalogs
* docs: exclude refactoring analysis notes from the pull request
2026-09-23 14:20:08 +08:00
lyingbug
4a9aa06274
refactor(asr): move the wire format into protocol packages, and cover every vendor whose docs offer ASR ( #3503 )
2026-09-21 13:25:27 +08:00
lyingbug
9030f556f2
refactor(embedding): move the wire formats into protocol packages, and correct the vendor facts ( #3500 )
2026-09-21 11:55:38 +08:00
lyingbug
d6c7665cb5
refactor(rerank): move the wire formats into protocol packages, and correct the vendor facts ( #3488 )
...
把 8 个手写 rerank client 收敛成 3 个协议包(internal/models/api/{cohererank,dashscoperank,nimrerank}),每个带一份从厂商文档逐字粘来的 golden fixture。LKEAP 和火山保留官方 SDK,但只实现 api.Reranker。rerank.NewReranker 改成 catalog.Resolve + 按协议分发,函数体里没有厂商名。生产代码净 -147 行。
三件原来每个 client 各管各、现在由共用层统一的事:分批(按厂商声明的上限,智谱 128 / NIM 512 等此前无人执行)、分数标度(NIM 与 GPUStack 返回 logit,其余为 0~1 概率,统一换算后再与 RerankThreshold 比较)、NIM 的 truncate(默认 NONE 会让超长 passage 整请求失败,此前从未发送)。
对照官方文档订正四处厂商事实:GPUStack 分数标度、千帆三项上限、阿里 500 条上限、qwen3-rerank 是第二种协议(隐藏并在构造期拒绝)。Novita / OpenRouter / LiteLLM 三家官方有 rerank 但未开类型,本次开放,零协议代码。
运行时行为变更:NVIDIA 起发 truncate: END;GPUStack 分数按 logit 换算(可按行覆盖);truncate_prompt_tokens 收窄为厂商声明制;qwen3-rerank 存量行从静默打错变为构造期报错。详见 PR 描述。
关联 #3486。
2026-09-21 10:36:26 +08:00
lyingbug
9aa63c866f
fix(models): correct four vendor request shapes that contradict the docs ( #3489 )
...
PR #3470 逐条核对了 27 家厂商,但有四处(五个 entry)的声明与厂商文档对不上,
其中一处在默认路径上就是错的。
1. DeepSeek:参考文档写明 "required and named tool choices are not supported
in thinking mode; the API returns a 400 error",而 vendor.go 的事实注释写成
「plain OpenAI set」并因此没有配 tool_choice_modes,默认继承全集。现在只发
none / auto,和 Moonshot 同类限制的写法一致。compat 无法表达「仅思考模式下
受限」,而思考是 DeepSeek 的默认状态,所以不做条件区分。
2. 智谱 glm-5.2:官方对 GLM-5.2 的折叠规则是 none|minimal 放弃思考、low|medium
折成 high。models.json 却把 minimal 改写成 "low",发出去被平台折成 high,
用户选最弱档实际跑最高强度。删掉该覆盖,回落到厂商级的 minimal。
3-4. NVIDIA NIM:z-ai/glm-5.3 与 moonshotai/kimi-k3 配了 thinking_levels,却
沿用厂商默认的 chat-template-kwargs 编码——该分支只发 enable_thinking 布尔,
档位被整个丢弃,而前端仍按 capabilities 渲染出一个不起作用的档位选择器。
两个 entry 改为顶层 reasoning_effort。kimi-k3 的 NIM 卡片只写了
"configurable low, high, or max reasoning effort" 而未展示参数,按其第一方
API 的字段推定,已记入 Unverified。
5. 阿里云 qwen3.8:官方参数表写明「不支持 reasoning_effort 与 thinking_budget
同时设置,同时设置会报错」,vendor.go 的注释也记了这条,但 applyThinking 在
ThinkingBudgetTokens > 0 时无条件两个都写。新增 compat 键
thinking_budget_excludes_effort,冲突时档位优先、预算让路。
3 与 4 在当前默认路径上已经影响到档位;1 和 5 目前够不到(全仓库只有
agent/finalize.go 发 tool_choice="none",且没有任何地方给 ThinkingBudgetTokens
赋值),属于修掉的埋雷。2 是默认路径上的实际错误。
新断言做过反向验证:数据回滚到修改前,7 条 vendor 断言与新增的 golden 用例全部
报错。
2026-09-21 00:05:11 +08:00
lyingbug
c40a9dd194
refactor(models): rebuild vendor integration on protocol + catalog + vendor layers ( #3470 )
...
把集中式的 OpenAI 方言客户端重建为三层:协议层 internal/models/api/<protocol>(OpenAI Chat Completions / OpenAI Responses / Anthropic Messages / Google GenAI),目录层 internal/models/catalog,厂商层 internal/models/vendors/<id>(27 家,go:embed)。27 家厂商逐条对照官方文档核验,厂商事实以数据声明,协议层不出现厂商名。
既有行的运行时行为会变的四处:
1. extra_config.api 变为保留的协议选择器,非法取值被拒绝;
2. Azure 未填 api_version 的行改走 /openai/v1 GA 数据面;
3. api.openai.com 的一方流量改走 Responses 协议(中转/网关不受影响);
4. 7 家厂商的输出上限字段按文档纠正。
不需要数据库迁移。详见 PR 描述与 website-docs/03-features/06-models.md。
2026-09-20 21:28:23 +08:00