dsh-switch:面向 DeepSeek Harness 的模型控制面插件

Preface

In workflows like DSH (DeepSeek Harness) where “everything is a plugin,” model provider routing is often scattered across different profiles, adapters, and local configurations. During development or operations, one typically needs to first check which provider routes are currently registered in DSH, then confirm whether a specific provider/model is recognizable, and finally decide which model to use as the default for new sessions.

The DSH community directory is an independent site and is not equivalent to an official app store. dsh-switch provides an evidence-first control plane: it exposes model-side tools within the DSH bundle for inspecting and switching the default model for new sessions; it also provides a standalone CLI for read-only probing of OpenAI-compatible /models endpoints.

A distinction must be made here between “endpoint reachable” and “model available.” A /models probe can only prove that the endpoint is reachable, not that end-to-end generation is correct; v0.1 also does not enable automatic fallback or cost-based routing.

What This Is

dongsheng123132/dsh-switch is a plugin for DeepSeek Harness, positioned as an Evidence-first model control plane for DeepSeek Harness. The category field in the documentation is Model Inference.

The repository owner is dongsheng123132; the license is marked as MIT; the repository metadata also includes MIT © 2026 hfshfg. Existing documentation does not fully clarify maintainership/copyright ownership.

It primarily handles two relatively independent tasks:

  1. Exposes model-side tools within the DSH bundle to inspect registered provider routes and validate specific provider/model pairs through the official ctx.llm seam.

  2. Probes OpenAI-compatible /models endpoints via a standalone CLI, reporting reachability, HTTP status, latency, model count, and credential env var configuration status.

It does not intercept model requests, does not implement another OpenAI adapter, and does not silently reroute an active session.

Core Features

Inspecting and Switching Model Routes within DSH

dsh_switch_status({ includeModels? }) is used to view the current status:

  • Displays the default selection used for new sessions;
  • Lists registered provider routes;
  • Optionally requests adapter-advertised models.

dsh_switch_default({ provider, model, reasoningEffort?, expectedProvider?, expectedModel? }) is used to save the default model for new sessions:

  • Validates the exact provider/model route;
  • Rejects unsupported reasoningEffort;
  • Supports optimistic concurrency with expectedProvider / expectedModel;
  • Saves the selection via ctx.agentDefaultModel;
  • Reads back the written result and fails if the read is not observable;
  • Only affects new sessions. Existing sessions keep the route recorded in their logs.

The switching validation on the DSH tool side verifies registered adapter metadata, not live provider I/O.

Probing /models Endpoints via Standalone CLI

The CLI targets OpenAI-compatible /models endpoints to check:

  • reachability;
  • HTTP status;
  • latency;
  • model count;
  • credential env var configuration status.

The probe only sends:

GET <baseURL><modelsPath>

It does not send chat completions and does not consume inference tokens. A successful /models response can only prove that the endpoint is reachable, not that end-to-end generation is correct.

Security Boundaries

  • Rejects the apiKey field and credentials embedded in URLs.
  • Output only includes statuses such as configured, missing, not-required; secret values never enter the results.
  • A 401/403 endpoint is reachable, but not healthy.
  • v0.1 does not enable automatic fallback or cost-based routing.

Installation and Enablement

When installing the DSH bundle, use a pinned commit. The documentation only provides a <commit> placeholder without a specific commit, so it must be replaced with a reviewed commit:

dsh plugin --profile web add github:dongsheng123132/dsh-switch#<commit>
dsh --profile web --dump-config

The first command installs the bundle; the second command displays the current profile configuration.

The bundle directly provides JavaScript without an install/build lifecycle script. The peer dependency @deepseek-ai/dsh-tools is marked as optional.

When running the plugin smoke test, the official DSH runtime packages must be resolvable.

Runtime requirements:

Node.js >=22

Typical Usage

Configuring a Local Provider

Copy the example configuration to a private local file. Secrets are only referenced by environment variable name—never place keys in JSON:

Copy providers.example.json to a private local file such as providers.json; reference secrets by environment-variable name—never place keys in JSON.

Using DSH Tools

View the current status:

dsh_switch_status({ includeModels? })

Set the default model for new sessions:

dsh_switch_default({ provider, model, reasoningEffort?, expectedProvider?, expectedModel? })

Running the CLI

The README provides the following commands:

node bin/dsh-switch.mjs validate --config providers.json
node bin/dsh-switch.mjs check --config providers.json
node bin/dsh-switch.mjs best --config providers.json

JSON output:

node bin/dsh-switch.mjs check --config providers.json --json

Applicable Scenarios and Cautions

Suitable for:

  • Inspecting registered provider routes within DSH;
  • Setting the default provider/model for new sessions;
  • Performing read-only probes of OpenAI-compatible /models endpoints;
  • Requiring output that only includes credential configuration status rather than secret values.

Not suitable for:

  • Wanting automatic fallback or cost-based routing; not enabled in v0.1.
  • Expecting the plugin to intercept model requests, implement another OpenAI adapter, or silently reroute an active session.
  • Expecting a single /models probe to prove that a model can correctly complete generation.

The plugin runs with the permissions of the current dsh process—review the source code and license before installation. The local providers.json should be placed in a private location, with credentials referenced via environment variables.

Links

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

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

Xiaoye