534119219/dsh-custom-provider-reasoning

dsh 插件:让自定义提供方(pi-ai 手写路由)的所有模型都能选择思考强度(推理等级),选择经原厂适配器真正发往线上。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH). It solves the issue where custom model providers created via DSH's GUI do not show reasoning strength selectors in the Composer model picker. To install the plugin, you need to add this repository as a dependency in your DSH web profile's package.json, add it to the bundles list, run pnpm install in your profile directory, and restart the DSH web process after installation completes. The plugin works by automatically injecting missing configuration fields into eligible custom models whenever settings change.

This plugin is intended for DSH users who use custom model providers and want to access reasoning strength selection for their custom models. After installation, the plugin automatically detects changes to your DSH settings and injects the required configurations only for models that meet the eligibility rules. It will not overwrite any existing manual configurations you have already made for your models, so your custom settings remain intact. Once the configuration is injected, you can simply select your preferred reasoning strength directly from the Composer model selector, and the plugin handles converting the parameter to the correct format for your model's protocol.

This plugin is released under the permissive MIT license, so you can use, modify, and distribute it freely per the license terms. If you want to enable model discovery for Anthropic Messages protocol, you can run the included patch script to add support, which will automatically back up your existing files before making any changes. The plugin supports a wide range of custom configurations, so you can adjust default values like maxTokens, contextWindow, and reasoning level mappings to match your specific model's requirements. All configurations are non-destructive and only fill missing fields, never overwriting your existing manual settings.

这是一款DSH原生插件,用于解决DSH Composer中自定义提供方模型无法显示推理等级选择项的问题。它会自动为合格自定义模型注入推理等级配置,补齐缺失的最大输出令牌数和上下文窗口大小,还能自动管理不同协议类型的兼容性配置,让用户无需手动修改配置即可在OpenAI和Anthropic等协议间自由切换。

适合使用自定义模型提供方、希望在自定义模型上正常使用推理等级选择功能的DSH用户。用户安装插件后,插件会自动检测配置变更,对符合注入规则的自定义模型自动完成配置补全,无需用户重复手动操作。完成配置后,用户即可在Composer的模型选择器中直接选择所需推理强度,所有推理参数会按对应协议规范自动发送给模型端点。

本插件采用MIT许可证开源,可免费使用和修改。安装需要将仓库添加到DSH web profile的依赖列表中,执行pnpm安装后重启DSH即可生效。若需要为Anthropic Messages协议启用模型发现功能,还可运行仓库附带的补丁脚本补全能力,所有参数支持自定义配置以适配不同模型需求。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:534119219/dsh-custom-provider-reasoning

把 534119219/dsh-custom-provider-reasoning 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-custom-provider-reasoning

dsh host 插件:让自定义提供方(GUI「添加自定义提供方」创建的、pi-ai 目录之外的手写路由)的所有模型,都能在 composer 的模型选择器里选择思考强度(推理等级),并且选择会真正发往线上。

问题背景

  • composer 的模型选择器只在适配器为该确切模型公布了 reasoning 元数据时才显示推理等级行;
  • dsh-llm-pi-ai 只会从 llm-pi-ai 设置分节里模型条目的 reasoningEfforts 声明物化这份元数据;
  • 而设置 UI 刻意不写这个字段(推理强度是按模型的能力,提供方级控件无法表达)。

结果就是:内置提供方(如 DeepSeek)可选思考强度,自定义提供方的模型一律「当前模型未提供推理等级」。

插件做什么

在支持的原厂配置缝上补齐缺口:每当 llm-pi-ai 设置变化或适配器目录发布时,插件自动为每个合格模型条目写入 reasoningEfforts(默认 off / low / medium / high / xhigh / max,wire 拼写与等级同名——OpenAI 兼容端点标准词汇),并补齐缺失的 maxTokens(默认 384000)与 contextWindow(默认 1000000)——因为手写路由在 pi-ai 目录里没有对应条目,不补的话 dsh 会回落到 32768 的保守输出上限,DeepSeek V4 这类思考模型光推理输出就会顶满截断。

插件还感知协议类型,自动管理路由级 compat:

  • openai-completions:模型 id 含 deepseek 的路由自动补 compat.thinkingFormat: deepseek(用 DeepSeek 的 thinking 参数方言,而不是 OpenAI 的 reasoning_effort)。
  • 所有 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/reasoning_effort,responses 发 reasoning: {effort},anthropic 发 thinking: {type, effort/budget})。

下游一切照旧走原厂链路:session.models / llm.models 目录 RPC、请求期校验(resolveCallConfig)、以及线上翻译(pi-ai 对 OpenAI 兼容端点发送 reasoning_effort: low|medium|high)。

合格规则

场景 是否注入
自定义路由(declared)上的模型,无 reasoningEfforts ✅ 注入
目录路由上、pi-ai 目录未收录的模型(scope: all) ✅ 注入
已有 reasoningEfforts 的模型(手调字典或显式 false) ❌ 不覆盖 reasoningEfforts,但仍补缺失的 maxTokens/contextWindow
缺 maxTokens 的模型 ✅ 补 maxTokens(默认 384000,可配)
缺 contextWindow 的模型 ✅ 补 contextWindow(默认 1000000,可配)
pi-ai 目录已收录的模型(目录自带推理元数据) ❌ 交给目录

* 三个字段独立判断:reasoningEfforts 手写值始终权威,maxTokens/contextWindow 只在字段缺失时才补,已有值永不被覆盖。

* 唯一例外:恰好等于内置默认字典(off/low/medium/high/xhigh/max)的 reasoningEfforts 只可能是插件自己写的,因此会在配置的 levels 变化时被自动刷新为新配置——这样在 patch 里调高 levels 能覆盖到插件已经处理过的提供方,而用户手写的配置始终权威。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-grok-geo 下一个 Next dsh-wm →