Skip to main content
Connect AI Tools

DeepSeek Harness

DeepSeek Harness is an open-source AI Agent framework by DeepSeek, supporting both Web UI and CLI modes. Connect it to QwenCloud using Pay-as-you-go, Token Plan Individual, or Token Plan Team Edition.

When using qwen4-max, add compat.cacheControlFormat: anthropic for explicit cache and set maxTokens: 262144 for a higher output limit. qwen4-max has a 1M-token context. The maximum output is 131,072 tokens in non-thinking mode and 262,144 tokens for thinking and the final answer combined. The defaults are reasoning_effort=high and thinking_budget=131072.

Install DeepSeek Harness

  1. Install Node.js (v22.19.0 or v24.0.0 or later).
  2. Run the following command to start the DeepSeek Harness Web UI:
npx @deepseek-ai/dsh web
After execution, the Web UI runs at http://127.0.0.1:3080 by default.

Quick Start

1

Get an API Key

Get the API Key for your billing plan:
2

Configure the model

In the Web UI, go to Settings → Models, click Add model provider, and switch to Custom model API. DeepSeek Harness does not include a built-in QwenCloud provider. The Provider ID is user-defined (lowercase); the tables use qwencloud-token-plan and qwencloud as examples:
  • Token Plan
  • Pay-as-you-go
ParameterValue
Provider IDqwencloud-token-plan
Display nameQwenCloud
Base URLhttps://token-plan.maas.qwencloudapi.com/compatible-mode/v1
API protocolOpenAI Chat Completions
API keyThe Token Plan API Key from the previous step
ModelsEnter a text generation model supported by Individual or Team Edition
After saving, select the added model in the Web UI model picker.
3

Verify

Send a message in the Web UI. A normal response confirms the configuration.

Configure with a configuration file

In addition to the options above, you can also connect using a configuration file.
1

Open or create the configuration file

~/.dsh/profiles/web/cordis.patch.yml
2

Write the configuration

Add only the corresponding entry; do not overwrite existing configuration. Set the DASHSCOPE_API_KEY environment variable before starting DeepSeek Harness:
export DASHSCOPE_API_KEY="YOUR_API_KEY"
  • Token Plan Individual
  • Token Plan Team Edition
  • Pay-as-you-go
- id: llm-pi-ai
  config:
    providers:
      qwencloud-token-plan:
        apiKeyEnv: DASHSCOPE_API_KEY
        api: openai-completions
        baseURL: https://token-plan.maas.qwencloudapi.com/compatible-mode/v1
        compat:
          supportsDeveloperRole: false
        models:
          - id: auto
          - id: qwen4-max
          - id: qwen3.8-max
          - id: qwen3.8-flash
          - id: qwen3.7-max
          - id: qwen3.7-plus
          - id: qwen3.6-flash
          - id: deepseek-v4.1-flash
          - id: deepseek-v4.1-flash-1017
          - id: deepseek-v4-pro
          - id: deepseek-v4-pro-0813
          - id: deepseek-v4-flash-0731
          - id: glm-5.3
          - id: glm-5.2
After saving, restart DeepSeek Harness and select the added model in the model picker.

FAQ

Error codes

If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:

Fetch available models returns 401

The QwenCloud OpenAI-compatible endpoint does not provide a GET /models API. Clicking Fetch available models returns 401 or 404. You can ignore this button and manually enter the model ID in the Model catalog.

MISSING_CREDENTIAL error

Re-enter the API Key in the Web UI under Settings > Models and save; or confirm that the DASHSCOPE_API_KEY environment variable is set and restart DeepSeek Harness.

invalid_parameter_error: developer is not one of [system, assistant, user, tool, function]

Reasoning models send the system prompt with the developer role. The QwenCloud OpenAI-compatible Chat Completions endpoint accepts only the system, assistant, user, tool, and function roles, so the request is rejected. The Web UI settings form does not expose this field. Edit ~/.dsh/profiles/web/cordis.patch.yml and add the following configuration to the corresponding provider under the existing llm-pi-ai entry (the examples in "Configure with a configuration file" already include it). Save the file and restart DeepSeek Harness:
        compat:
          supportsDeveloperRole: false
Replace the Provider ID when using another provider. With this setting, the system prompt is sent with the system role. Some older versions (for example, DSH 0.1) do not support this switch; upgrade to the latest version.

The added model does not appear after configuration

Restart DeepSeek Harness, then select the model in the Web UI model selector. To add a model, edit the provider under Settings > Models, add the model ID in the model catalog, and save; you can also edit models in cordis.patch.yml.