vitas/dsh-web-search-gateway 预览 preview

vitas/dsh-web-search-gateway

Grounded web search for DeepSeek Harness on any OpenRouter-compatible gateway: the built-in web_search tool runs on the same endpoint and key as your chat models.

Project Overview项目介绍

dsh-web-search-gateway is a native plugin built specifically for DeepSeek Harness that re-routes the built-in web_search tool from DeepSeek's own billable endpoint to any OpenRouter-compatible gateway, so citations are paid for on the same account as the chat and at the gateway's price rather than as a full DeepSeek model turn. The package ships a bundle patch that the install line wires in automatically, and it is mounted with dsh plugin add dsh-web-search-gateway --profile web from the npm package, dsh plugin add github:vitas/dsh-web-search-gateway from a GitHub checkout, or dsh plugin add link:$PWD from a local clone built with npm install && npm run build. The API key is supplied via dsh credential set OPENROUTER_API_KEY (or exported before launching dsh) and is resolved per call through the credentials service first and then the process environment, so rotating it never requires a restart, but the patch and the linked host entry are read at boot so dsh web must be restarted once after install.

The typical workflow begins in Settings → Plugins → Web search (OpenRouter), where the user sets Endpoint, Search model, and pastes the API key, then runs Test search to see a source count, latency, and the first hits, with the chat model kept independent so a cheap chat model stays exactly as it is. Cost levers, cheapest first, are: pick the cheapest model that actually searches on the chosen gateway (verified on api.b.ai to be gpt-5.4-nano returning 2 citations), set dsh-tool-web's searchMaxQueries to 1 so one tool call becomes one search, keep maxResults low, and leave includeAnswer off so the search model's prose is not returned as content. The card exposes protocol (openai or openrouter), baseURL, model, apiKeyEnv, literal apiKey, maxResults (1–25), maxOutputTokens (1024 default), allowedDomains, excludedDomains, and OpenRouter-specific passthroughs such as engine, searchContextSize, maxUses, maxTotalResults, referer, and title. It targets DSH users who want lower search bills on api.b.ai-style gateways and anyone needing verified server-side web search through DeepSeek native clients. Dependencies, limits, and first-run caveats are concrete: Node ≥ 20 is required, the build uses esbuild + typescript with the committed lib/client.js enforced by CI, 35 tests run without network or credentials and one live smoke test is opt-in via DSH_WEB_SEARCH_LIVE=1 OPENROUTER_API_KEY=sk-... plus DSH_WEB_SEARCH_BASE_URL and DSH_WEB_SEARCH_MODEL, and there are no runtime imports of @deepseek-ai/* and no install-time script. The license is Apache-2.0; measured gateway limits show that glm-*, deepseek-*, qwen*, minimax-*, mimo-*, and gpt-5-nano accept the request and silently drop the search (HTTP 200 with 0 results), Gemini and Anthropic endpoints fail, and chat-completions-only gateways return 404 on /responses. The configuration entry is marked overridden and can be reset from the card; on first run, expect WEB_PROVIDER_CREDENTIAL_MISSING if no key is set, an explicit failure if the named model does not search on that gateway, and the requirement to restart dsh web once after install.

dsh-web-search-gateway 是一个面向 DeepSeek Harness 的原生 DSH 插件,用于将内置的网页搜索从 DeepSeek 自有端点迁移到任意 OpenRouter 兼容网关,从而把搜索账单转移到用户已付费的网关账户上。它通过 bundle patch 接入 dsh 的 web seam,安装命令为 dsh plugin add dsh-web-search-gateway --profile web,也可走 dsh plugin add github:vitas/dsh-web-search-gateway 或 link: 本地源码,API key 通过 dsh credential set OPENROUTER_API_KEY 注入并在每次搜索时按"凭据服务→进程环境"顺序解析;安装后必须重启 dsh web 一次,因为补丁和 host 条目只在启动时读取,轮换密钥则无需重启。

典型工作流是在 Settings → Plugins → Web search (OpenRouter) 卡片中配置 Endpoint、Search model 并粘贴 API key,再点击 Test search 获得来源数量、延迟与首条命中;用户可为聊天模型与搜索模型分别选择,将 dsh-tool-web 的 searchMaxQueries 调到 1 以控制成本,也可通过 allowedDomains、excludedDomains、maxResults(1–25)、includeAnswer 等字段微调结果;该项目面向希望降低搜索开销、避免 DeepSeek 计费的 DSH 用户,以及需要在 api.b.ai 等"OpenAI 兼容但搜索实现各异"的网关上验证服务器端搜索的人群。

依赖方面要求 Node ≥ 20,CI 通过 esbuild + typescript 构建并强制 lib/client.js 与源码一致,运行 35 个无网络测试与可选的实时烟雾测试;许可为 Apache-2.0,README 列出已实测的 api.b.ai 协议表(仅 OpenAI 系模型可用 /v1/responses 的 web_search 工具)以及 chat-completions-only 网关会返回 404、未知 tools 被静默丢弃、gpt-5-nano 不支持等具体故障;首次运行需注意:不依赖 @deepseek-ai/* 运行时包,不执行安装脚本,搜索仅在该网关确实实现原生 web 搜索时才会成功,否则插件会显式失败而非返回模型记忆。

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

把 vitas/dsh-web-search-gateway 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-web-search-gateway

Grounded web search for DeepSeek Harness, on the gateway you already pay for.

CI npm license node

Why

The built-in web_search runs on DeepSeek's own endpoint and bills that account — one search is a full model turn, because DeepSeek exposes no dedicated search endpoint. If your chat runs somewhere cheaper, your search does not.

This plugin moves the search call onto an OpenRouter-compatible gateway, so search is billed where your chat already is, at your gateway's price and with the model you pick:

  • Your model. The search model is configured separately from the chat model, so a cheap chat model can stay exactly as it is.
  • Your price. On api.b.ai: chat on a discounted deepseek-v4.1-flash, search on gpt-5.4-nano — the cheapest model there that actually searches.
  • Your ceiling. dsh-tool-web's searchMaxQueries (default 4) can turn one tool call into four searches. Set it to 1 and the cost is one search.

Nothing about the model-facing tool changes: same tool, same arguments, same citeable results. Only the engine behind it moves.

The cheap models usually cannot search. On api.b.ai the DeepSeek, GLM, Qwen, MiniMax and MiMo models accept the request and silently never search — so on that gateway the search model must differ from your chat model. The plugin fails loudly instead of returning the model's memory as results. See Verified gateways.

The Web search settings card, with a passing connection test


Install

dsh plugin add dsh-web-search-gateway --profile web
dsh credential set OPENROUTER_API_KEY   # or export it before launching dsh

The package ships a bundle patch, so the first line composes everything: it points the web seam at this provider and inserts the provider row. The key is resolved per search (credentials service, then the process environment), so rotating it never needs a restart — but the patch and a linked host entry are read at boot, so restart dsh web once after installing.

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

← 上一个 Prev ListForm 下一个 Next dsh-maintainer-doc-guard →