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¶
- Save DeepSeek search quota: Search no longer consumes a DeepSeek cloud model call each time; it uses Tavily’s independent quota instead.
- Multiple-key rotation:
apiKeysupports 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. - Zero-intrusion mounting: Registers only via
registerSearchProvider; does not modify upstream DSH files. - Keys not written to disk:
apiKeysupportsenv:VARreferences; if not configured, it falls back to the startup environment variableTAVILY_API_KEY. - Cancellation and error mapping:
AbortSignalis mapped toWEB_ABORTED; redirects and non-JSON error bodies are returned asWebError.
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.
Option 1: CLI Installation (Recommended)¶
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:
- Add the dependency and bundle list to the profile’s
package.json(replace paths as appropriate). - Write
TAVILY_API_KEY=tvly-xxxinto%USERPROFILE%/.dsh/.env(on Linux/macOS:~/.dsh/.env). - Edit the profile’s
cordis.patch.yml(for a complete example, seecordis.patch.example.ymlin 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¶
- No
web-search-tavilyrelated warnings ordid not activatemessages appear in the startup logs. web/deepseek-search-llm-requestno longer appears in session events.- When calling
web_search, titles, snippets, and dates should match Tavily’s returned format.
FAQ¶
WEB_PROVIDER_UNAVAILABLE:TAVILY_API_KEYis not set, orapiKeyis empty; if the variable referenced byenv:VARis unset, the plugin errors and specifies the variable name.WEB_PROVIDER_AMBIGUOUS:searchProvideris not fixed for web and multiple providers are available; confirm that- id: webin the patch includessearchProvider: 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
searchProviderback todeepseek-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¶
- Community catalog: https://www.skillhub.cn/plugins/zyfgood/dsh-web-search-tavily
- Source code and documentation: https://github.com/zyfgood/dsh-web-search-tavily