[Feature Request] 支持在非官方 DeepSeek 风格 OpenAI 兼容网关上选择思考挡位 / Support reasoning-effort selection on non-official DeepSeek-style OpenAI-compatible gateways #1643
BrokenReflection
started this conversation in
Ideas
Replies: 1 comment
|
话说怎么不开放Issues啊,多少人等着提交呢 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
需求背景 / Motivation
我们在一个非官方的 OpenAI 兼容网关上使用 DSH。该网关的模型遵循 DeepSeek
语义,并接受
reasoning_effort挡位(off / high / max)。我们希望通过现有配置面(模型条目上的
reasoningEfforts声明、agent-default-model中的reasoningEffort选择)在非官方网关上按模型、按会话选择思考挡位。目前这条链路无法端到端工作——请求还没到达模型就失败了。
We run DSH against a non-official OpenAI-compatible gateway whose models
follow DeepSeek semantics and accept
reasoning_effortlevels (off / high /max). We want to select the reasoning effort per model and per session, using
the existing configuration surface (
reasoningEffortson model entries andreasoningEffortinagent-default-model). On such a gateway this currentlydoes not work end to end — every request fails before reaching the model.
拦路问题 / Blocking issue
一旦模型声明思考挡位,pi-ai 就会用 OpenAI 的
developer角色发送 systemprompt。DeepSeek 风格的端点只接受
system/user/assistant/tool四种角色,因此网关对每个请求都返回
400 messages[0].role: unknown variant 'developer'。手工声明的路由目前无法保持system角色。As soon as a model advertises reasoning efforts, pi-ai sends the system
prompt with the OpenAI
developerrole. DeepSeek-style endpoints only acceptsystem/user/assistant/tool, so the gateway rejects every requestwith
400 messages[0].role: unknown variant 'developer'. Hand-declared routescurrently have no way to keep the
systemrole.建议方案 / Proposed fix
在 route 级和 model 级的 compat 配置中增加
supportsDeveloperRole(回退顺序:目录条目 → baseURL 推断),并透传到
resolveModelCompat——与现有supportsReasoningEffort开关完全对称:Add
supportsDeveloperRoleto the route- and model-level compat profile(falling back to the installed catalog entry, then pi-ai's baseURL-derived
guess), carried through
resolveModelCompat— symmetric with the existingsupportsReasoningEffortswitch:两个开关配合后,非官方 DeepSeek 风格网关上的思考挡位选择即可完整可用。
已有可运行的实现(约 16 行改动,补丁见附件),并已在生产环境的内网
DeepSeek 风格网关上验证三个挡位全部可用。
Together the two switches make reasoning-effort selection fully functional on
non-official DeepSeek-style gateways. A working implementation exists
(~16-line diff, patch attached) and has been verified in production against an
internal DeepSeek-style gateway with all three effort levels.
llm-pi-ai-supports-developer-role.patch
All reactions