@zyfgood/dsh-web-search-tavily: Replace DSH's web_search backend with Tavily

Preface

In DeepSeek Harness (DSH), web_search uses the deepseek-official search backend by default: every search is equivalent to a full model invocation and consumes DeepSeek API quota. If you prefer to control search costs separately or already have a Tavily account, you can switch the search backend to Tavily Search API—the Tavily free tier offers about 1000 credits/month, billed separately from model quota.

The following describes the community plugin @zyfgood/dsh-web-search-tavily (maintainer zyfgood). It registers a tavily search provider via DSH’s official ctx.web provider interface, without modifying upstream DSH code. This pattern is consistent with official dsh-web-search-exa and Perplexity-based plugins.

What This Is

Positioning: A DSH web tool plugin that switches the web_search search backend from DeepSeek cloud to the Tavily API.

npm package name: @zyfgood/dsh-web-search-tavily (the name: field in the plugin line in your profile must be exactly this). There is also a non-scoped npm package dsh-web-search-tavily maintained by someone else; it is unrelated to this plugin.

Compatibility range (from package.json): DSH >=0.2.0-rc.2 <0.3.0-0, verified on DeepSeek Harness Desktop 0.2.0-rc.2; Node >=20. License: MIT.

How It Works

DSH’s web capabilities are extended via a provider seam (ctx.web.registerSearchProvider). This plugin registers a provider named tavily (sends POST /search to Tavily with a Bearer key), and sets searchProvider in the web configuration to tavily:

web_search tool (dsh-tool-web)
  → ctx.web.search()
  → searchProvider: tavily   # this plugin (default was deepseek-official)

Field mappings: Tavily results[].content → snippet, published_date → publishedAt; score is not carried over. If includeAnswer: true is enabled, the answer generated by Tavily is mapped to the result’s content. Entries with no URL, or with neither content nor title, are discarded.

Core Features

  1. Save DeepSeek search quota: Search no longer consumes a DeepSeek cloud model call each time; it uses Tavily’s independent quota instead.
  2. Multiple-key rotation: apiKey supports comma-separated multiple keys; on 401/403/429/5xx or transport errors, it automatically switches to the next key, and sticks to the current key after a success; bad requests such as 400 fail immediately.
  3. Zero-intrusion mounting: Registers only via registerSearchProvider; does not modify upstream DSH files.
  4. Keys not written to disk: apiKey supports env:VAR references; if not configured, it falls back to the startup environment variable TAVILY_API_KEY.
  5. Cancellation and error mapping: AbortSignal is mapped to WEB_ABORTED; redirects and non-JSON error bodies are returned as WebError.

Installation and Activation

The plugin runs with the permissions of the current DSH process. Before installing, it is recommended to review the source code and MIT license in the GitHub repository.

Before installation or before restarting dsh web, set the Tavily key in your startup environment (e.g., ~/.dsh/.env):

export TAVILY_API_KEY=tvly-xxx

For DeepSeek Harness Desktop users, the profile name is desktop:

dsh plugin --profile desktop add @zyfgood/dsh-web-search-tavily

You can also install via Git (the repository root is the plugin directory):

dsh plugin --profile <name> add "github:zyfgood/dsh-web-search-tavily#main&path:/"

The package includes cordis.patch.yml (dsh.bundle.patch). During CLI installation, it automatically inserts the plugin line and sets web’s searchProvider to tavily. Restart dsh web after installation to enable it.

Option 2: Manual Mounting

Suitable for cases where the plugin is not available via the default channel or you need a custom path:

  1. Add the dependency and bundle list to the profile’s package.json (replace paths as appropriate).
  2. Write TAVILY_API_KEY=tvly-xxx into %USERPROFILE%/.dsh/.env (on Linux/macOS: ~/.dsh/.env).
  3. Edit the profile’s cordis.patch.yml (for a complete example, see cordis.patch.example.yml in the repository):
- insert:
    - id: web-search-tavily
      name: '@zyfgood/dsh-web-search-tavily'
      config:
        apiKey: 'env:TAVILY_API_KEY'
- id: web
  name: '@deepseek-ai/dsh-web'
  config:
    searchProvider: tavily
    fetchProvider: http

Note: The config for - id: web replaces the entire key. When overriding it, you must also include fetchProvider: http; otherwise web_fetch will be lost.

Configuration Options

Option Type Default Description
apiKey string fallback $TAVILY_API_KEY Supports env:VAR; comma-separated multiple keys; if empty, the provider is unavailable
baseURL string https://api.tavily.com Can point to a self-hosted gateway; /search is appended automatically
searchDepth basic | advanced basic advanced performs re-ranking and costs about 2 credits per request
maxResults number Tavily default Default number of results when maxResults is not included in the request
includeAnswer boolean false Whether to return Tavily-generated answers (written into result content)

Verifying It Works

  1. No web-search-tavily related warnings or did not activate messages appear in the startup logs.
  2. web/deepseek-search-llm-request no longer appears in session events.
  3. When calling web_search, titles, snippets, and dates should match Tavily’s returned format.

FAQ

  • WEB_PROVIDER_UNAVAILABLE: TAVILY_API_KEY is not set, or apiKey is empty; if the variable referenced by env:VAR is unset, the plugin errors and specifies the variable name.
  • WEB_PROVIDER_AMBIGUOUS: searchProvider is not fixed for web and multiple providers are available; confirm that - id: web in the patch includes searchProvider: tavily.
  • 401 / invalid key: The key is invalid; with multiple keys configured, rotation is automatic, and only after all fail will an error be reported.
  • Switching back to DeepSeek official search: Change web’s searchProvider back to deepseek-official, or delete this plugin’s override line to restore the base bundle default.

Use Cases and Notes

Suitable for: Developers already using the DSH 0.2.0-rc.2 series who want to separate search and model quota, or need Tavily’s searchDepth / multi-key rotation capabilities.

Notes: The plugin is categorized as a “Network Tool” in the community catalog SkillHub and has no official affiliation with DeepSeek / High-Flyer. Installation and configuration changes affect the DSH process of the current profile; please verify the repository version (currently npm 0.2.0) against the engines.dsh constraints.

Links

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye