Skip to the content.

Configure DSH with Local LiteLLM Proxy Provider

Set up DeepSeek Harness to use a local LiteLLM proxy as a custom OpenAI-compatible provider. This writes the provider configuration to DSH’s settings.yaml so the Claude models served by LiteLLM (via Vertex AI) are available as model routes in the DSH WebUI.

For DSH installation, see the dsh-setup skill first.

Rules

Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.

Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.

Prerequisites

Architecture

DSH stores settings in ~/.dsh/settings.yaml (or $DSH_HOME/settings.yaml). The llm-pi-ai plugin manages model providers. A custom provider needs:

Field Purpose
baseURL LiteLLM endpoint: http://127.0.0.1:4000/v1
api Protocol: openai-completions
apiKeyEnv Env var holding a dummy API key (DSH requires non-empty)
models List of model IDs matching LiteLLM’s model_name entries
compat Protocol compatibility flags for LiteLLM

DSH serves only the models listed in settings.yaml. Its “fetch available models” action in Settings → Models is a one-off UI helper; nothing is stored and there is no runtime discovery (dsh-llm-pi-ai discovery module). After a proxy model refresh, re-run setup.sh.

The default model for new Agents lives in a separate top-level section, agent-default-model (provider + model), read live by DSH. setup.sh sets it to the strongest served model (hey litellm default model).

Reference Configuration

File: ~/.dsh/settings.yaml (relevant section)

⚠️ Use this exact schema. Do NOT write from memory or improvise field names. Copy this template and substitute only the marked placeholders.

llm-pi-ai:
  providers:
    litellm-vertex-ai:
      apiKeyEnv: LITELLM_VERTEX_AI_API_KEY
      api: openai-completions
      baseURL: http://127.0.0.1:4000/v1
      compat:
        supportsDeveloperRole: false
        maxTokensField: max_tokens
      models:                     # generated by setup.sh from /v1/models
        - id: claude-opus-5       # (excerpt — one entry per proxy model;
          input: [text, image]    #  current list: `hey litellm model list`)
        - id: claude-sonnet-5-5
          input: [text, image]
        - id: claude-haiku-4-5
          input: [text, image]
agent-default-model:              # default for new Agents
  provider: litellm-vertex-ai
  model: claude-opus-5-5          # strongest served model

Compatibility Flags

Flag Value Why
supportsDeveloperRole false LiteLLM proxies role: "developer" as-is but Vertex AI Claude doesn’t accept it. Forcing false makes DSH send role: "system" instead.
maxTokensField max_tokens LiteLLM uses the OpenAI max_tokens field, not max_completion_tokens.

Image Input

All Claude models served by the proxy support vision. The input: [text, image] declaration on each model tells DSH to allow image attachments in the WebUI for those models.

Workflow

Step 1 — Dry run, then apply

The agent MUST run the dry run first:

bash ~/.agents/skills/dsh-litellm-provider/scripts/setup.sh --dry-run
bash ~/.agents/skills/dsh-litellm-provider/scripts/setup.sh
Flag Effect
--default-model M Use M (must be served) instead of the strongest model
--no-default Leave agent-default-model untouched
--force-default Overwrite agent-default-model even when it points at another provider (skipped otherwise)

The script writes a timestamped backup, replaces only the provider block and agent-default-model, and refuses to write if anything else would change. Restart DSH if it is running.

Step 2 — Verify the configuration

The agent MUST run:

bash ~/.agents/skills/dsh-litellm-provider/scripts/verify.sh

Step 3 — Restore (after DSH update)

If the user reports a lost provider after a DSH update, the agent MUST re-run the setup script from Step 1. The script is idempotent.

Output Contract

Gotchas

Specification

ID Capability Verifiable By
S1 Write LiteLLM provider to ~/.dsh/settings.yaml verify.sh checks provider block exists
S2 Auto-discover models from running LiteLLM proxy setup.sh queries /v1/models and populates model list
S3 Idempotent — re-running setup updates in place Run setup.sh twice, settings.yaml has no duplicates
S4 Backup existing settings before modification settings.yaml.bak.<timestamp> created
S5 Default model = strongest served model verify.sh “Default model served”; setup.sh --dry-run → CONVERGED

Tests

Test Spec Command Expected Result
T1 S1 bash scripts/verify.sh Provider block found with correct baseURL
T2 S2 bash scripts/setup.sh && grep 'claude-' ~/.dsh/settings.yaml Model IDs match LiteLLM output
T3 S3 bash scripts/setup.sh && bash scripts/setup.sh && grep -c 'litellm-vertex-ai' ~/.dsh/settings.yaml Count is 1 (no duplicates)
T4 S4 bash scripts/setup.sh && ls ~/.dsh/settings.yaml.bak.* Backup exists
T5 S5 bash scripts/setup.sh --dry-run after apply DRY_RUN_RESULT=CONVERGED
T6 S5 DSH_HOME=<copy> bash scripts/setup.sh --dry-run --default-model claude-opus-4-7 Exit 1, “not served”

Changelog

See CHANGELOG.md for version history.