DeepSeek Harness

Updated at:

Use Alibaba Cloud Model Studio models in DeepSeek Harness.

Quick Start

  1. 1

    Start the Web UI

    Run the following command to start the DeepSeek Harness Web UI:

    dsh web
    

    The default address is http://127.0.0.1:3080; the browser opens automatically on local startup.

  2. 2

    Get an API Key

    Get the API Key for your billing plan:

  3. 3

    Configure the model

    In the Web UI, go to Settings → Models, click Add model provider. Token Plan uses a built-in provider; pay-as-you-go and Coding Plan use a custom model API.

    Token Plan

    In Third-party model provider, select a provider and enter the Token Plan API Key from the previous step. DeepSeek Harness supplies the model list from its built-in catalog.

    ParameterValue
    Provider (Personal Edition)qwen-token-plan-individual-cn
    Provider (Team Edition)qwen-token-plan-cn
    API keyThe Token Plan API Key from the previous step
    ModelsSupplied by the built-in catalog; add or remove models in the model catalog. For the models supported by your plan, see Personal Edition or Team Edition

    Pay-as-you-go

    Pay-as-you-go has no built-in provider. Switch to Custom model API.

    ParameterValue
    Provider IDbailian (user-defined)
    Display nameAlibaba Cloud Model Studio (user-defined)
    Base URLhttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1, replacing {WorkspaceId} with your Workspace ID
    API protocolOpenAI Chat Completions
    API keyThe Model Studio API Key from the previous step
    ModelsFor example, qwen3.8-max or qwen3.8-flash

    Coding Plan

    Coding Plan has no built-in provider. Switch to Custom model API.

    ParameterValue
    Provider IDbailian-coding (user-defined)
    Display nameAlibaba Cloud Model Studio (user-defined)
    Base URLhttps://coding.dashscope.aliyuncs.com/v1
    API protocolOpenAI Chat Completions
    API keyThe Coding Plan API Key from the previous step
    ModelsEnter a supported text generation model

    After saving, select the added model in the Web UI model picker.

  4. 4

    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. 1

    Open or create the configuration file

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

  2. 2

    Write the configuration

    Add only the corresponding entry; do not overwrite existing configuration. Set the BAILIAN_API_KEY environment variable before starting DeepSeek Harness:

    export BAILIAN_API_KEY="YOUR_API_KEY"
    

    Token Plan Personal Edition

    - id: llm-pi-ai
      config:
        providers:
          qwen-token-plan-individual-cn:
            apiKeyEnv: BAILIAN_API_KEY
            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
    

    Token Plan Team Edition

    - id: llm-pi-ai
      config:
        providers:
          qwen-token-plan-cn:
            apiKeyEnv: BAILIAN_API_KEY
            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-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: kimi-k2.7-code
              - id: kimi-k2.6
              - id: kimi-k2.5
              - id: glm-5.3
              - id: glm-5.2
              - id: glm-5.1
              - id: glm-5
              - id: MiniMax-M2.5
    

    Pay-as-you-go

    Replace {WorkspaceId} with your actual Workspace ID:

    - id: llm-pi-ai
      config:
        providers:
          bailian:
            apiKeyEnv: BAILIAN_API_KEY
            api: openai-completions
            baseURL: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
            compat:
              supportsDeveloperRole: false
            models:
              - id: qwen3.8-max
              - id: qwen3.7-plus
              - id: qwen3.8-flash
              - id: deepseek-v4-pro-0813
              - id: deepseek-v4.1-flash
    

    Coding Plan

    - id: llm-pi-ai
      config:
        providers:
          bailian-coding:
            apiKeyEnv: BAILIAN_API_KEY
            api: openai-completions
            baseURL: https://coding.dashscope.aliyuncs.com/v1
            compat:
              supportsDeveloperRole: false
            models:
              - id: qwen3.7-plus
              - id: qwen3.6-plus
              - id: kimi-k2.5
              - id: glm-5
              - id: MiniMax-M2.5
              - id: qwen3.5-plus
    

    NoteWith the built-in Token Plan provider, models can be omitted; DeepSeek Harness uses every model in the built-in catalog. The models lists above explicitly limit the available models. auto is not in the built-in catalog; keep it in models if you need it.

    NoteWhen 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.

After saving, restart DeepSeek Harness and select the added model in the model picker.

Error Codes

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

FAQ

How do I use savings plans and resource plans with pay-as-you-go?

The pay-as-you-go setup remains the same: use your general Model Studio API key and Base URL. After you purchase a savings plan or resource plan, it takes effect automatically and eligible usage is deducted automatically. See Savings plans and resource plans.

Fetch available models returns 401 or an empty model list

The built-in Token Plan provider reads the DeepSeek Harness catalog directly and does not request GET /models. Custom pay-as-you-go and Coding Plan providers request /models under the Base URL; an unsupported endpoint or invalid key can return 401 or 404. If discovery fails, add the model ID manually in the model catalog.

Which provider should I use for Token Plan?

Personal Edition: qwen-token-plan-individual-cn on the China site and qwen-token-plan-individual on the international site. Team Edition: qwen-token-plan-cn on the China site and qwen-token-plan on the international site.

The provider list comes from the pi-ai catalog installed with DeepSeek Harness. Older versions (for example, pi-ai 1.3.0 or DSH 0.1) do not include the Personal Edition provider; it appears after upgrading DSH to a version with pi-ai 1.7.0 or later. If the Personal Edition provider is not listed, use the Team Edition provider and keep only the models supported by Personal Edition. Custom Provider IDs must be lowercase.

MISSING_CREDENTIAL error

Re-enter the API Key in the Web UI under Settings → Models and save it, or confirm that BAILIAN_API_KEY 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 Model Studio 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.