{"_id":"@brilliant751/dsh-web-search-litellm","_rev":"2-9bdb950dfb7fca5c4d3e2ae2b382fff9","name":"@brilliant751/dsh-web-search-litellm","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@brilliant751/dsh-web-search-litellm","version":"0.1.0","keywords":["deepseek-harness","dsh","dsh-plugin","web-search","litellm","search"],"author":{"name":"brilliant751"},"license":"MIT","_id":"@brilliant751/dsh-web-search-litellm@0.1.0","maintainers":[{"name":"brilliant751","email":"xcy_tutu@qq.com"}],"homepage":"https://github.com/brilliant751/dsh-web-search-litellm#readme","bugs":{"url":"https://github.com/brilliant751/dsh-web-search-litellm/issues"},"dsh":{"bundle":{"patch":"cordis.patch.yml"}},"dist":{"shasum":"7995c920150109d9deffe29dc40416b23c50b4d9","tarball":"https://registry.npmjs.org/@brilliant751/dsh-web-search-litellm/-/dsh-web-search-litellm-0.1.0.tgz","fileCount":6,"integrity":"sha512-9kh02aMKPymIrrzpCKuwbWXX8T/4MZOhc+fwENUXuKEkorIGgoaFVuiTWxEtGz7knqgS5YStinpaKKdCpmSN+w==","signatures":[{"sig":"MEUCIBKvd2mfcG4T/0HxGaeb8NUP5Ot6oZtZ/wORheuteRYuAiEAsaRMnYOEn+7wwazeJXesiELs+F83iUlhw4smA3RNAOA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16860},"main":"index.js","type":"module","engines":{"node":">=20"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"dc2bba1077cb4e07c9198da07547e6ff7966ed93","_npmUser":{"name":"brilliant751","email":"xcy_tutu@qq.com"},"repository":{"url":"git+https://github.com/brilliant751/dsh-web-search-litellm.git","type":"git"},"_npmVersion":"11.19.0","description":"LiteLLM /v1/search-backed web search provider for the DeepSeek Harness web capability seam (ctx.web). One search is one HTTP request — no model turn.","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@deepseek-ai/dsh-web":"^0.1.0-rc.6"},"peerDependenciesMeta":{"@deepseek-ai/dsh-web":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dsh-web-search-litellm_0.1.0_1787305793280_0.5612178520760451","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@brilliant751/dsh-web-search-litellm","version":"0.1.1","description":"LiteLLM /v1/search-backed web search provider for the DeepSeek Harness web capability seam (ctx.web). One search is one HTTP request — no model turn.","type":"module","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"keywords":["deepseek-harness","dsh","dsh-plugin","web-search","litellm","search"],"author":{"name":"brilliant751"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/brilliant751/dsh-web-search-litellm.git"},"bugs":{"url":"https://github.com/brilliant751/dsh-web-search-litellm/issues"},"homepage":"https://github.com/brilliant751/dsh-web-search-litellm#readme","engines":{"node":">=20"},"scripts":{"check":"node --check index.js && node --check test/provider.test.js","test":"node --test"},"publishConfig":{"access":"public"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.2"},"peerDependencies":{"@deepseek-ai/dsh-launch-environment":"^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-rc.1","@deepseek-ai/dsh-web":"^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-rc.1"},"devDependencies":{"@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1"},"dsh":{"bundle":{"patch":"cordis.patch.yml"}},"gitHead":"c0cd80363659e73856a1f99257f92580503d0b07","_id":"@brilliant751/dsh-web-search-litellm@0.1.1","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-1Jw9Jf1CxW5nE9EQ3StlFRCXM8QGlEIapD3oVFGAhKaWUmdrDyTaGKFBZuPAHYc9DO/UuLvBGhq3JvUheUkbOw==","shasum":"5c77e5b68349ef3a38d03d83e2cad5ff99311520","tarball":"https://registry.npmjs.org/@brilliant751/dsh-web-search-litellm/-/dsh-web-search-litellm-0.1.1.tgz","fileCount":6,"unpackedSize":23729,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAH+STVxB3V3Ip+lK1kRWYuFcfr3Obk15d4+5I+w/xTnAiAw+T85QKRv5Xj/nSVVkIL3IHhW2aLPc/fyw3//arzy1A=="}]},"_npmUser":{"name":"brilliant751","email":"xcy_tutu@qq.com"},"directories":{},"maintainers":[{"name":"brilliant751","email":"xcy_tutu@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-web-search-litellm_0.1.1_1788746821739_0.9325085620205085"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-21T09:49:53.103Z","modified":"2026-09-07T02:07:02.087Z","0.1.0":"2026-08-21T09:49:53.414Z","0.1.1":"2026-09-07T02:07:01.913Z"},"bugs":{"url":"https://github.com/brilliant751/dsh-web-search-litellm/issues"},"author":{"name":"brilliant751"},"license":"MIT","homepage":"https://github.com/brilliant751/dsh-web-search-litellm#readme","keywords":["deepseek-harness","dsh","dsh-plugin","web-search","litellm","search"],"repository":{"type":"git","url":"git+https://github.com/brilliant751/dsh-web-search-litellm.git"},"description":"LiteLLM /v1/search-backed web search provider for the DeepSeek Harness web capability seam (ctx.web). One search is one HTTP request — no model turn.","maintainers":[{"name":"brilliant751","email":"xcy_tutu@qq.com"}],"readme":"# @brilliant751/dsh-web-search-litellm\n\n> [English](README.md) | 中文\n\n基于 [LiteLLM](https://github.com/BerriAI/litellm) `/v1/search` 端点的 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)（`dsh`）网页搜索 provider，接入 `ctx.web` 能力 seam。\n\n一次搜索就是一次发往 LiteLLM 搜索端点的 HTTP 请求——**不消耗模型推理**，这一点不同于自带的 DeepSeek Anthropic 兼容 provider。它复用你现有的 LiteLLM 网关及其虚拟 key，让聊天与搜索走同一个代理。\n\n## 安装\n\n```sh\ndsh plugin --profile web add @brilliant751/dsh-web-search-litellm\n```\n\n重启 `dsh web`。本包声明了 `dsh.bundle.patch`，因此 `dsh plugin add` 会把它追加进 `dsh.profile.bundles`，从而注册 `litellm` provider 并将其选为当前搜索后端。\n\n## LiteLLM 前置配置\n\nLiteLLM 通过一个具名 search tool 路由搜索。这个名称是网关内的本地标识，\n并不等于底层 provider 类型。包内默认配置期望存在名为 `google` 的工具。\n例如，可以在 LiteLLM 的 `config.yaml` 中把它映射到 Google PSE：\n\n```yaml\nsearch_tools:\n  - search_tool_name: google\n    litellm_params:\n      search_provider: google_pse\n      api_key: os.environ/GOOGLE_PSE_API_KEY\n```\n\nGoogle PSE 还要求 LiteLLM 服务端环境中存在 `GOOGLE_PSE_ENGINE_ID`。其他\n`search_provider` 也可以复用同一个本地工具名。\n\n配置 DSH 前，先确认网关的虚拟 key 能看到该工具：\n\n```sh\ncurl https://your-litellm.example.com/v1/search/tools \\\n  -H 'Authorization: Bearer YOUR_LITELLM_VIRTUAL_KEY'\n```\n\n响应的 `data[].search_tool_name` 中必须包含下方配置使用的名称。\n\n## 工作原理\n\n- 向 `ctx.web` 注册一个 id 为 `litellm` 的 `WebSearchProvider`。\n- 调用 `POST {baseURL}/search`，请求体为 `{ query, search_tool_name }`，带 `Authorization: Bearer <key>` 头。\n- 把 LiteLLM 返回的 `results[]`（`title` / `url` / `snippet` / `date`）映射成 seam 规范化的 `sources[]`。\n- 面向模型的 `web_search` 工具保持不变（`@deepseek-ai/dsh-tool-web`），结果保留原生引用卡片。\n\n## 配置\n\n默认值写在 `cordis.patch.yml` 中：\n\n| 键 | 默认值 | 含义 |\n|-----|--------|------|\n| `baseURL` | `https://your-litellm.example.com/v1` | LiteLLM 基础地址；`/search` 会被追加。这是 OpenAI 兼容基础地址，不是 Anthropic passthrough。 |\n| `apiKeyEnv` | `DEEPSEEK_API_KEY` | 凭证引用，每次搜索时通过 `ctx.credentials` 解析（Models 页面写入），然后回退到 DSH 启动环境。 |\n| `searchToolName` | `google` | 要调用的 LiteLLM 搜索工具（见 `GET {baseURL}/search/tools`）。 |\n\n本包导出了 Cordis `Config` schema，因此兼容的 DSH 配置界面可以渲染这些\n字段，并对字面量 `apiKey` 做脱敏。bundle patch 仍然是可移植的初始配置来源。\n\n在你自己 profile 的 `cordis.patch.yml` 或 `--patch` overlay 中覆盖任意值。注意：patch 会**整体替换目标行的 `config`**（不做合并），所以覆盖时必须重写完整配置：\n\n```yaml\n- insert:\n    - id: web-search-litellm\n      name: '@brilliant751/dsh-web-search-litellm'\n      config:\n        baseURL: https://your-litellm.example.com/v1\n        apiKeyEnv: DEEPSEEK_API_KEY\n        searchToolName: google\n```\n\n要切回自带的 DeepSeek provider，把 `web.searchProvider` 改回 `deepseek-official`（或卸载本包）。\n\n## 凭证解析顺序\n\n1. 配置中的字面量 `apiKey`（不推荐——优先用凭证存储）。\n2. `ctx.credentials` 解析 `apiKeyEnv`（Web UI 的 Models/Web-search 卡片会写入 `$DSH_HOME/.credentials.yaml`）。\n3. DSH 启动环境快照：继承的进程环境变量、项目 `.env`，再到 Harness\n   home 下的 `.env`。\n\n## 兼容性\n\n`0.1.1` 支持 `0.1.0-rc.6` 至 `0.1.2-rc.1` 的 DSH web seam\n预发布版本，并要求 Node.js 20 或更高版本。\n\n## 排障\n\n- **已配置的 provider 不可用：**检查 `baseURL` 是否为绝对 URL、\n  `searchToolName` 是否非空，以及凭证存储或启动环境能否解析 `apiKeyEnv`。\n- **HTTP 401/403：**虚拟 key 必须被授权调用所选 LiteLLM search tool；\n  该权限与聊天模型权限相互独立。\n- **找不到 search tool/model：**调用 `GET {baseURL}/search/tools`，把准确的\n  `search_tool_name` 填入插件配置。\n- **搜索响应无效：**确认目标路由是 LiteLLM Search API，且网关返回\n  `results` 数组。\n\n## 安全说明\n\n安装本插件即意味着以你的权限运行其代码。它只会把你的 LiteLLM key 发送给配置的 `baseURL`。请只把 `baseURL` 指向你信任的网关。\n\n## 许可证\n\nMIT\n","readmeFilename":"README.zh.md"}