DeepSeek Harness Integration Tutorial: Configuring Model Providers

  • 发布时间
  • 栏目guide
  • 语言en

Tutorial on integrating the DeepSeek Harness (dsh) agent framework: Launch the Web UI, add a custom Provider on the Models page, and point it to our gateway to start using LLMs.

1. What is DeepSeek Harness

DeepSeek Harness (command dsh) is an open-source agent framework by DeepSeek that utilizes an "everything-is-a-plugin" architecture. It features a built-in Web UI and supports CLI and SDK execution, making it ideal for letting AI read files, modify code, and perform tasks within your workspace.

2. Launching the Web UI

You need Node.js installed first, then execute:

npx @deepseek-ai/dsh web

This command launches the Web UI at http://127.0.0.1:3080 by default and automatically opens your browser. You can add --no-open if you prefer it not to open automatically. To run from source:

git clone https://github.com/deepseek-ai/deepseek-harness.git
cd deepseek-harness
pnpm install && pnpm run build
pnpm dsh web

3. Pointing the Model to Our Gateway

Open the Web UI → Settings → Models → Add a custom provider, and fill in the following:

Provider ID : jizhi
Base URL    : https://www.relay-api.com
API Protocol: OpenAI Compatible (openai-completions)
API Key     : sk-your-key
Model       : claude-sonnet-5

(Use https://www.relay-api.com/v1 for OpenAI endpoints and https://www.relay-api.com/v1beta for Gemini endpoints; you can add multiple providers as needed.)

Alternatively, configure via settings.yaml

llm-pi-ai:
  providers:
    jizhi:
      apiKeyEnv: JIZHI_API_KEY
      api: openai-completions
      baseURL: "https://www.relay-api.com"
      models:
        - id: claude-sonnet-5

After saving, select the model from the model picker to start your session.

4. Selecting a Workspace and Running Tasks

After launching, click Choose workspace and select the project directory where you started dsh. Once the workspace is selected, you can create a new session, for example, by sending "Summarize this repository and list the main packages." The framework will ask for your permission when authorization is required.

5. Common Troubleshooting

IssueSolution
401Invalid key; check your API Key, or re-enter it on the Models page and ensure the corresponding environment variable is exposed.
UNKNOWN_MODELModel is not configured or mismatch; add the exact slug to the model list of your custom Provider.
Gateway RejectedWhen the request structure is not perfectly consistent with OpenAI, you can configure compat.supportsDeveloperRole: false and compat.maxTokensField: max_tokens in the route.

Security Recommendation: Do not commit sk- keys to public repositories; use environment variables instead. Keep an eye on your balance and usage for intensive agent tasks.

Base URL Note: Our site accepts both /v1beta/models/... and /v1beta/v1beta/models/... (as well as /v1/... and /v1/v1/...), so it does not matter if the client appends /v1 or /v1beta; the connection will work whether the Base URL is set to the domain root or the address including /v1beta. Please copy the Model ID from the "Model ID" field in the top right corner of the "Tokens" page in your dashboard.