dsh-connect-opencode-free: Integrating OpenCode Zen's Free Models into DeepSeek Harness

DeepSeek Harness (DSH) is a plugin-architecture-based agent development framework. Integrating external models usually requires writing an adapter or finding an existing solution. OpenCode Zen provides free-tier models, but the official integration process is cumbersome and typically requires managing an API key. The dsh-connect-opencode-free plugin aims to solve this problem. It connects OpenCode Zen’s free tier to DSH without requiring a key and provides a visual management interface.

Core Features

Key-free access to OpenCode Zen free tier
Authentication is fixed as Bearer public. To pass free-tier validation, the adapter impersonates the OpenCode CLI (with a specific User-Agent, x-opencode-session session id, and bash/read tool names). Note that bash/read are real executable tools, not placeholders; when invoked by the model, these two tools are actually executed.

Dual-source model discovery
It merges two data sources in real time: opencode.ai/zen/v1/models (which ids actually exist at the moment) and the opencode section of models.dev/api.json (which models are free, their context size, and supported capabilities). If either source is unreachable, the last known result is retained, so a single network blip will not make models disappear.

One-click management on the settings page
On the settings page, you can search, enable/disable individual models, and enable/disable all models. It also displays the rate-limit status and recovery time for the public quota.

Three-tier usage rules
By default, only the public quota is used. The other two tiers (public-first / private-first) require key validation before they can be selected. This allows users to flexibly switch billing sources when needed.

One-click provider write
It writes the current free model list to llm-pi-ai.providers.opencode-zen, making it easy to use the models directly in DSH’s provider management.

Installation and Activation

This plugin is a DSH cordis plugin package and is integrated through the profile’s package.json.

Method 1: npm installation (recommended)
1. Enter the target profile directory (e.g., ~/.dsh/profiles/<profile-name>/).
2. Add the following to dependencies in package.json:

   "dsh-connect-opencode-free": "^0.4.0"
  1. Add the package name to the dsh.profile.bundles array:
   "dsh-connect-opencode-free"
  1. Run installation in that profile directory:
   pnpm install
  1. Restart dsh (e.g., dsh web), then open Settings → OpenCode Free Models to use it.

Method 2: Run from source (development mode)
1. Clone this repository locally.
2. In the profile’s package.json dependencies, use link: to point to the absolute source path:

   "dsh-connect-opencode-free": "link:/absolute/path/to/dsh-connect-opencode-free"
  1. Also add the package name to the dsh.profile.bundles array.
  2. Run pnpm install, then restart dsh.

Dependencies requirement: Node ≥ 18, and the host provides @deepseek-ai/dsh-llm (peer range >=0.1.7-rc.1 <0.3.0).

Typical Usage

  1. Open Settings → OpenCode Free Models.
  2. Click One-click sync to fetch the currently available free model list.
  3. Configure one of the three quota strategies as needed (default is publicOnly).
  4. After configuring, click One-click write provider to write the model list into Harness’s configuration.

Notes

  • OpenCode Zen is a third-party public service, and its availability, model list, and rate-limiting policy are determined by its operator.
  • Authentication is fixed as Bearer public.
  • The browser-side artifacts are generated by scripts/build.mjs and must be built before running in development mode.

This plugin provides DSH users with a convenient way to integrate OpenCode Zen free models, suitable for scenarios that require low-cost LLM calls and are sensitive to key management.

View catalog page | GitHub repository

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

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

Xiaoye