534119219/dsh-custom-provider-reasoning ↗★ 4

dsh-custom-provider-reasoning

dsh host 插件:让自定义提供方(pi-ai hand-declared routes)的所有模型都能在模型选择器中选取思考强度(reasoning effort,默认含 low/medium/high/xhigh/max),自动回填缺失的 maxTokens/contextWindow,管理路由级默认推理等级(默认 max),并按协议类型(openai-completions / openai-responses / anthropic-messages)管理路由 compat(自动补 supportsDeveloperRole: false、默认不写 thinkingFormat、剥离失效开关)。 适合自建供应商接入时统一参数与兼容行为,需熟悉路由配置与协议兼容项。

パッケージ
dsh-custom-provider-reasoning
互換性
未検証
バージョン
0.3.1
ライセンス
MIT
最終更新
2026/08/31

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:534119219/dsh-custom-provider-reasoning

ドキュメント

README 全文を読む ↗

配置

插件支持配置(放在 profile 的 cordis.patch.yml 对应行或插件设置页):

- id: dsh-custom-provider-reasoning
  name: 'dsh-custom-provider-reasoning'
  config:
    enabled: true          # 总开关,默认 true
    scope: declared        # declared(默认,只处理自定义路由)| all(额外覆盖目录路由上目录未收录的模型)
    verify: false          # 发布后逐个 resolveModelInfo 并记录推理元数据(诊断用)
    maxTokens: 384000      # 缺 maxTokens 的模型补这个值;设 false 则不补
    contextWindow: 1000000 # 缺 contextWindow 的模型补这个值;设 false 则不补
    thinkingFormat: false    # 默认 false 不写 thinkingFormat;确需 DeepSeek 方言时改成 deepseek
    defaultEffort: max       # 路由级默认推理等级(profile.reasoning):路由未声明时写入,已有值不覆盖;设 false 则不管
    supportsDeveloperRole: false  # 自动为 declared 路由补 compat.supportsDeveloperRole;false=补 false(new-api 网关安全),true=补 true
    levels:
      off:                 # 留空 = 支持但不发送任何内容(端点用自己的默认)
      low: low
      medium: medium
      high: high
      xhigh: xhigh
      max: max

levels 的键必须是 pi-ai 的思考等级(off / minimal / low / medium / high / xhigh / max),值是对应线上拼写;除 off 外都必须是非空字符串。至少要有 off 之外的等级,否则插件拒绝启动(避免把路由配置弄成不可服务)。

maxTokens / contextWindow 只在对应字段缺失时回填,已手写的值永不被覆盖;默认值 384000 / 1000000 对齐 DeepSeek V4 官方规格。若你的自定义提供方是其他模型(上限更低),可在此调低;设 false 则完全不碰该字段。

thinkingFormat 控制路由级 compat.thinkingFormat 的管理:默认 false(不写 thinkingFormat,因为 dsh 对每次写入都做可用性校验,残留的 thinkingFormat 会让「切协议」这一写入本身先被拒绝,插件来不及清理);非 openai-completions 协议下始终自动剥离 completions 专属的 thinkingFormat / supportsReasoningEffort。只有端点确实需要 DeepSeek 的 thinking 参数时,才把它设成 deepseek(或 qwen/together 等)。

defaultEffort 管理路由级默认推理等级(profile.reasoning → 模型的 defaultEffort):默认 max,即新自定义提供方的模型在未显式选等级时使用 Max、选择器预选 Max(且不再显示「Default」选项)。只在路由未声明时写入,已有值永不被覆盖;设 false 关闭该管理。

supportsDeveloperRole 控制 compat.supportsDeveloperRole 的自动回填:默认 false,即对 declared 路由在 openai-completions 下自动补 supportsDeveloperRole: false(让系统提示走 system 角色,new-api/one-api 网关安全);设 true 则补 true(适用于真正支持 OpenAI developer 角色的端点)。只在字段缺失时写入,已手写的值永不被覆盖。