DeepSeek Harness (DSH) native provider configuration usually applies to the entire route and cannot distinguish different models under the same route. In deployments with enterprise gateways, custom proxies, or OpenAI-compatible endpoints, different models often need to carry different request headers (such as tenant identifiers, billing tags, or custom authentication). The dsh-custom-headers plugin provides model-level control over request headers: define named configurations and automatically attach them when a model is called.

Core Features

  • Per-model custom request headers: Attach custom HTTP request headers to specific models.
  • Define named header profiles: Supports defining multiple named request header profiles, each containing a set of key-value pairs.
  • Auto-apply headers: When calling a model, automatically resolves and attaches the selected request header profile. Changes take effect in real time without a restart.
  • Persist configuration: Configuration is stored in DSH’s own settings layer and is retained after restart.
  • Validate header names and values: Validates the validity of request header names and values when saving.

Installation and Activation

Before installing, ensure that you have installed DeepSeek Harness 0.1.7-rc.1 or 0.1.5-rc.2.

Use the DSH CLI to add the plugin to a specified Profile (the following example uses the web Profile; replace it as needed):

dsh plugin --profile web add dsh-custom-headers

If the plugin is hosted on GitHub, you can use the following command:

dsh plugin --profile web add github:EPCN-fla/dsh-custom-headers

Or install a locally built .tgz package:

dsh plugin --profile web add /path/to/dsh-custom-headers-0.1.0.tgz

Usage Steps

1. Create a Request Header Profile

Open the Settings page and go to Plugins or Plugin Configuration (depending on the DSH version):

  • DSH 0.1.7+: Find the Custom Request Headers configuration card on the plugin details page.
  • DSH 0.1.5: Find the Custom Request Headers card under Settings → Plugins → Plugin Configuration.

After expanding the card, click Add Profile. Name the profile (for example, gateway), then add request header names and values. Click Save. The system validates whether the ID is duplicated and whether the request header names and values are valid.

2. Select a Profile for a Model

Open Settings → Models, expand a provider card, and find the target model in the Model Directory. Expand the Capacity section, then select a profile from the Request Headers dropdown:

  • Default: Do not attach custom request headers.
  • Select a specific profile ID: Every subsequent call for that model will automatically attach the request headers defined in that profile.

Configuration Storage Format

The plugin persists configuration in DSH user settings. In DSH 0.1.7+, data is stored in the Profile’s cordis patch; in 0.1.5, data is stored in a namespace with the same name within the user settings document.

Example configuration:

custom-headers:
  profiles:
    - id: gateway
      headers:
        - name: X-Tenant
          value: acme
        - name: X-Trace-Id
          value: "1"

The selection on the model line (llm-pi-ai provider configuration):

llm-pi-ai:
  providers:
    acme:
      models:
        - id: my-model
          headersProfile: gateway

Scope and Limitations

  • Adapter limitation: Only applies to calls through the pi-ai adapter (llm-pi-ai). Other adapters (such as deepseek-official) do not use this path, so the configuration will not take effect.
  • Priority rules:
    • The headers included in a Provider Profile take priority over model-level custom request headers.
    • DSH’s identification headers (such as User-Agent) are always determined by the Harness; custom headers with the same name are filtered out.
    • Credential authentication headers (such as Authorization) are managed by the SDK. When a custom header has the same name, the SDK authentication header takes priority.
  • Configuration effect: After changing the configuration or a model’s selection, the next request takes effect immediately. No process restart is required.

Resources and Licensing