superfish058/dsh-llm-proxy

DSH插件:模型级LLM代理路由与重试,可在DSH设置页面(????)动态配置。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables per-model proxy routing for LLM requests. To install the latest stable version, you can run the command dsh plugin --profile web add @superfish058/dsh-llm-proxy in your terminal. If you want to test local changes to the source code, you can instead install from a local path by running dsh plugin --profile web add /path/to/your/local/repo. After installation, you will need to fully restart the DSH web process to activate the plugin. It works with all DSH versions 0.1.2 and newer, automatically falling back to a built-in dispatcher for older versions.

After installation, you can configure the plugin through the DSH settings page under the plugins tab. The default proxy host and port match the common default setting for most local proxy tools like Clash, so you rarely need to change it. You just need to check the boxes next to the models you want to route through the proxy, then save the configuration. The changes take effect immediately without a full restart of DSH. You can also test each proxied connection directly from the settings page with one click, which will show you the connection status, latency, routing path, and any error messages.

This plugin is released under the permissive MIT open source license, so you can use it for free for both personal and commercial projects. It includes a useful feature to enable image input for multimodal models that do not have the option enabled by default in DSH’s official model list. Retry logic is handled entirely by the official dsh-llm-retry plugin, so you do not need to manage duplicate retry rules. If you run into issues, you can use the pre-written prompt provided in the README to ask another LLM to help troubleshoot and fix the problem for you.

这是一款专为 DSH 开发的原生模型路由代理插件,核心功能是让用户按模型分流 LLM 请求,选中的模型走代理,其余直连。适合仅需给境外模型 API 走代理,同时保留国内 API 直连以提升访问速度的用户。它同时兼容 DSH ≥ 0.1.3(复用官方出站代理引擎)和更低版本,低版本使用自带的调度器。可通过 DSH 命令行安装 npm 预编译包或本地源码,安装后重启 DSH 即可使用。

它支持按模型配置代理,同一 API 域名下的所有模型自动生效路由规则,还提供了连接测试功能,可一键检测代理连通性、路由状态、多模态开启状态和错误信息,修改配置后保存即可生效,无需重启 DSH。它还支持给官方未开放图像输入入口的多模态模型添加图像输入权限,解决发送图片请求被拒绝的问题。重试功能统一交给官方 dsh-llm-retry 插件处理,无需额外配置。

本插件遵循 MIT 开源许可证,完全免费使用,不需要额外支付费用。它默认配置了常用的本地代理地址 127.0.0.1:7897,适配大多数 Clash 等本地代理工具的默认配置,用户只需勾选需要走代理的模型即可快速启用。遇到问题时,README 提供了现成的排查提示词,可直接让大模型帮忙定位和修复问题。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
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 @superfish058/dsh-llm-proxy

把 superfish058/dsh-llm-proxy 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

@superfish058/dsh-llm-proxy

npm

DSH 模型代理插件:给 LLM 请求按「目标域名」分流——选中的模型走代理,其余直连。官方出站代理包(dsh ≥ 0.1.3)在时装官方引擎复用其传输层,旧 harness 用自带 dispatcher;重试统一交给官方 dsh-llm-retry。

版本要求:v1.5.0 面向 dsh ≥ 0.1.7(设置文档由插件自己的 Config 承载,客户端用 configForms + Plugins 页的 plugins.item 槽)。dsh 0.1.6 及更早请继续用 v1.4.0——路由与重试行为相同,只是设置页在老 harness 上可用。

它是干嘛的

  • 按模型走代理:在 DSH 设置页(设置 → 插件 → 模型代理)勾选需要走代理的模型(如 deepseek-v4-flash),该模型的请求自动经 proxyHost:proxyPort(默认 127.0.0.1:7897,即 Clash)转发;未勾选的模型(DeepSeek、小米、通义等国内 API)保持直连。路由按模型的 API 地址(baseURL host) 生效:选中一个模型后,同一地址下的所有模型都会走代理(例如 B.AI 的 deepseek-v4-flash 与 deepseek-v4-flash-vision-exp 共享 api.b.ai)。
  • 失败自动重试(官方引擎):重试由官方 dsh-llm-retry 执行——对断连(ECONNRESET 等)、429 限流、5xx 按 provider 自己的 retryPolicy 重放请求(默认 5 次、500ms→10s 指数退避 + 抖动,并遵循 Retry-After)。卡片上的 retries/retryIntervalMs(默认 3 次 / 1s 固定间隔)镜像进被勾选 provider 的该策略,取消勾选还原官方默认;插件自身不再在传输层重试(v1.4.0 起)。
  • 模型列表与官方一致:只配了 apiKeyEnv、没写 models 的 provider(如 xiaomi),其模型从 pi-ai 内置目录(@earendil-works/pi-ai)回退补齐;llm-deepseek 命名空间即使保持默认空文档(llm-deepseek: {})也回退官方内置目录(https://api.deepseek.com + DEEPSEEK_API_KEY),deepseek-official/* 模型开箱可用。勾选列表与 DSH 官方模型选择器完全同步。
  • retryPolicy 镜像:卡片上的 retries/retryIntervalMs 会镜像进被勾选 provider 的官方 retryPolicy(既是设置页 (retry/maximum) 提示的来源,也是真正的重试参数),取消勾选自动还原官方默认值——一套配置驱动官方重试。
  • 多模态模型镜像:DSH 官方模型声明里,部分支持图像识别的模型(如 deepseek-v4-flash-vision-exp)没有可供用户勾选「图像输入」的配置入口,选中后发图会被 DSH 以 UNSUPPORTED_CONTENT 拒绝。在设置卡「多模态模型」区勾选这些模型后,插件把 image 写进所属 provider 的模型声明(pi-ai 的 models[].input / 目录型 modelOverrides[].input,官方 DeepSeek 的 models[].inputModalities),使 DSH 允许对该模型发图;取消勾选自动还原官方默认。注意:该功能只对真正支持图像输入的模型(如 vision 模型)有意义,纯文本模型(如 deepseek-v4-flash)勾选后 DSH 虽放行,实际请求仍会因模型不支持图像而报错。
  • 测试连接:走代理的模型列表每行新增「测试连接」按钮,探测请求走当前生效的全局 dispatcher(即真实 LLM 请求的路径),返回 HTTP 状态 / 耗时 / 引擎给出的真实路由(经代理或直连);失败时直接显示提供方返回的错误 body(脱敏、截断),如 B.AI 的 max_tokens 限制一眼可见。注意:测试走已保存的配置——改了勾选后请先点「保存」再测试。
  • 保存即生效,无需重启:设置写入本插件的配置项(dsh 0.1.7 的 Loader entry llm-proxy,即 cordis.patch.yml 里这一行)后运行时整体替换 dispatcher,不碰供应商自己的配置。冷启动时若 provider 命名空间(llm-pi-ai/llm-deepseek)尚未注册,插件会带退避重试直到可解析代理域名,不再需要手动"恢复默认再保存"。
  • 图片输入不再由本插件代管:dsh 0.1.7 起模型图片输入(input / inputModalities)由官方模型设置页与官方 provider 配置直接管理,v1.4.0 的「多模态模型镜像」因此在 v1.5.0 移除——需要给某模型开图片输入时,请在官方模型设置处配置。

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-paste-to-path 下一个 Next dsh-whale-girl →