dongsheng123132/dsh-switch
DeepSeek Harness 的实证优先模型控制平面
项目介绍Project Overview
dsh-switch 是 DeepSeek Harness 的证据优先模型控制平面插件,分两个独立职责。DSH 束提供 dsh_switch_status 与 dsh_switch_default 工具,校验已注册 provider/model 路由、拒绝不支持的 reasoning effort,并保存新会话默认;独立 CLI 通过 GET /models 探测 OpenAI 兼容端点的可达性、HTTP 状态、延迟、模型数与凭据状态。它不拦截请求、不充当 adapter、不静默切换活动会话,无自动 fallback 与成本路由。注意:成功的 /models 响应仅证明端点可达,不保证端到端生成正确性。
dsh-switch is an evidence-first model control plane plugin for DeepSeek Harness with two separate jobs. The DSH bundle ships dsh_switch_status and dsh_switch_default tools that list registered provider routes, validate an exact provider/model through ctx.llm.resolveModelInfo(), reject unsupported reasoning efforts, and persist the default for new sessions via ctx.agentDefaultModel.saveSelection(). The standalone CLI probes OpenAI-compatible /models endpoints and reports reachability, HTTP status, latency, model count, and credential presence. It never intercepts requests, acts as an adapter, or silently reroutes active sessions. Note: a successful /models response confirms endpoint reachability only, not end-to-end generation correctness.
请帮我了解并安装插件:【dsh-switch】【https://github.com/dongsheng123132/dsh-switch】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add github:dongsheng123132/dsh-switch
把 dongsheng123132/dsh-switch 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-switch
Evidence-first model control plane for DeepSeek Harness.
dsh-switch does two deliberately separate jobs:
- The DSH bundle exposes model-facing tools that inspect registered provider routes, validate an exact provider/model through the official
ctx.llmseam, and save the default for new sessions throughctx.agentDefaultModel. - The standalone CLI probes OpenAI-compatible
/modelsendpoints and reports reachability, HTTP status, latency, model count, and whether a credential environment variable is configured.
It does not intercept model requests, implement another OpenAI adapter, or silently reroute an active session. Projects such as dsh-polyglot and dsh-llm-fallbacks own adapter/fallback behavior; this project is the observable control plane around routes DSH already knows.
Install the DSH bundle
Pin a reviewed commit when installing from GitHub:
dsh plugin --profile web add github:dongsheng123132/dsh-switch#<commit>
dsh --profile web --dump-config
The bundle ships JavaScript and has no install/build lifecycle script.
Tools
dsh_switch_status({ includeModels? })
- shows the default selection used by newly created sessions;
- lists registered provider routes;
- optionally asks each adapter for its advertised models;
- performs no provider network health request itself.
dsh_switch_default({ provider, model, reasoningEffort?, expectedProvider?, expectedModel? })
- validates the exact route with
ctx.llm.resolveModelInfo(); - rejects an unsupported reasoning effort;
- supports an optimistic-concurrency expectation pair;
- saves through
ctx.agentDefaultModel.saveSelection(); - reads the value back and fails if the write is not observable;
- affects new sessions only. Existing sessions keep the route recorded in their logs.
Probe provider endpoints
Copy providers.example.json to a private local file such as providers.json. Reference secrets by environment-variable name—never place keys in JSON.
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
Example output:
✓ deepseek-official 83.4 ms HTTP 200, 2 models credential:configured
✗ local-vllm 1.2 ms network-error credential:not-required
The probe sends GET <baseURL><modelsPath>. It does not send a chat completion and therefore does not consume inference tokens. A successful /models response proves endpoint reachability, not end-to-end generation correctness.
Security and evidence boundaries
apiKeyfields and credentials embedded in URLs are rejected.- Output contains only
configured,missing, ornot-required; secret values never enter results. - A 401/403 endpoint is reachable but not healthy.
- DSH tool switching validates registered adapter metadata, not live provider I/O.
- No automatic fallback or cost-based routing is enabled in v0.1.
Development
npm test
npm run check
The plugin smoke test requires the official DSH runtime packages to be resolvable:
npm run smoke:plugin
License
MIT © 2026 hfshfg
nexu-io/open-design
ruvnet/ruflo
amruthpillai/reactive-resume
esengine/DeepSeek-Reasonix
volcengine/OpenViking
Molunerfinn/PicGo
titanwings/distilly
titanwings/colleague-skill