Introduction

The ctx.web interface in DeepSeek Harness (DSH) is inherently model-agnostic, but the default provider, dsh-web-search-deepseek, relies on DeepSeek’s server-side search capabilities. When switching to local models (such as Ollama), the search function fails due to the absence of an API key. The gausszhou/dsh-web-search-local plugin bypasses DeepSeek’s server-side search by registering local providers, enabling local models to directly invoke web search and page fetching.

Feature Overview

This plugin provides two types of providers:
- local-multi: A local multi-engine web search provider.
- local-fetch: A local page fetching provider.

Search uses a hierarchical strategy: SearXNG (private) -> Global (Google, DuckDuckGo, Mojeek) -> CN (Bing, Baidu, Sogou, 360). Engines within the same layer query in parallel, and results are merged and polled. If a layer returns no results, it falls back to the next layer. Page fetching supports charset-aware decoding (including GBK).

Installation and Activation

Install via the DSH CLI; the plugin will automatically activate.

dsh plugin add @gausszhou/dsh-web-search-local

After installation, the web configuration automatically switches to the local-multi / local-fetch providers and disables web-search-deepseek. To adjust the default configuration, you can override it in cordis.patch.yml.

Configuration

Configure the engine list, proxy, timeout, and other parameters in cordis.patch.yml.

config:
  engines: [searxng, google, duckduckgo, mojeek, bing, baidu, sogou, 360]
  skipWithoutProxy: [google, duckduckgo, mojeek]
  proxyUrl: ''  # ''自动 | 'off' | 'http://host:port'
  searxngBaseUrl: 'http://127.0.0.1:8080'
  searchTimeoutMs: 12000
  engineMinIntervalMs: 1500

Proxy settings can be specified via the environment variables HTTPS_PROXY or HTTP_PROXY. The proxy only applies to global engines; CN engines connect directly.

Rate Limiting and Resilience

The plugin includes built-in mechanisms for handling engine throttling:
- Throttling: engineMinIntervalMs prevents repeated calls to a single engine.
- Circuit breaker: Triggers cooldown upon encountering verification walls or anomalies.
- Fallback: DuckDuckGo automatically attempts the Lite endpoint when limited.

Notes

  • Requires Node.js >= 20.3.
  • The Node process does not read the system browser proxy; specify it via configuration or environment variables.
  • The Google engine is prone to scraping restrictions; configuring SearXNG is recommended.