dsh-web-search-ddg: API-Key-Free DuckDuckGo Web Search Backend for DSH

Foreword

In DeepSeek Harness (DSH), the model side typically performs web retrieval through the built-in web_search tool. The default implementation often relies on official search capabilities or third-party APIs, requires API keys, and sometimes consumes extra model turns or billed tokens per query. For scenarios involving local deployment, intranet environments, or the attitude of “just make it searchable, without maintaining a search key”, such costs are not always acceptable.

Below is an introduction to the community plugin dsh-web-search-ddg (maintainer korosu): it does not change the shape of the web_search tool seen by the model; it only swaps the search backend at the ctx.web seam to scraping and parsing DuckDuckGo static HTML result pages, achieving no API key, no auxiliary model requests, and one-command installation.

What Is This

dsh-web-search-ddg is an out-of-tree DSH bundle published under the networking tool category. It registers a search provider named ddg at the seam, and can pin the profile’s searchProvider to ddg via the bundle’s patch. The model-facing tool is still provided by dsh-tool-web; this package only contributes the search backend.

Compared with “bring your own search API”, its trade-off is: HTML scraping replaces a formal search API, with no credentials held. When DuckDuckGo rate-limits or abnormal pages appear, the plugin will temporarily mark itself unavailable according to a failure budget, allowing the provider selection logic at the seam to switch to other registered backends instead of returning empty results for a long time.

Core Features

Seam and Tool Shape

