
dongsheng123132/dsh-switch
30Last commit Aug 14, 2026
dsh-switch DSH plugin
dsh-switch is a DSH plugin that does two separate jobs: its DSH bundle exposes tools to inspect registered provider routes, validate exact provider/model through ctx.llm, and save the default for new sessions; its standalone CLI probes OpenAI-compatible /models endpoints and reports reachability, latency, and credential status. It does not intercept model requests or implement another adapter.
How to install the dsh-switch DSH plugin
dsh plugin --profile web add github:dongsheng123132/dsh-switch#<commit>This source command needs manual review. Copying does not run it.
dsh-switch DSH plugin data source
dsh-switch DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-switch DSH plugin can do
- Exposes dsh_switch_status tool to show default selection, listed provider routes, and optionally advertised models.
- Exposes dsh_switch_default tool to validate a route via ctx.llm.resolveModelInfo(), reject unsupported reasoning effort, and save selection for new sessions only.
- Supports optimistic-concurrency expectation pair (expectedProvider, expectedModel) to prevent race conditions.
- CLI commands validate, check, and best for probing provider endpoints with JSON output option.
- Rejects apiKey fields and credentials embedded in URLs; outputs only 'configured', 'missing', or 'not-required' for secrets.
Where the dsh-switch DSH plugin fits
- Check which provider/model is set as default for new DSH sessions.
- List all registered provider routes and their advertised models.
- Validate a specific provider/model route before switching to it.
- Probe the reachability and latency of OpenAI-compatible endpoints from the CLI.
- Set a new default model for future sessions without affecting ongoing ones.
Who the dsh-switch DSH plugin is for
- DSH users who need to manage model routing and default model configuration.
- Developers debugging provider connectivity or verifying endpoint health.
dsh-switch DSH plugin limitations
- Model switching only affects new sessions; existing sessions keep the route recorded in their logs.
- v0.1 does not include automatic fallback or cost-based routing.
- CLI probe sends only a GET to /models endpoint, not a chat completion, so it does not test end-to-end generation correctness.
- Requires Node.js 22+ and the official DSH runtime packages to be resolvable for plugin smoke tests.
dsh-switch DSH plugin: from the repository README
Quoted from the dongsheng123132/dsh-switch README, the upstream source of the dsh-switch DSH plugin. Copyright remains with the original authors.
> Evidence-first model control plane for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness). [中文](README.zh-CN.md) `dsh-switch` does two deliberately separate jobs: 1. The DSH bundle exposes model-facing tools that inspect registered provider routes, validate an exact provider/model through the official `ctx.llm` seam, and save the default for **new sessions** through `ctx.agentDefaultModel`. 2. The standalone CLI probes OpenAI-compatible `/models` endpoints 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: ```bash 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? })
Read the full READMERepository license: MIT
dsh-switch DSH plugin questions
How do I install dsh-switch?
Pin a reviewed commit and run: `dsh plugin --profile web add github:dongsheng123132/dsh-switch#<commit>`. Then verify with `dsh --profile web --dump-config`. The plugin ships JavaScript and has no install/build lifecycle script.
Will dsh-switch affect my active chat sessions?
No. The plugin only saves the default model for new sessions. Existing sessions keep the route that was recorded in their logs when they started. Changes are not applied retroactively.
How can I check the current default model?
Use the dsh_switch_status tool. It shows the default selection used by newly created sessions, lists registered provider routes, and can optionally ask each adapter for its advertised models. No provider network health request is performed.
How do I set a new default model?
Call dsh_switch_default with the provider and model you want. It validates the exact route with ctx.llm.resolveModelInfo(), rejects unsupported reasoning effort, and saves through ctx.agentDefaultModel.saveSelection(). It reads back the value and fails if the write is not observable.
Can dsh-switch automatically fallback if a provider is down?
v0.1 does not include automatic fallback or cost-based routing. The plugin is a control plane that inspects routes and sets defaults, but does not intercept model requests or reroute active sessions. Projects like dsh-polyglot and dsh-llm-fallbacks handle adapter/fallback behavior.