Replies: 1 comment
|
Verified your claims against alpha.2 ( Confirmation:
The discriminator I'd draw — and it aligns with a precedent in this same codebase: The wire-compat note ( There's a direct precedent: Concretely: the change is one line ( One thing worth adding to the proposal: the README / gate comment should state the discriminator ("withhold = catalog-set static vendor capability; offer = deployment intent the catalog can't infer"), so the next field of this class doesn't need a 0-issue search to get un-stuck. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
使用场景
OpenRouter 对每个模型聚合多家上游。默认 auto 路由下,
z-ai/glm-5.3*(以及类似的deepseek/*)的请求可能被打到第三方节点:fp4/int4 量化缩水(Relace)、上下文截短(Reka / io-net)、输出上限缩水(DeepInfra 16K)。用官方文档的请求字段{"provider": {"only": ["Z-AI"], "allow_fallbacks": false}}锚定官方厂商,可保持官方 fp8 权重、官方价格(GLM 在 OR 上零加价)与官方 prompt-cache 语义。这是部署者偏好,正是 provider profile 应该能表达的东西。
现状
Model.compat.openRouterRouting会被openai-completions实现写进请求体provider字段,且有完整OpenRouterRouting类型(only/order/ignore/allow_fallbacks/quantizations等)。dsh-llm-pi-ai在COMPLETIONS_COMPAT_GATE里把openRouterRouting标为'withhold',settings.yaml 里写它会直接报 "not configurable here"。openRouterRouting:0 条相关 issue/讨论。为什么 withhold 的理由在此不适用
门禁的文档理由是:"withhold 用于 pi-ai 已安装 catalog 为具名厂商设置的字段"——比如
zaiToolStream、sessionAffinityFormat,目录确实为需要的厂商设置了它们。openRouterRouting不属于这类:pi-ai 的 openrouter 目录数据(0.82 与 0.84 两版已核实)从不设置它(默认{})。它不是目录知道的厂商 quirk,而是只有部署者才能决定的路由偏好。继续 withhold 的结果是部署方只能接受 auto 路由(可能悄悄打到量化缩水节点),或绕开 DSH(本地代理、改直连、fork)。提案
COMPLETIONS_COMPAT_GATE中openRouterRouting由'withhold'改为'offer';编译期证明(EveryProfileFieldIsOffered/EveryOfferedFieldIsDocumented/EveryProfileFieldMatchesUpstream)会自动要求并校验新增字段。PiAiCompatProfile增加openRouterRouting?: OpenAICompletionsCompat['openRouterRouting'](带 JSDoc),并在src/config.ts的compatProfileschema 增加对应成员。openrouter.ai时生效该字段(其他地址静默忽略,见 earendil-works/pi#5347)——可以在非 openrouter 路由上拒绝,或至少文档明示作用域。vercelGatewayRouting如需可同模式开放。期望配置:
备查链接
若方向被认可,欢迎团队采纳并排期;按项目 CONTRIBUTING 说明,目前暂不接受外部 PR,此帖仅作需求反馈,供团队参考。
All reactions