Introduction

DeepSeek Harness (DSH) extends primarily through plugins. To integrate local or remote Ollama services into DSH’s web profile, common requirements include not just the ability to “chat” but also native Ollama parameters, model discovery, and inference status display. dsh-llm-ollama is the provider plugin for DSH’s Ollama integration. It connects to local or remote Ollama services using the native Ollama POST /api/chat protocol and provides a full-page Ollama settings interface along with one-click model discovery.

What is this

dsh-llm-ollama is a community plugin maintained by 1035041186, licensed under MIT, and is unofficial.

It addresses the provider adaptation problem of integrating Ollama on the DSH side: using the Ollama service as a model provider for DSH, supporting chat, tool calls, image attachments (multimodal models), inference process display, model parameter passthrough, and session-level context override.

Core Features

Full-page Ollama Settings Interface

The plugin provides a full-page settings interface via the settings.section extension point:

  • Entry: Settings → Ollama.
  • Manage provider configuration.
  • Provider-level parameters include API address, keep_alive, temperature (range 0–2), and an optional API key.
  • Also provides settings.yaml equivalent configuration.

Native Ollama Chat

The plugin uses the native Ollama protocol for chat:

  • Interface: POST /api/chat.
  • Streaming response: NDJSON.
  • Supports tool calls.
  • Supports image attachments, requiring multimodal models that support vision.
  • Supports inference process display, rendering message.thinking traces as thinking blocks.

Model Discovery

The plugin discovers models via the Ollama server interface:

  • Uses GET /api/tags to fetch models on the server.
  • Models can be checked to add to the model directory.
  • Manual model addition is also supported.

Model-level Parameters

Model-level parameters are mapped to Ollama’s options:

  • Context window maps to options.num_ctx.
  • Maximum output tokens map to options.num_predict.
  • If the context window is not filled, it defaults to sending 32K / 32768.

Inference Control

The inference control item is thinkingCapable:

  • Automatically identified by default.
  • The basis for automatic identification is the thinking field in the model’s capabilities returned by /api/tags.
  • If the automatic judgment does not meet expectations, it can be manually overridden to always show or always hide.
  • The inference level menu defaults to providing off / on, corresponding to think: false / think: true.
  • Supports levels mode, providing low / medium / high / max and default inference levels.

Session-level Context Override

In a session, you can temporarily override the current session’s context using /ollama-context:

  • Presets: 4K / 8K / 16K / 32K / 64K / 128K.
  • Custom values are supported.
  • Following system configuration is supported.
  • The override value is used as num_ctx.
  • Only effective for the current session.

Local or Remote Service

The plugin supports local or remote Ollama services:

  • Local default address: http://localhost:11434.
  • For remote services, simply fill in the corresponding API address.
  • The configuration method for local and remote API addresses is the same.

Installation and Activation

Environment Requirements

  • DeepSeek Harness web profile.
  • Tested version 0.1.0-rc.6.
  • Compatible from v0.1.9 with 0.1.1-rc.2 and above; this version requires the adapter to implement prepareCall.
  • Requires an Ollama service and curl.
  • Linux / macOS comes with curl; Windows 10+ comes with curl.
  • package.json shows version 0.1.16, license MIT, private: true, engines.node >=22.19.0.

Installation Commands

First confirm the DSH web profile is available, then execute:

dsh plugin --profile web add git+https://github.com/1035041186/dsh-llm-ollama.git
dsh --profile web --dump-config
dsh web

The first command installs the plugin.
The second command is optional, used to confirm the llm-ollama plugin line exists.
The third command restarts the web side to apply the configuration.

After installation, the plugin automatically mounts the llm-ollama plugin line via cordis.patch.yml and dsh.bundle.patch in package.json.

Upgrading from Old Versions

If upgrading from an old version ≤0.1.2 and previously manually added the llm-ollama line in cordis.patch.yml, you must delete that line and restart to avoid triggering:

duplicate loader entry id: llm-ollama

Typical Usage

Local Ollama Service

First prepare the model on the Ollama side and start the service:

ollama pull llama3.2:3b
ollama serve

The local service listens by default on:

http://localhost:11434

Configuring DSH Provider

  1. Refresh the page and go to “Settings → Ollama”.
  2. Configure the API address, for example http://localhost:11434.
  3. Configure keep_alive, temperature, and optional API key as needed.
  4. Click “Get Available Models” to pull models from the Ollama server and check them to add.
  5. You can also manually add models.
  6. Expand a model and fill in the context window, for example 32K.
  7. Fill in the maximum output tokens.
  8. Configure inference control; by default it is auto-detected, but you can manually override to always show or always hide if necessary.

After saving, this provider will appear in the session’s model selector.

Temporarily Adjusting Context in Session

In the session input box, type:

/ollama-context

Then select a preset value, a custom value, or follow the system configuration. This override value is sent as num_ctx and only applies to the current session.

Debugging without Real Ollama

When there is no real Ollama service, you can run the built-in mock Ollama server:

node scripts/mock-ollama.mjs

This mock server listens on:

127.0.0.1:11434

Used for /api/tags and streaming /api/chat debugging.

Use Cases and Notes

Suitable for users of the DSH web profile who wish to connect to local or remote Ollama. Especially suitable for scenarios requiring native Ollama parameter passthrough, /api/tags model discovery, num_ctx / num_predict configuration, and session-level context override.

Please note the following:

  • This is a community plugin, not officially produced.
  • The plugin runs with the current dsh process permissions; you should check the source code, repository, and license before installing.
  • The image functionality requires multimodal models that support vision; pure text models will receive an error from Ollama when an image is attached.
  • The API key field currently only saves the credential reference and has not yet been sent with the request.
  • For remote deployment authentication, it is recommended to configure a reverse proxy in front of Ollama for TLS and access control.
  • dsh plugin add using pnpm file: / git protocols will copy the plugin into the profile’s node_modules. Local source code modifications will not be reflected automatically; for debugging, you can change it to link: pointing to a local directory.

Links