dsh-gateway-provider

DSH PLUGIN模型与账号接入

仓库 Luck9Star/dsh-gateway-provider · npm dsh-gateway-provider

模型与账号接入 L4 · 沙盒安装通过 安全审查:低风险 可信度:银 可安装插件
安装这个插件

DSH plugin 将 newapi、LiteLLM、Higress 等任意 OpenAI 兼容网关的全部模型接入 DeepSeek Harness,自动同步真实参数并按原生协议路由请求。

一句话选型结论

按资料字段整理

dsh-gateway-provider 是模型与账号接入类的 DSH 可安装插件,验证等级 L4 · 沙盒安装通过,安全审查为低风险,列出 5 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类模型与账号接入 收录类型可安装插件 验证等级L4 · 沙盒安装通过 安全审查低风险
验证等级 L4 L4 · 沙盒安装通过
GitHub 星标 5 复刻 3 · 未关闭 issue 0
最近更新 2026-09-30 创建于 2026-08-13
README 11.3 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add dsh-gateway-provider@1.1.0
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.2.0-rc.1 等 7 个;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.2.0-rc.1 等 7 个版本版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名dsh-gateway-provider可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-gateway-provider:DeepSeek Harness 的 LLM 网关模型提供插件

  • 自动同步网关模型
  • 真实参数来自 models.dev
  • 多协议原生路由
  • 多网关并行接入
  • 设置页免 YAML 配置

上游标签

deepseek-harnessdshdsh-pluginlitellmllm-providernewapipi-ai

验证等级与安全审查

L4 · 沙盒安装通过
自动化流程结论,不是人工审核
验证等级L4 · 沙盒安装通过安装命令在隔离沙盒内真实执行成功,无依赖错误
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度银综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
  • L4.4_RESOLVED_ARTIFACT 安装版本已解析 方式:沙盒安装执行
L5 · 运行已测 ✕ 未通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 boot failed
  • L5.3_HTTP_SERVED HTTP 服务响应
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L4:在沙盒里真实装过,依赖能装上,不是纸面声明。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.2.0-rc.1 等 7 个),按版本装不容易报错。
  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在模型与账号接入场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-gateway-provider当前 L4 · 沙盒安装通过 低风险 5 0.2.0-rc.1 等 7 个 有
archify L4 · 沙盒安装通过 低风险 8.0 万 未标注 有
DeepSeek-Reasonix L4 · 沙盒安装通过 低风险 3.6 万 未标注 有
nocobase L3 · 安装规范通过 低风险 2.5 万 0.1.1-rc.2 无
learn-harness-engineering L4 · 沙盒安装通过 低风险 2.0 万 未标注 有
dsh-our-free-model 未做沙盒验证 未标注 8,064 未标注 无

仓库档案

模型与账号接入
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方Luck9Star仓库 dsh-gateway-provider · 默认分支 main
分类模型与账号接入ai
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue5 / 3 / 0收录时的数值,非实时
创建 / 更新2026-08-13 · 2026-09-30最后推送 2026-09-30
本站收录2026-08-14首次进入本站目录的时间

README 全文

11.3 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-gateway-provider

> 中文文档:docs/README.zh.md

Use all the models behind your LLM gateway — newapi, LiteLLM, Higress,
or any OpenAI-compatible endpoint — directly in DeepSeek Harness.

Install the plugin, paste your API key, and every gateway model shows up in
dsh's model picker with its real parameters (context window, output cap,
reasoning support) fetched from models.dev. Requests
go out over each model's own native protocol — OpenAI, Anthropic, or Gemini
— so tool calls and streaming behave the way that model's maker intended.

Why this exists

dsh ships one adapter per official provider. If your models live behind a
gateway, the manual alternative is a hand-maintained static model list with
guessed context windows and output caps. This plugin mounts the gateway
itself instead:

  • Nothing to maintain by hand — the model list is read from the gateway
    (GET /v1/models, with a management-API fallback for newapi); add a model
    on the gateway side and it appears in dsh, no re-deploy.
  • Real numbers, not guesses — models.dev data fills context window,
    output cap, reasoning levels, release date; config defaults only fill gaps.
  • Every wire format, one plugin — each model routes over its own
    protocol (OpenAI chat completions / OpenAI responses / Anthropic messages
    / Gemini), handled by the same
    pi-ai SDK the
    official dsh adapter uses.
  • Multiple gateways at once — a default newapi route plus one
    gateway: route per extra gateway, each with its own cache and key.
  • A settings page instead of YAML — Settings → Gateway Models: add
    gateways from templates (NewAPI / LiteLLM / Higress / OpenAI-compatible /
    fully custom), test connections, sync models, hide or override any model,
    add custom models.

Requirements

  • DeepSeek Harness (dsh) with a web profile (the settings page is a web-UI
    extension; the provider itself works in any profile).
  • A gateway API key (e.g. a newapi token).

