dsh-model-fallback
Manifest validPrimary and multi-level backup model failover router for DSH, with cross-provider reasoning-effort clamping, exponential cooldown, per-turn recovery, and a settings panel.
Smart Model Fallback (@carl2003/dsh-model-fallback)
English | 中文
Primary and multi-level backup model failover router plugin for DeepSeek Harness (DSH), featuring cross-provider reasoning effort clamping, structured error classification, exponential backoff cooldown, per-turn recovery, pre-commit stream protection, and an interactive Settings panel with one-click Save & Apply.

Features
- Primary + Ordered Fallback Chain: Configure provider, model ID, 8-tier reasoning effort,
maxTokens, andtemperaturefor both the primary model and an ordered list of backup models (DSH registered providersorcustom OpenAI-compatible endpoints). - Cross-Provider Reasoning Effort Clamping (
src/effort.js): Automatically maps requested efforts across provider dialects (e.g.,off / minimal / low / light / medium / balanced / high / xhigh / deep / max / ultra) to the nearest compatible tier supported by the backup model, or safely omitsreasoningEffortwhen a target model does not declare reasoning support. - Error Classifier & Failover Policy (
src/classifier.js): Distinguishes 8 failure categories (rate_limit,billing,server_error,auth_error,not_found,timeout,empty_response,region_blocked), respects fast rate-limit reset thresholds (minSwitchResetSeconds), and never fails over on user abort (ABORTED). - Exponential Cooldown & Recovery Scopes (
src/cooldown.js): Places failing routes into exponential cooldown (min(initialCooldownSec * 2^(streak - 1), maxCooldownSec)) and supportsturn(per-turn restore),cooldown(cooldown expiry restore), andsession(sticky session fallback) recovery modes. - Pre-Commit Stream Protection (
src/router.js): Buffers pre-commitreasoning-deltaandusagechunks duringllm/stream; if the primary model fails before emitting visibletext-deltaortool-call-delta, it discards the uncommitted chunks and transparently switches to the next backup route. - One-Click Save & Apply (
Save & Apply): Persists settings to$DSH_HOME/model-fallback/config.json, updatesagentDefaultModel, synchronizes active sessions, and broadcasts live SSE status & toast notifications via/api/model-fallback.

Installation
Option 1: Install from npm (Recommended)
dsh plugin --profile web add @carl2003/dsh-model-fallback
Option 2: Install from GitHub Release Tarball (No build script approval)
dsh plugin --profile web add https://github.com/CarlCN2003/dsh-model-fallback/releases/download/v1.0.0/dsh-model-fallback-1.0.0.tgz
Option 3: Install from GitHub Source
dsh plugin --profile web add github:CarlCN2003/dsh-model-fallback
Option 4: DSH Desktop / DSH Market
Open Plugins → Plugin Market (or Settings → Plugin Market on older hosts), search for @carl2003/dsh-model-fallback or CarlCN2003/dsh-model-fallback, and click Install.
Configuration
Open Settings → Model Fallback (主备模型路由) in DSH:
- Select your Primary Model provider, model ID, and reasoning effort.
- Add or reorder Fallback Nodes (registered DSH providers or custom OpenAI-compatible endpoints) and choose their effort strategy (
Auto-Clamp from Primary,Explicit Effort Override for Backup, orDisable Thinking on Backup). - Customize Triggers, Recovery Scope, and Cooldown Policy, or run 🔍 Test Routes / 📊 Telemetry & Failover Drill.
- Click ⚡ Save & Apply to DSH.
Verification
node ./tests/run-tests.mjs
License
Versions
| Latest version | Published | Size |
|---|---|---|
| 1.0.1 | — | — |
Comments
Loading…
Similar plugins
Model failover router that queues all connected DSH models, retries with continue text on failure, switches to next model, and quarantines failing models for the day.
★ 1
NOASSERTION
JavaScript
dsh plugin --profile web add dsh-model-failoverRule-based multi-provider model routing for DeepSeek Harness with pre-first-token failover, cooldown circuit-breaking, usage accounting, and a status API.
★ 0
dsh plugin --profile web add @botton/dsh-model-routerby HB00
Automatic provider failover on rate limits or quota exhaustion: switch between providers with configurable per-provider models, a cooldown, and a permanent last-entry fallback.
★ 0
MIT
JavaScript
Aug 15, 2026
dsh plugin --profile web add dsh-llm-failoverby JiahaoXxX
Provider-level model pool for DSH — virtual ModelPool provider with Auto and named pools, chain failover a→b→c→d, per-source cooldown bench, reasoning-effort aware.
★ 1
MIT
Nov 3, 2026
dsh plugin --profile web add dsh-model-poolby QGG4588
DSH 模型故障自动转移 · provider-pool failover: on rate limit/quota/timeout, auto-retry with the next untried model from the selected providers' full model pools. Runtime tool: model_failover + Web UI panel.
★ 1
MIT
JavaScript
Oct 22, 2026
dsh plugin --profile web add dsh-model-failoverby Letter2025
Two-level model circuit breaker with failover for DeepSeek Harness: trip a model or a whole provider after repeated request failures and route the next request to a configured fallback
★ 5
↓ 721/wk
MIT
TypeScript
Sep 28, 2026
dsh plugin --profile web add dsh-model-failover