> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hostlinku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DeepSeek Harness

> Connect DeepSeek Harness (dsh)—DeepSeek’s open-source agent—to Hostlinku via DEEPSEEK_BASE_URL. Installation guide, cordis.patch.yml configuration, and tested troubleshooting procedures.

[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) is an open-source
coding agent from DeepSeek. Within the working folder you select, `dsh` can read files, edit
code, run shell commands, and complete multi-step tasks—via the web interface,
headless mode, SDK, or ACP.

`dsh` uses the **Anthropic Messages** protocol. Hostlinku provides it at
[`POST /v1/messages`](https://docs.hostlinku.com/en/anthropic-messages), so `dsh` can be directed to Hostlinku with just
two environment variables—no proxy, no additional plugins.

Tested version

This guide has been end-to-end verified with `@deepseek-ai/dsh` **0.2.1-rc.5** (the agent reads the file
via the tool and then responds, in headless mode). DeepSeek Harness is still in *development preview*; file names
or parameter behavior may change in future versions.

## Before you begin

* **Latest Node.js LTS** (`node --version`). The `dsh` package pulls in hundreds of dependencies, so
  the initial installation may take 1–3 minutes.
* **Hostlinku API key** `sk-…` from [console.hostlinku.com](https://console.hostlinku.com) → **API Keys**.
* **Balance** or sufficient spending limit for that key.
* **Secure test folder.** The folder where you run `dsh` becomes its default workspace.
  Do not run it directly from your home directory or a folder containing sensitive data.

### Install DeepSeek Harness

```bash theme={null}
npm install -g @deepseek-ai/dsh
dsh --version
```

Or run it without a global installation: `npx @deepseek-ai/dsh web`.

### Redirect to Hostlinku

`dsh` reads the endpoint from `DEEPSEEK_BASE_URL` and the API key from `DEEPSEEK_API_KEY`.

**macOS / Linux / WSL** (save to `~/.zshrc` or `~/.bashrc`):

```bash theme={null}
export DEEPSEEK_BASE_URL=https://api.hostlinku.com
export DEEPSEEK_API_KEY=sk-your-api-key
```

**Windows PowerShell:**

```powershell theme={null}
$env:DEEPSEEK_BASE_URL = "https://api.hostlinku.com"
$env:DEEPSEEK_API_KEY  = "sk-your-api-key"
```

`dsh` adds `/v1/messages` on its own. The base URL `https://api.hostlinku.com/v1` is also accepted
(the `/v1` suffix is reused, not duplicated).

### Select the model and output limits

The built-in `dsh` model (`deepseek-flash`) is not a Hostlinku slug, and `dsh` sends `max_tokens: 256000`
by default—exceeding the output limit of most models. Both are configured in the home directory patch file
`~/.dsh/cordis.patch.yml` (or `$DSH_HOME/cordis.patch.yml` if you’ve set `DSH_HOME`).

```yaml theme={null}
- id: agent-default-model
  config:
    provider: deepseek-official
    model: deepseek-v4-1-flash
- id: llm-deepseek
  config:
    apiKeyEnv: DEEPSEEK_API_KEY
    maxTokens: 32000
```

Patch replaces the entire config block

The patch does not merge fields one by one—the `config` block in the patch **replaces** the
. Therefore, `provider: deepseek-official` and `apiKeyEnv` must remain as-is, or `dsh`
will fail to start with the error `$.provider missing required value`.

### Run

Quick test using headless mode (one task, print the final answer, then exit):

```bash theme={null}
mkdir dsh-test && cd dsh-test
echo "the secret word is PINEAPPLE" > hello.txt
dsh --profile headless "Read hello.txt and reply with only the secret word."
```

Correct output: `PINEAPPLE`. This means the agent successfully called the file-reading tool via Hostlinku and
responded. For the full browser interface:

```bash theme={null}
dsh web
```

### Verification

Open the console → **Request Log**. Requests from `dsh` are displayed with the model you selected, the number of
tokens, the cost, and the API key used.

## Recommended model

The `model` field can be populated with any slug from the [catalog](https://docs.hostlinku.com/en/models.md) that supports tool calls. The list
of active models for your key is available at `GET /v1/models`.

| Requirements | Slug | Notes |
| - | - | - |
| Daily default, fast, and affordable | `deepseek-v4-1-flash` | Context: 1M, reasoning, tool calling. |
| Image input required (screenshots, diagrams) | `deepseek-v4-1-flash` | Support the vision. |
| Major task / major refactor | `deepseek-v4-1-flash-hyper` | Context 1M, deeper reasoning. |
| Open-weight alternative | `kimi-k2-7-code`, `glm-5-3` | Tool calling and reasoning. |

Adapt "maxTokens" to the model

`maxTokens` limits the output per request, not the context size. The value `32000` in the example is the default configuration, not the model’s maximum. Check the model’s output limit in the [catalog](https://docs.hostlinku.com/en/models.md); if the limit isn’t listed, reduce the value if the request is rejected.

## Security

* While the task is running, prompts, code snippets, file contents, and tool outputs are sent to Hostlinku for
  inference. Do not run `dsh` on projects containing trade secrets or personal data without permission.
* Use a **separate API key** specifically for `dsh` with a spending limit, so it can be easily revoked if compromised.
  See [Authentication](https://docs.hostlinku.com/en/authentication.md).
* Do not write the API key directly in `cordis.patch.yml`. `apiKeyEnv` only stores the **name**
  of the variable; the key value is still read from the environment.

## Troubleshooting

| Symptoms | Causes & Solutions |
| - | - |
| `INVALID_REQUEST: max_tokens (256000) exceeds the output limit of model …` | `maxTokens` has not been set. Add `maxTokens: 32000` in the `llm-deepseek` block. |
| `startup failed … $.provider missing required value` | The `agent-default-model` block in the patch does not include `provider`. Rewrite it completely as shown in the example above. |
| `MISSING_CREDENTIAL` | `DEEPSEEK_API_KEY` has not been exported in the shell where `dsh` is running. |
| `401` / *invalid API key* | The key is incorrect, revoked, or expired. Create a new key in the console. |
| `404 model not found` | The slug is incorrect or is still `deepseek-flash`. Copy the slug from `GET /v1/models`. |
| Image attachment failed | `dsh` first attempts to upload an image via `/v1/files`, then automatically resends the image inline. Ensure the selected model supports vision (e.g., `deepseek-v4-1-flash`). |

Full details on plugin options are available in the
[DeepSeek Harness repository](https://github.com/deepseek-ai/deepseek-harness). Related guides:
[Claude Code](https://docs.hostlinku.com/en/integrations/claude-code.md) · [CC Switch](https://docs.hostlinku.com/en/integrations/cc-switch.md) ·
[Anthropic Messages](https://docs.hostlinku.com/en/anthropic-messages.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.