DeepSeek Harness

Nội dung tài liệu kỹ thuật hiện được cung cấp bằng tiếng Anh.

DeepSeek Harness (dsh) is DeepSeek AI’s open-source agent harness. Register Uptech API as a custom llm-pi-ai provider so Harness uses your Uptech API key, model catalog, usage controls, and call logs.

DeepSeek Harness is currently in Developer Preview and may introduce compatibility-breaking changes.

Prerequisites

1. Store the Uptech API key

Tạo ~/.dsh/.credentials.yaml:

APIGO_API_KEY: sk-apg-...

Restrict access to the Harness directory and credential file:

chmod 700 ~/.dsh
chmod 600 ~/.dsh/.credentials.yaml

Keep the key out of settings.yaml, project files, shell history, and Git. APIGO_API_KEY is the credential name referenced by the provider configuration below.

2. Register Uptech API as a provider

Create or edit ~/.dsh/settings.yaml:

ui-onboarding:
  welcomeNoticeVersion: 2026-08-13.1
agent-presets:
  default: code
llm-pi-ai:
  providers:
    apigo:
      displayName: apigo
      apiKeyEnv: APIGO_API_KEY
      api: openai-completions
      baseURL: https://api.uptech.vn/v1
      models:
        - id: deepseek-v4-flash
          name: deepseek-v4-flash
        - id: deepseek-v4-pro
          name: deepseek-v4-pro
agent-default-model:
  provider: apigo
  model: deepseek-v4-flash

This configuration is required because Uptech API is a custom provider route. Setting DEEPSEEK_BASE_URL alone leaves Harness on its native deepseek-official route and does not select the Uptech API provider.

Use only model slugs currently shown in the Uptech API catalog. Change both the provider’s models list and agent-default-model.model when selecting another model.

3. Start Harness

Run the Web UI:

npx @deepseek-ai/dsh web

Open http://127.0.0.1:3080, create a session, and confirm that the selected provider and model are apigo / deepseek-v4-flash.

For a one-shot terminal check:

npx @deepseek-ai/dsh --profile headless \
  'Reply with exactly APIGO_HARNESS_OK and nothing else.'

A successful setup prints:

APIGO_HARNESS_OK

Then confirm the request in Workspace → Call Logs.

Configuration reference

Setting Value Purpose
Credential file ~/.dsh/.credentials.yaml Stores the Uptech API key outside general settings
Credential name APIGO_API_KEY Matches apiKeyEnv in the provider profile
Provider route apigo Harness provider ID selected by agent-default-model
Giao thức API openai-completions Uses Uptech API’s OpenAI-compatible Chat Completions API
Địa chỉ API gốc https://api.uptech.vn/v1 Uptech API OpenAI-compatible gateway prefix
Mô hình mặc định deepseek-v4-flash Exact Uptech API model catalog slug

Troubleshooting

Symptom Fix
MISSING_CREDENTIAL Xác nhận ~/.dsh/.credentials.yaml contains APIGO_API_KEY and is valid YAML
401 / 403 Replace the key with an active Uptech API key and check its workspace permissions or spend cap
UNKNOWN_MODEL Add the exact Uptech API slug under llm-pi-ai.providers.apigo.models
Requests still use deepseek-official Set agent-default-model.provider to apigo and restart Harness
workspace_tpm_exceeded Agent prompts and tool loops can use multiple large requests; raise the Workspace TPM limit or wait for capacity before retrying
No request in Call Logs Confirm the Base URL includes /v1 and the active model shows provider apigo

Resources