Install

# 1. Install the plugin (dsh plugin add runs pnpm add under the hood)
dsh plugin --profile web add dsh-gateway-provider

# 2. Store your key — pick ONE of:
#    a) the dsh credentials file (recommended; created with mode 0600, hot-reloaded)
echo "NEWAPI_API_KEY: sk-REPLACE_WITH_YOUR_KEY" >> ~/.dsh/.credentials.yaml
#    b) or export it in the shell you launch dsh from:
#       export NEWAPI_API_KEY=sk-REPLACE_WITH_YOUR_KEY

# 3. Restart and open the settings page
dsh --profile web
# → Settings → Gateway Models

Expected result: the model picker gains a "NewAPI" route listing your
gateway's chat models, newest first. Click Test on the gateway card —
it should answer ✓ Connected — N models. Not using the public newapi
cloud? Set Base URL on the card (or baseURL in config) to your own
gateway address first.

Terminal / headless

The host half of this plugin (the llm-newapi provider route) works in any
profile — including terminal / TUI setups such as
dsh-tui. Settings → Gateway
Models is web-only
; without the web UI you configure the gateway by
overriding the bundle's llm-newapi entry in the profile patch. A patch
layer replaces config wholesale, so write the whole block out:

# ~/.dsh/profiles//cordis.patch.yml
# Override by id — do not insert a second llm-newapi row (duplicate = loader error).
- id: llm-newapi
config:
label: My Gateway
baseURL: https://gw.example.com
apiKeyEnv: GW_API_KEY
models:
- id: some-model
protocol: gemini

Store the key under the name in apiKeyEnv (same rules as Install):

echo "GW_API_KEY: sk-REPLACE_WITH_YOUR_KEY" >> ~/.dsh/.credentials.yaml
# or: export GW_API_KEY=sk-REPLACE_WITH_YOUR_KEY

Install into a non-web profile the same way — swap the profile name:

dsh plugin --profile dsh-tui add dsh-gateway-provider

