Introduction¶
The architecture of DeepSeek Harness (DSH) allows functionality to be extended through plugins. When integrating LLM services from specific vendors, several situations often need to be handled: a vendor may require a specific protocol (such as OpenAI Responses or Anthropic Messages), the model list may not be publicly available or may be unstable when fetched dynamically, and compatibility fields may also need to be explicitly declared to accommodate DSH’s internal workflows.
The dsh-custom-provider plugin solves these issues. It provides routing and model directories through static configuration, supports multiple protocols, and reuses DSH’s streaming adapter.
Plugin Overview¶
This plugin is maintained by linziyanleo and licensed under the MIT license. It mainly provides static routing configuration and model directory management. It does not depend on the provider’s /models endpoint and can seamlessly integrate custom LLM providers into DSH’s model selector and standard streaming/tool-calling workflows.
Installation and Activation¶
The plugin must be installed in DSH’s Web profile.
1、Run the following command to install the plugin package:
npx @deepseek-ai/dsh plugin --profile web add @linziyanleo/dsh-custom-provider
2、After installation, verify that the configuration namespace has been loaded successfully by running the following command:
npx @deepseek-ai/dsh --profile web --dump-config
Configuration Methods¶
The plugin can be configured either through the Web interface or via the settings.yaml file.
Web Settings Page¶
1、Open Settings → Custom Providers in DSH Web.
2、Enter the provider ID (must start with a lowercase letter and contain only lowercase letters, digits, and hyphens) and display name.
3、Select a protocol (such as openai-completions, openai-responses, or anthropic-messages).
4、Enter the API base URL and credential reference required by the protocol.
5、Enter the API key. This field is write-only and is stored through DSH’s credential service instead of being written directly to the configuration file.
6、Add models and set parameters such as context window and maximum output.
7、Save the configuration, and the models take effect immediately.
settings.yaml Configuration Example¶
You can also write the llm-custom.providers configuration directly in settings.yaml. The following is an example based on the OpenAI Chat Completions protocol:
llm-custom:
providers:
example:
displayName: Example Provider
apiKeyEnv: EXAMPLE_API_KEY
api: openai-completions
baseURL: https://api.example.com/v1
compat:
supportsStore: false
supportsDeveloperRole: false
thinkingFormat: deepseek
supportsReasoningEffort: true
maxTokensField: max_tokens
requiresReasoningContentOnAssistantMessages: true
models:
- id: example-model
name: Example Model
contextWindow: 262144
maxTokens: 32768
reasoningEfforts:
off:
high: high
max: max
Protocol and BaseURL¶
The api field determines how the adapter constructs the request path. baseURL must match the expectations of the selected protocol adapter.
api |
Path appended by the adapter | Typical baseURL |
|---|---|---|
openai-completions |
/chat/completions |
https://api.example.com/v1 |
openai-responses |
/responses |
https://api.example.com/v1 |
anthropic-messages |
/v1/messages |
https://api.example.com |
Core Features¶
The plugin provides the following capabilities:
- Web management interface: Provides a visual settings page for adding, editing, and deleting custom providers.
- Multi-protocol support: Supports the
openai-completions,openai-responses, andanthropic-messagesprotocols. - Declarative configuration: Supports declarative configuration via
llm-custom.providersinsettings.yaml. - Static model directory: Provides a static model list and does not depend on the provider’s
/modelsendpoint. - Per-request credential resolution: Dynamically resolves API keys through DSH’s credential service and does not store keys in configuration files.
- Compatibility fields: Supports provider-level defaults and per-model overrides, mainly for the
openai-completionsprotocol. - Streaming adapter reuse: Reuses DSH’s
pi-aistreaming adapter to ensure that text streaming, tool calls, and usage statistics workflows function correctly. - Full configuration validation: Validates configuration before route registration is replaced, preventing invalid configurations from being partially activated.
Notes¶
- Runtime environment: Requires Node.js
^22.19.0or>=24.0.0. - DSH version: Requires the DSH
0.1.0-rc.7compatible package. - Profile: Must use the Web profile.
- ID rules: The provider ID in the Web UI must start with a lowercase letter and contain only lowercase letters, digits, and hyphens.
- BaseURL: The
baseURLpath must match the expectations of the selected protocol adapter (for example, the OpenAI protocol typically requires/v1). - Compatibility fields: The
compatfield applies only to theopenai-completionsprotocol and is ignored when switching to other protocols.
Conclusion¶
The plugin adds the ability to configure custom LLM providers to DSH, using static configuration to address the pain points of dynamically fetching model lists and adapting to different protocols. For developers who need to integrate non-standard or vendor-specific protocol providers, it is a practical tool.