DeepSeek Harness (DSH) uses a plugin-based architecture. If you need to call locally deployed models (such as llama.cpp) in the Harness environment, you need to route requests to the local server through an adapter. The dsh-llamacpp plugin is a connector designed for this purpose.

Plugin Positioning

This is the DeepSeek Harness LLM adapter plugin developed by jwilson411, used to connect to a local llama-server.

It communicates with the server via llama.cpp’s OpenAI-compatible endpoint /v1/chat/completions and is registered as the llamacpp provider in Harness’s ctx.llm routing. After installation, llamacpp exists as a provider route, and Harness invokes it through ctx.llm.stream().

Core Features

  • Connects to a local llama.cpp OpenAI-compatible server
  • Registers the llamacpp provider route
  • Supports streaming text output
  • Supports forwarding of tool calls (tools)
  • Includes various error-handling logic

Installation

Install the plugin via the command line. The package includes dsh.bundle.patch, which automatically inserts the configured llamacpp entry into the current profile.

dsh plugin --profile web add github:jwilson411/dsh-llamacpp

Typical Usage

Make sure that llama-server is running locally. The following is a startup example:

llama-server -m qwen.gguf --port 8080 --alias qwen -c 32768 --api-key $DSH_LLAMACPP_API_KEY

In the Harness Cordis overlay configuration, point to that server:

- id: llamacpp
  config:
    baseURL: http://127.0.0.1:9090/v1
    model: qwen3-coder
    apiKey: change-me

Configuration Notes

The plugin’s configuration items and default values are as follows:

Key Env Fallback Default
baseURL DSH_LLAMACPP_BASE_URL http://127.0.0.1:8080/v1
model DSH_LLAMACPP_MODEL qwen
apiKey DSH_LLAMACPP_API_KEY (unset)
provider — ['llamacpp']

Configuration logic:
- baseURL already includes /v1; requests are sent to ${baseURL}/chat/completions. Avoid duplicating /v1 in the URL.
- Environment variables take precedence over configuration entries. If a configuration entry is empty, the corresponding environment variable is consulted; if that environment variable is empty, the value is treated as unset.
- The default value for provider is ['llamacpp'].

Error Handling and Limitations

The plugin explicitly throws errors and does not swallow failures.

Error Codes

  • PROVIDER_UNREACHABLE: connection refused, DNS failure, or stream interruption (usually because llama-server is not running).
  • PROVIDER_HTTP_ERROR: non-2xx HTTP response.
  • PROVIDER_ERROR: an error payload returned by the server.
  • PROVIDER_PROTOCOL_ERROR: streaming frame is not in JSON format.
  • UNSUPPORTED_CONTENT: the message includes image, tool call, or tool result blocks (the plugin supports text only).

Limitations

  • Text only: images and tool results are not supported.
  • Not a tool: it registers a provider, not a tool, and is not registered in ctx.tools.
  • Ollama is not supported: it only recognizes llama-server, not Ollama’s /api/* routes or automatic model pulling.

Conclusion

dsh-llamacpp is a lightweight adapter focused on streaming text. If you use a native llama.cpp server, it can directly convert Harness calls into OpenAI-format requests. Currently, it supports text only and does not support images or complex tool call chains.