After a restart the gateway models should appear in the TUI model picker.
Connection Test / Sync / per-model editing still need the web settings page
(or hand-edits of the YAML above). A future in-terminal settings surface
(tuiSettingsSections, see #5)
may cover the scalar fields; until then the YAML override is the supported
path.

Daily use

Everything lives in Settings → Gateway Models:

  • Add more gateways — "Add Gateway", pick a template (LiteLLM, Higress,
    OpenAI-compatible, or fully custom with per-protocol URLs), point it at
    the base URL, name its key env var, Test, Sync. Each gateway becomes its
    own route in the picker.
  • Tame the model list — non-chat models (image / speech / embedding /
    rerank …) are excluded by default regexes; hide or rename any model; add
    a custom model by hand if the gateway hides it; per-model protocol,
    context window, output cap, and reasoning levels are all editable.
  • Keys live in dsh's credential store — the settings page shows a badge
    (✓ Key set · NEWAPI_API_KEY / ⚠ No key set) and can write the key
    there for you.

Configuration reference

Optional — everything below has a working default. With dsh ≥ 0.2 config
lives in the llm-newapi entry of the profile
(~/.dsh/profiles//cordis.patch.yml; the settings page edits the same
data). A pre-0.2 ~/.dsh/settings.yaml section is imported automatically on
the first start where the plugin loads. The frequently used ones:

Key Default Meaning
baseURL https://api.newapi.ai Your gateway's base URL. Env fallbacks: NEWAPI_BASE_URL, NEWAPI_API_URL. A trailing /v1 or /v1beta is tolerated (stripped for discovery); Gemini requests always go to {base}/v1beta/models/….
apiKeyEnv NEWAPI_API_KEY Which env/credential variable holds the key.
label NewAPI Route label shown in the picker.
flavor newapi Template label only (newapi / litellm / higress / openai-compatible / custom).
gateways — Array of extra gateways: { id, baseURL, apiKeyEnv, label, … }, each becoming a gateway: route.
models — Per-model overrides: { id, name, disabled, protocol, contextWindow, maxTokens, reasoningLevels }.
useModelsDev / modelsUrl true / models.dev Parameter enrichment source (supports file: URLs for offline).
excludePatterns image/speech/… Regex list of model ids to keep out of the picker (matched case-insensitively).
sortModelsByRelease true Newest models first.
catalogMode auto v1 (/v1/models only) / management (newapi user API) / auto.
endpointPriority responses → anthropic → openai → gemini Which protocol to prefer when a model supports several.
openaiURL / responsesURL / anthropicURL / geminiURL — Fully-custom gateways only: per-protocol endpoint URLs; unset = that protocol off. geminiURL may be a bare host, …/v1beta, or …/v1beta/models — the /v1beta segment is ensured (pi-ai expects it in the base).
maxTokens / defaultContextWindow 32768 / 128000 Fallbacks when models.dev has no data.
streamIdleTimeoutMs 600000 Idle timeout while streaming.
headers — Extra HTTP headers sent to the gateway.

Troubleshooting

Symptom Cause → fix
Picker route exists but zero models The plugin can't read your model list. Check the gateway base URL; try catalogMode: "management" for newapi gateways that restrict /v1/models.
401 / auth errors on every request Key missing or wrong: check the badge in Settings → Gateway Models, or NEWAPI_API_KEY in ~/.dsh/.credentials.yaml.
A model's context window looks wrong models.dev had no match. Edit the model on the settings page (or a models: override).
Wrong format answers / tool calls flaky for one model That model is routed over a protocol it handles poorly. Pin protocol on the model (openai, openai-response, anthropic, gemini).
Custom gateway with separate endpoints Use flavor: "custom" and set openaiURL / responsesURL / anthropicURL / geminiURL explicitly.
Gemini model returns HTML / Unexpected token '<' (issue #4) The gateway serves Gemini under /v1beta; fixed in 1.1.2 — a plain baseURL now sends Gemini to {base}/v1beta/models/… (a baseURL ending in /v1beta also works). No older-version workaround exists; update the plugin.

How it works (one minute version)

At startup the plugin registers one provider route per gateway, pulls the
model list from the gateway, and fuzzy-matches each model id against
models.dev to fill in real parameters. When you pick a model, dsh's request
is translated to the pi-ai SDK's format and sent over that model's native
protocol; the streamed reply is translated back into dsh chunks. Catalogs
are cached (30 min by default) per gateway. No hand-written protocol code —
the bridge is lifted from the official dsh-llm-pi-ai adapter.

Development

git clone https://github.com/Luck9Star/dsh-gateway-provider
cd dsh-gateway-provider
pnpm install               # pi-ai (pinned) + @deepseek-ai/* profile symlinks, via the prepare hook
pnpm run test:client       # settings-UI render, both locales
pnpm run test:urls         # URL/derivation units
pnpm run smoke             # live gateway round-trip (needs a real key)

Why the plugin pins its own pi-ai

@earendil-works/pi-ai is a direct dependency (exact-pinned), independent of
the pi-ai version bundled with the harness. This decouples the gateway model
catalog (thinking levels, per-provider compat such as zhipu GLM's
supportsDeveloperRole: false) from harness upgrades: a model missing from
the harness's older catalog no longer degrades request encoding. The
plugin↔harness boundary passes plain data (GenerateOptions in, dsh
StreamChunks out; lib/pi-bridge.js never leaks pi-ai objects across), so
the plugin's pi-ai copy and the harness's own coexist safely in one process.

Developing from a checkout: point the profile's package.json at
"dsh-gateway-provider": "link:/abs/path" and re-run pnpm install in the
profile. Do not also add an id: llm-newapi row to the profile's own
cordis.patch.yml — the bundle patch already provides it (duplicate row =
loader error).

References & credits

  • pi-ai SDK — all
    four wire protocols; the bridge reuses the official dsh-llm-pi-ai
    adapter's translation layer.
  • models.dev — the parameter catalog (context
    windows, output caps, reasoning, release dates).
  • new-api,
    LiteLLM,
    Higress — the gateways this plugin
    is tested against (any OpenAI-compatible endpoint works).

Security

Keys live in dsh's credential store or the launching environment — never in
settings YAML. The repo runs gitleaks
in CI and pre-commit to keep secrets out.

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-gateway-provider 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add dsh-gateway-provider@1.1.0` 即可。对应的 npm 包名是 `dsh-gateway-provider`。

dsh-gateway-provider 的验证等级是什么意思?

L4 · 沙盒安装通过。安装命令在隔离沙盒内真实执行成功,无依赖错误

dsh-gateway-provider 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-gateway-provider 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-gateway-provider 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.1、0.1.7-rc.2、0.1.7-rc.1、0.1.7-alpha.2、0.1.6-alpha.2、0.1.6-alpha.1、0.1.1-rc.2。

dsh-gateway-provider 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-gateway-provider 有哪些功能?

自动同步网关模型、真实参数来自 models.dev、多协议原生路由、多网关并行接入、设置页免 YAML 配置。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

模型与账号接入
按星标排序,可作替代方案

archify

archify

从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。

L4 · 沙盒安装通过 8.0 万 星

nocobase

nocobase

L3 · 安装规范通过 2.5 万 星

dsh-our-free-model

dsh-our-free-model

为 DeepSeek Harness 挂载免登录、免 API Key 的免费前沿模型通道,装完即用,并附用量看板与 OpenAI 兼容本地转

未标注验证等级 8,064 星

dsh-purge

dsh-purge

dsh-purge 是一款 DeepSeek Harness 设置插件,可修改默认副本、权限策略和工具限制,并添加规则卡片以分组应用补丁,支

L5 · 运行验证通过 4,573 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。