custom provider · 模型推理强度设置
dsh 插件:让自定义提供方(pi-ai 手写路由)的所有模型都能选择思考强度(推理等级),选择经原厂适配器真正发往线上。A dsh plugin giving every custom-provider model selectable reasoning effort, wired through the stock pi-ai adapter.
项目简介
结果就是:内置提供方(如 DeepSeek)可选思考强度,自定义提供方的模型一律「当前模型未提供推理等级」。 插件做什么
插件还感知协议类型,自动管理路由级 compat: openai-completions:模型 id 含 deepseek 的路由自动补 compat.thinkingFormat: deepseek(用 DeepSeek 的 thinking 参数方言,而不是 OpenAI 的 reasoningeffort)。 所有 declared 自定义路由在 openai-completions 下自动补 compat.supportsDeveloperRole: false——因为 pi-ai 对未知端点默认判定支持 developer 角色,会把系统提示发成 role: "developer",而 new-api/one-api 系网关不认这个角色,直接返回 400。 openai-responses / anthropic-messages:自动剥离 completions 专属的 thinkingFormat / supportsReasoningEffort,避免切换协议时残留无效开关导致校验报错。
于是你可以在三种接口(openai-completions / openai-responses / anthropic-messages)之间自由切换,不用手动增删 compat。reasoningEfforts 是协议无关的:三种协议都把它物化成 reasoning + thinkingLevelMap,只是线上拼写不同(completions 发 thinking/reasoningeffort,responses 发 reasoning: {effort},anthropic 发 thinking: {type, effort/budget})。