dsh-model-orchestrator: DSH Two-Tier Model and Channel Scheduling

Preface

When connecting multiple free or low-cost providers in DSH, the same model name often appears across multiple channels. A common approach is to assign a composite score to each provider/model; upon request failure, the list is re-sorted and switched to the next one. The result is that when a specific channel is rate-limited or down, the scheduler might switch to a weaker model, even though usable channels for the original model still exist.

Below is an introduction to the community plugin dsh-model-orchestrator (maintainer DeZhou123, GitHub DeZhou123/dsh-model-orchestrator). It separates “model selection” and “channel selection” into two layers: first selecting a model based on strategy, then selecting a route within the available channels for that model. Upon failure, it first switches channels within the same model; only when all channels for that model are unavailable does it switch models. A real-time status bar appears below the input box. The first message of a new session will immediately call based on the scheduling result, rather than running the model that was lingering in the selector first.

What is this

When installed in DSH, it acts as a bundle: the Host half handles routing decisions, and the Browser half handles the status bar and details panel. The plugin does not hardcode channels; the model list comes from the kernel’s llm.listProviders / listModels / resolveModelInfo.

It is recommended to use together with dsh-our-free-model (OFM), but with zero code dependency: it only reads the JSON written by OFM locally as corroborating evidence, without modifying OFM or requiring OFM to make any changes for this plugin. Routing works completely even without OFM installed, using the traffic ledger observed by this plugin itself.

Installation Combination Effect
Only OFM installed Free models available; channels determined by OFM itself
Only this plugin installed Any DSH provider can be routed; no OFM channel corroboration
Both installed (Recommended) Free models + two-level scheduling; cooling and rate-limiting can align with OFM account pool unblock times

Core Features

Two-Level Scheduling and Failure Order

  1. Model Layer: Scoring based on intelligence, speed, health, cost, and today’s usage. The four strategies (quality / balanced default / economy / speed) merely redistribute weights.
  2. Channel Layer: Within the same model, select channels based on health, time-to-first-token (TTFT), multiplier, usage, and prompt cache stickiness.
  3. Failure: Record the actual failing provider/model \(\rightarrow\) retry other channels within the same model (using a {kind:'retry'} invisible to the caller) \(\rightarrow\) only switch models when no channels are available for the entire model.
  4. Stickiness: Do not switch if the leading margin is below the switching threshold; for models the user has recently changed in the manual selector, the switching threshold is doubled within a default 30 minutes.

Preference Mode

Lock the call to a specific model, automatically switching between its channels; only when all channels are unavailable does it pause the preference, switch to a fallback mode, and alert the user. It automatically returns to the preference upon recovery.

/route prefer glm-5.3          # Only call this model, auto-switch channels
/route prefer glm-5.3 buddy    # Limit to buddy channels only
/route unprefer                # Return to auto

If this step requires vision or context exceeds limits, a different model may be used temporarily, but the preference is not cancelled; changing the model from the selector will synchronously change the preferred model under default configuration.

Data and OFM Corroboration (Optional)

Local data is not uploaded. OFM related files are read-only; if unreadable or format is unrecognized, it degrades to “Unknown” and does not treat unknown as a bad channel to exclude. You can disable these two types of signals in the configuration with channelData: false and freeModelData: false.

Path Function (When OFM is installed)
$DSH_HOME/our-free-model/availability.json Free lane availability
$DSH_HOME/our-free-model/stats.json Free lane today’s usage
$DSH_HOME/channel-pack/state.json Rate limit unblock time per account per model
$DSH_HOME/channel-pack/token-ledger.json Secondary priority evidence for latency and usage

Reports and the bundled priority-data.json serve as priors; measured TTFT and health ledgers take precedence over reported per-lane values.

Interface and Auto-Selection

There is a status band below the session input box; the first screen of a new session has a compact chip in the hero area, displaying the model to be used for the next message. At the top of the model list, there is “Auto Select”: when enabled, the official seat in the bottom right corner displays “Auto Select”, and the actual call is determined by scheduling. The panel reads via /api/model-orchestrator/summary and writes via /api/model-orchestrator/config, requiring host authentication.

Entry Point for Agents

The tool model_orchestrator supports status, explain, lanes, set, prefer / unprefer, etc.; to verify installation, check model_orchestrator {"action":"status"} for catalog.total > 0, or use /route status.

Installation and Activation

Requires an installed DSH (Desktop or dsh web). The current package version is 2.3.0 (MIT, Node ^22.19.0 || >=24.0.0).

First, place the repository in a local directory, then install it into the profile as a link dependency:

cd ~/.dsh/profiles/web
pnpm add link:/absolute/path/to/dsh-model-orchestrator

Next, add dsh-model-orchestrator to the dsh.profile.bundles array in ~/.dsh/profiles/web/package.json; if this step is missed, the plugin will not load. Then restart DSH Desktop or dsh web. The Host half loads once at startup, while the Browser half relies on HMR or a page refresh.

Verification: A model status bar appears below the input box; /route status lists model groups.

Typical Usage

  1. Under the default balanced strategy, let the scheduler automatically select models and channels. View the current model, health, today’s usage, and automatic switch records in the status bar or panel.
  2. When a specific model is required: /route prefer <model name>, or click ★ / “Browse all models…” on the panel model page to set preference.
  3. When installed with OFM, free lanes and account pool rate-limit info enter channel ranking; usable even with only this plugin, though cooling relies more on local observed failures.
  4. In the panel “Settings”, you can adjust strategies, fallback modes, reasoning levels, single-turn token budgets, first-turn takeover, and auto-selection.

Use Cases and Notes

Suitable for: Having multiple channels with multiplexed same models, hoping to switch channels first upon failure rather than immediately downgrading the model; needing preference locking and visualized routing status.

The plugin runs with the current DSH process permissions, reading state files under $DSH_HOME and intercepting llm/stream for ledger purposes. Please review the repository source code and the MIT license before installation. Community directory page: skillhub.cn plugin page (Independent community site, no official affiliation with DeepSeek / High-Flyer).

OFM’s disk writing format has no third-party contract; this plugin follows it unidirectionally. If the format changes, corroboration disappears, but routing continues to work. Integration tests cover paths such as routing, failure channel switching, and preferences under an empty DSH_HOME (no OFM directory).

Conclusion

dsh-model-orchestrator separates model selection from channel selection, places user explicit preferences at high priority, uses local observations and optional OFM corroboration for sorting, and takes on workflow-class LLM routing responsibilities within the DSH “everything is a plugin” ecosystem. For details and updates, see the GitHub README; for installation and classification info, see the SkillHub Directory Page.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye