DeepSeek Harness (DSH) includes a built-in web_search tool, but the default official provider (deepseek-official) is limited to DeepSeek’s Anthropic endpoint and cannot point to other gateways. If developers want to use it across gateways or need more flexible protocol support, additional configuration is required. The following section introduces the dsh-web-search-diy plugin, which supports multiple protocols by registering a ctx.web provider and overriding the shared searchProvider.

What Is This

This is a DeepSeek Harness (DSH) web search provider plugin, maintained by aaronlei and licensed under MIT. It connects DSH’s built-in web_search tool to multiple protocols, returns structured citation sources, and allows the calling model to answer based on citations.

Core Features

The plugin supports the following:

  • Multi-protocol support: Four optional protocols are supported, including the OpenAI-compatible Responses API, the Anthropic Messages API, Zhipu Web Search API (basic retrieval), and Zhipu Web Search in Chat (answer enhancement).
  • Structured citations: Returns structured citation sources so the model can answer based on citations.
  • Configuration override: Registers a ctx.web search provider and overrides the shared searchProvider, consistent with the behavior of other provider plugins in the DSH ecosystem.
  • Flexible configuration: Supports custom endpoints, models, and credential references.

Installation and Enablement

Install from npm:

dsh plugin --profile web add dsh-web-search-diy

Local development install:

dsh plugin --profile web add link:./dsh-web-search-diy

After installation, the plugin automatically inserts the loader, overrides the configuration, and disables the built-in DeepSeek-official search. There is no need to manually edit cordis.patch.yml.

Typical Usage

The core of the plugin is selecting a protocol through the mode configuration.

  1. Responses mode (default): Uses the OpenAI-compatible Responses API. This mode triggers search through POST /responses and declares web_search in tools. Most OpenAI-compatible gateways trigger built-in search only in this way.
  2. Anthropic Messages mode: Uses the Anthropic-compatible Messages API and invokes the native web_search_20250305 server tool. This mode supports custom apiVersion and maxUses.
  3. Zhipu search modes: Includes zhipu-web-search (basic retrieval) and zhipu-chat-search (answer enhancement).

In Anthropic mode, the thinking process can be disabled with the anthropicThinking toggle. If the endpoint is empty, it falls back to the environment variable $DEEPSEEK_SEARCH_BASE_URL.

Use Cases and Notes

  • Use cases: Developers who need to use endpoints other than DeepSeek official; scenarios with an OpenAI-compatible gateway where search is triggered only through the Responses API; users who need the Anthropic native web_search tool and want flexible parameter configuration.
  • Notes: Anthropic mode does not support adjusting thinking through effort or budget. Each Anthropic turn is recorded in the session. OpenAI-compatible gateways trigger search only through the Responses API; Chat Completions search flags are silently ignored.

Summary

This plugin decouples DSH’s search capability from various protocols and is suitable for scenarios that require flexible gateway and model configuration. For more details and source code, refer to the GitHub repository.