DeepSeek Harness plugin

dsh-smart-model-router

Task- and quota-aware virtual Auto model router for DeepSeek Harness

Jump to install

Source facts

Repository
chuankris/dsh-smart-model-router
Latest update
Aug 19, 2026
Category
Models & Providers
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-21

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/chuankris/dsh-smart-model-router
Plugin: dsh-smart-model-router
Author: chuankris

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-smart-model-router

A host-plane Cordis plugin for DeepSeek Harness that adds a virtual Auto model. Explicit model selections pass through unchanged. Selecting Auto chooses a real provider/model for each step from task difficulty and optional quota pressure.

Why

Model catalogs make manual selection easy, but a useful default must answer two separate questions:

1. How much capability does this task need? 2. Which quota pool should be conserved right now?

This plugin answers both at the agent/request extension point. The resolved real provider, model, and reasoning effort are then written by DSH to the normal request/header, so replay and audit observe the route actually used rather than the virtual Auto alias.

Behavior

The default candidate set targets the ChatGPT subscription adapter: Spark, 5.4 Mini, and 5.6 Sol. Each candidate declares operator-estimated quality, speed, economy, task affinities, modalities, and quota bucket.

Routing is a multi-stage utility decision rather than a four-tier keyword lookup:

1. Extract semantic and structural features for coding, analysis, writing, risk, agentic work, long context, images, constraints, tool history, and step depth. 2. Query the live DSH model registry and reject unavailable or modality-incompatible candidates. 3. Score eligible candidates across quality, speed, economy, task affinity, quota headroom, and reserve pressure. 4. Select deterministically and log the winner, score, demand, quota, alternatives, and rejected candidates.

Quality receives more weight as demand rises; speed and economy receive more weight for low-demand work. If quota retrieval fails, capability and task routing continue. See [the routing design](docs/routing-design.md) for the formula, open-source references, evidence policy, and evaluation limits.

Explicit selection always wins

The plugin only rewrites this exact virtual route:

dsh-auto/dynamic

Any concrete selection—Codex, DeepSeek, Kimi, GLM, or another registered provider—is returned by identity and is never overridden.

Install

dsh plugin --profile web add dsh-smart-model-router

Restart DSH Web, then choose Auto (difficulty + quota) from the model selector. To make Auto the default for new sessions, set:

agent-default-model:
  provider: dsh-auto
  model: dynamic

in ~/.dsh/settings.yaml.

Configuration

The bundle inserts one host plugin row. Override it in your profile's cordis.patch.yml:

- id: smart-model-router
  config:
    displayName: Auto (capability + quota)
    quotaStatusUrl: http://127.0.0.1:3080/api/dsh-chatgpt-subscription/status
    quotaCacheMs: 60000
    policy:
      qualityWeight: 1
      speedWeight: 0.36
      economyWeight: 0.44
      quotaWeight: 0.65
      reservePercent: 8
      reservePenalty: 1.4
    quota:
      enabled: true
    # candidates is an array of provider/model, modalities, quotaBucketId,
    # quality/speed/economy estimates, and per-task affinity weights.

All candidates, estimates, affinities, policy weights, quota reserves, and endpoint settings are Cordis config; deployments do not need to edit source. The complete default candidate objects are in src/core.js.

Architecture

  • Host plane: routing and quota state are shared across sessions.
  • Virtual adapter: registers Auto in the standard model catalog and fails closed if unresolved.
  • agent/request waterfall: calls next(), preserves explicit selections, and replaces only the Auto alias.
  • Reconstructability: DSH logs the resolved concrete route in request/header before dispatch.
  • Lifecycle: adapter and event registrations belong to the plugin Fiber and disappear on unload/HMR.

Quota integration

Version 0.2 reads the authenticated dsh-chatgpt-subscription status endpoint through loopback HTTP. This keeps the plugin standalone but is the main upstream-integration limitation: a provider-neutral read-only quota Service would remove the HTTP and fixed-port coupling. The router deliberately treats the signal as optional.

Development

npm install --ignore-scripts
npm run check
npm run benchmark
npm run smoke:real-dsh
npm run pack:check

The test suite covers feature extraction, utility scoring, capability rejection, quota reserves, explicit-selection precedence, missing quota, virtual model registration, routing, and real DSH mount/unload lifecycle. The transparent regression corpus currently contains 12 representative tasks; it is a policy drift check, not a scientific model-quality benchmark.

Security and privacy

The plugin sends no task text to a classifier service. Classification is local. The optional quota fetch targets the configured URL and reads only quota percentages. Configure a trusted loopback or authenticated endpoint.

Known limitations and upstream path

  • Local semantic features remain a deterministic approximation; trained routers such as RouteLLM or RoRF can outperform them when representative preference labels exist.
  • Default quality, speed, economy, and affinity values are operator estimates, not vendor benchmark facts. Deployments should calibrate them on their workloads.
  • The current quota source follows the community ChatGPT subscription plugin's HTTP API rather than a DSH quota capability.
  • The virtual adapter is a compatibility technique until DSH has a first-class virtual route registry.

The intended upstream path is to propose a provider-neutral quota-status capability and a first-class virtual model route abstraction, then migrate this plugin onto those APIs. The policy engine and tests are intentionally independent of the HTTP transport to support that migration.

License

MIT