After the plugin is mounted, the schema and presentation of the model-side web_search remain unchanged; only the underlying search implementation becomes parsing of DuckDuckGo html.duckduckgo.com result pages (default endpoint is https://html.duckduckgo.com/html/, with ?q= appended on request).

No Key, No Extra Model Turns

The README explicitly states: no API key is needed, no separate auxiliary model request is made per query, and no per-query token billing occurs. The configuration table has no credential-type fields, and there is no settings-card-style key entry step.

Failure Budget and Cooldown

After several consecutive “transient failures” (including timeouts), the provider reports itself unavailable and yields the seam for a configurable cooldown period, so other registered search providers can be selected. Related tunables include failureThreshold (default 3), cooldownMs (default 300000, i.e. 5 minutes), and more; see the configuration section below.

Prebuilt Artifacts and Installation

The repository commits prebuilt lib/, so the package’s build lifecycle does not run during installation, and generally no additional allowBuilds declaration on the profile side is needed. Dependencies include cheerio (for HTML parsing) and @deepseek-ai/schemastery.

Installation and Activation

The installation target is the web profile. Choose any one of the following methods; the three forms install the same prebuilt lib/, differing only in source.

Install from a GitHub reference (from README):

dsh plugin --profile web add github:korosu/dsh-web-search-ddg

Local directory (requires having run pnpm install inside that directory so that cheerio etc. resolve from the plugin’s real path):

dsh plugin --profile web add /path/to/dsh-web-search-ddg

Pinned release package (latest can be replaced with a specific tag to lock the version, e.g. v0.2.0):

dsh plugin --profile web add https://github.com/korosu/dsh-web-search-ddg/releases/latest/download/dsh-web-search-ddg.tgz

dsh plugin add will initialize $DSH_HOME/profiles/web (if it does not exist), install dependencies with pnpm in the profile directory, read the bundle’s dsh.bundle.patch, write dsh-web-search-ddg into dsh.profile.bundles, and then the loader applies cordis.patch.yml: mounting the provider and setting searchProvider to ddg. Do not modify the profile’s own cordis.patch.yml to redeclare the same layer, as this will shadow the bundle’s patch.

After installation, you can first verify the configuration layer without launching a full session:

dsh --profile web --dump-config | grep -A2 searchProvider
dsh web

The output should show a layer marked # == dsh-web-search-ddg, with searchProvider: ddg. Host-side plugin lines do not support hot loading; the host must be restarted after changes.

Specifying the Provider via Environment Variable

Besides the bundle’s pinning of searchProvider: ddg, the seam also supports an environment variable (as the README begins at the truncated part):

export DSH_WEB_SEARCH_PROVIDER=ddg

This expresses the intent to “use the ddg backend” without modifying patch semantics; the exact precedence relative to the profile patch should follow the DSH / dsh-web documentation.

Restoring the Default or Other Backends

Remove the bundle:

dsh plugin --profile web remove dsh-web-search-ddg

Or keep the bundle and change the searchProvider of the web line in the profile’s own cordis.patch.yml back to the official backend (the README example is deepseek-official, and fetchProvider: http must also be written in full, because patch lines replace the config line entirely, without deep merging).

Profile-Level Peer Warnings

The profile is a pnpm workspace with autoInstallPeers: false; during installation, warnings may appear stating that @deepseek-ai/cordis and @deepseek-ai/dsh-web are not found at the profile layer. The README explains that the running host brings these dependencies itself, so the warnings can usually be ignored; to silence them, configure peerDependencyRules.ignoreMissing in the profile’s pnpm-workspace.yaml (README provides an example).

Configuration Options

All keys are optional and are written into the config corresponding to the bundle’s insert line (via extended patch or documentation-convention methods, depending on your DSH version).

Key Default Description
endpoint https://html.duckduckgo.com/html/ Result page URL; must be an absolute http(s) address
maxResults Not set Upper bound on “usable” entries after filtering empty titles, invalid URLs, sponsored lines, and duplicates; only takes effect when the request does not carry maxResults
userAgent Desktop Chrome 124 (UA verified live in README) Request User-Agent; abnormal or outdated UAs may trigger bot detection
acceptLanguage Not set If set, sends the accept-language header
timeoutMs 30000 Per-request timeout (milliseconds); a timeout counts as a transient failure and consumes the failure budget
minIntervalMs 0 Minimum interval between the start of two requests; a single web_search with multiple queries sends requests consecutively, and the README suggests increasing this appropriately to reduce the probability of abnormal pages
failureThreshold 3 Number of consecutive transient failures; after reaching it, the provider becomes temporarily unavailable
cooldownMs 300000 Duration of the above unavailable state (milliseconds)

Typical Usage

After installation and host restart, in a DSH session with the web profile enabled, the model’s calling pattern is the same as with the default search backend: queries are still issued through the built-in web_search tool, with no changes to the prompt or tool name. The developer-side work mainly consists of specifying the web profile, completing installation, confirming searchProvider is ddg, and adjusting timeoutMs, minIntervalMs, or userAgent according to the network environment when necessary.

To pin the installed version, you can use a commit SHA for the GitHub source (github:korosu/dsh-web-search-ddg#<sha>), or use a tag URL of the release tarball.

Suitable Scenarios and Caveats

More suitable for: deployments without a search API key, wanting a zero-token search backend, and accepting the stability of HTML scraping and changes in DuckDuckGo page policies; consistent with the DSH ctx.web seam model, when the external shape of the web_search tool must remain unchanged.

Limitations to be aware of:

  1. Scraping HTML result pages is affected by the target site’s anti-scraping measures, rate limiting, and page structure changes; the plugin degrades via failure budget and cooldown, but cannot guarantee an SLA equivalent to commercial search APIs.
  2. The plugin initiates HTTP requests under the current dsh process’s privileges; before installation, read the source code and the MIT license to confirm that outbound access and dependencies (cheerio, etc.) meet your security and compliance requirements.
  3. The community directory SkillHub is an independent ecosystem site, with no official affiliation to DeepSeek / High-Flyer; the plugin is community-maintained, and star counts and activity should be based on the GitHub page.
  4. HTML scraping is only applicable to DuckDuckGo’s public static result page scenario; if your policy prohibits external scraping or requires auditable search contracts, you should continue using the official or your own API backend.

Closing

dsh-web-search-ddg replaces DSH’s web_search backend with keyless DuckDuckGo HTML parsing; a single dsh plugin --profile web add accomplishes profile initialization, dependency installation, and switching searchProvider to ddg, making it suitable for quickly obtaining a degradable and configurable web search capability under the web profile.

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

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

Xiaoye