Introduction

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When using local models (for example, the free model mimo-v2.5-free in the OpenCode ecosystem), developers usually need to configure API keys separately or handle complex local service connections. The dsh-opencode-provider plugin solves this pain point. It connects DSH’s LLM Runtime with a locally running OpenCode server, allowing direct invocation of local models in Harness without using a DeepSeek official API key.

Plugin Overview

Item Content
Name dsh-opencode-provider
Repository goku54477/dsh-opencode-provider
License MIT
Category Model inference
Catalog Page skillhub.cn/plugins/goku54477/dsh-opencode-provider

Installation and Activation

The installation process is completed through DSH’s plugin command.

  1. Run the following command to install the plugin:
dsh plugin --profile web add dsh-opencode-provider

After installation, ensure that your DeepSeek Harness version is >= 0.1.0-rc.8.

Startup and Configuration

Before using this plugin, you need to start the local OpenCode server first, then select and configure the model in DSH.

  1. Start the OpenCode server (default port 4096):
opencode serve --hostname 127.0.0.1 --port 4096
  1. In DeepSeek Harness’s model selection, find and select the local model:
opencode-local/mimo-v2.5-free
  1. Configure baseURL, context window, Token limits, and retry policy as needed. The configuration items are located in DSH’s cordis.yml or the plugin configuration file. Example:
llm-opencode:
  # OpenCode 服务器地址
  baseURL: "http://127.0.0.1:4096"

  # 上下文窗口
  defaultContextWindow: 128000

  # 最大输出 Token
  maxTokens: 16384

  # 声明的模型列表
  models:
    - id: mimo-v2.5-free
      name: mimo-v2.5-free
      description: "OpenCode local agent (text output only)"
      contextWindow: 128000

  # 重试策略
  retryPolicy:
    mode: always
    backoff:
      initialDelayMs: 100
      maxDelayMs: 5000
      jitterRatio: 0.2

Core Features

The plugin communicates with the local OpenCode server through pure HTTP connections and provides the following capabilities:

  • No API key required: Connects directly to the local server via HTTP.
  • Streaming output: Supports SSE (Server-Sent Events) streaming of text increments.
  • Session cancellation: Supports terminating streaming requests via interruption signals.
  • Timeout control: Configurable maximum time for SSE connection establishment, request sending, and completion.
  • Retry policy: Supports configuring provider-level retry policies.
  • Event compatibility: Supports old and new SSE event formats (session.text.delta / session.next.text.delta, etc.).
  • Graceful degradation: Provides fault tolerance for unknown events, non-JSON lines, and nested wrappers.

Working Principle

The plugin uses OpenCodeAdapter as an intermediate layer to translate requests and responses between the DSH Runtime and the OpenCode server:

  1. Session creation: Send a POST /api/session request to the OpenCode server.
  2. Concurrent communication: Initiate an SSE subscription (GET /api/session/{id}/event) and prompt submission (POST /api/session/{id}/prompt) simultaneously to avoid the server blocking the sending of streaming headers while waiting for activity.
  3. Dialog serialization: Serialize DSH’s full dialog (system prompt + message history) into a specific format embedded in the prompt.
  4. Event translation: Map the SSE events returned by OpenCode to DSH’s StreamChunk types (such as block-start, text-delta, finish).
  5. Cleanup: On completion, error, or interruption, send an interruption signal to clean up the session.

Limitations

Based on verified facts, the plugin has the following limitations:

  • Text output only: OpenCode runs an independent Agent/tool loop, and the plugin does not expose structured tool-calling capabilities.
  • No multimodal support: Supports text input and output only; images, audio, and video are not supported.
  • Single model advertised: The default catalog lists only mimo-v2.5-free; adding other models requires manual configuration.
  • Prompt size limit: The entire dialog is serialized into a single prompt string; long conversations may exceed the model’s context window.
  • No persistent sessions: Each stream() call creates a new session, and dialog state is not maintained across requests.
  • Local-first: Binds to 127.0.0.1 by default; remote servers require manually modifying baseURL and do not support TLS encryption. Exposure to untrusted networks is strictly prohibited.

Conclusion

dsh-opencode-provider provides a convenient entry point for developers who want to deploy low-cost inference capabilities locally. It simplifies the process of integrating local models into DSH, but due to OpenCode’s own architecture (pure text, no structured tools), it is better suited for text-generation tasks.