dsh-copilot-api: Integrating the copilot-api Gateway into Harness

Introduction

Integrating external models into DeepSeek Harness (DSH) typically involves manually writing provider configurations, aligning protocol fields, and maintaining key references. If you have a gateway like copilot-api running locally or on an intranet (usually listening on http://localhost:4141 by default), and you want Harness to use this link directly instead of setting up another OpenAI-compatible endpoint, you need an off-the-shelf Harness provider plugin.

Below is an introduction to the community plugin dsh-copilot-api (Maintainer: caozhiyuan, Category: Model Inference): It provides a DSH provider for the copilot-api gateway. The README states that it has been verified on Harness 0.2.1-rc.2. The plugin currently has 1 star on GitHub; the package version can be found in the repository’s package.json (0.1.8 at the time of information capture), and the license is MIT.

What is this

In one sentence, the positioning of dsh-copilot-api is: DeepSeek Harness provider for a copilot-api gateway—after installation, it inserts a connection item named copilot-api-provider into the Harness configuration, directing conversation traffic to copilot-api, eliminating the need to manually write boilerplate provider configurations.

Compared to “just filling in a custom OpenAI base URL in Harness,” this plugin injects client capabilities (Models card, resources, remote APIs, etc.) via a Cordis patch and stipulates default protocols and credential reference names, reducing the need to repeatedly maintain fields in the profile.

Core Features

Based on the README, verified capabilities include:

  1. Automatic insertion of provider entry: After installation, id: copilot-api-provider appears in the configuration; no additional profile modification is required to use the default connection.
  2. Default connection parameters:
    • baseURL: http://localhost:4141 (can be with or without /v1)
    • protocol: openai-responses
    • Credential reference name: GITHUB_COPILOT_API_KEY (the configuration stores the reference name, not the plaintext key)
  3. API key storage: Save via the Save API key button on the Models card, Harness credentials, or a startup environment variable of the same name; any of the three can be used to align with the reference.
  4. Messages protocol: To use the Anthropic Messages format, set protocol to anthropic-messages.
  5. Overridable connection fields: While keeping id: copilot-api-provider, you can override baseURL, apiKey (still a credential reference), protocol, headers, modelRefreshInterval, etc.; the model list refreshes every 120000 ms by default, and setting it to 0 disables scheduled refresh.
  6. Extended documentation: For model mapping and overrides, see docs/models.md in the repository; for request headers and sessions, see docs/headers.md; for local development, see docs/development.md.

Installation and Activation

Official installation command (from README):

dsh plugin --profile web add dsh-copilot-api

After the first installation, you need to restart Harness. The plugin will write the copilot-api-provider entry to the configuration.

If building from a local checkout (README example, path needs to be replaced with your absolute path):

cd /absolute/path/dsh-copilot-api
bun install
bun run build
dsh plugin --profile web add /absolute/path/dsh-copilot-api

Typical Usage

1. Using the default localhost gateway

  1. Ensure copilot-api is available at http://localhost:4141.
  2. Write the API key using the reference name GITHUB_COPILOT_API_KEY into the Models card, Harness credentials, or the startup environment.
  3. Install the plugin and restart Harness; select the models refreshed via this provider in the model list.

The default behavior is suitable for local debugging: OpenAI Responses protocol, model list refresh every two minutes.

2. Modifying base URL or other connection items

Only override if the default values do not fit your environment; must retain id: copilot-api-provider and specify all necessary fields:

- id: copilot-api-provider
  config:
    baseURL: http://localhost:4141
    apiKey: GITHUB_COPILOT_API_KEY
    protocol: openai-responses
    modelRefreshInterval: 120000

Note: Both apiKey and apiKeyEnv are credential reference names; if set simultaneously, they must be consistent. Use headers for custom request headers.

3. Using the Messages protocol

Change protocol to anthropic-messages; the rules for other credentials and base URL remain unchanged.

Applicable Scenarios and Notes

Who it is for: Developers who are already running copilot-api (or plan to use it to unify GitHub Copilot and other upstreams), want to integrate models in the DSH Web profile using an official plugin approach, and are willing to use the reference name GITHUB_COPILOT_API_KEY.

Runtime and Trust: DSH plugins execute under the permissions of the current dsh process; please review the GitHub repository source code and the MIT license yourself before installation, and ensure the gateway address and key management methods comply with your security policy. The community directory SkillHub Plugin Page is an independent site with no official affiliation with DeepSeek/High-Flyer; refer to the repository README for versions and descriptions.

Dependency Scope: peerDependencies in package.json constrains the version range of Harness-related packages such as @deepseek-ai/dsh-llm. If you encounter loading failures when upgrading Harness, check the repository’s peer range against your current Harness version.

Conclusion

dsh-copilot-api consolidates the “Harness ↔ copilot-api gateway” link into an installable provider: default localhost, OpenAI Responses, credential reference GITHUB_COPILOT_API_KEY, with YAML overrides for connection items when needed. Refer to the directory and source code:

  • Directory Page: https://www.skillhub.cn/plugins/caozhiyuan/dsh-copilot-api
  • GitHub: https://github.com/caozhiyuan/dsh-copilot-api
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye