How to use dsh-llm-fallbacks
When LLM requests persistently fail (authentication, quota, rate limiting), automatically switch provider/model along the fallback chain, preventing DSH proxy tasks from being interrupted by model issues.
This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.
This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.
Quick start
dsh-llm-fallbacks
— source: plugin_wiki.wiki_content
Install & verify
dsh plugin --profile web add dsh-llm-fallbacks
Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.
— source: plugins.install
Key points
-
- anthropic/claude-3-5-sonnet # walked first
-
- deepseek-official/deepseek-v4-flash # last resort (Flash or Pro)
-
- kind: preset # frozen UTC+8 window; only the chain is editable
-
- anthropic/claude-3-5-sonnet
-
- kind: custom # custom window (may wrap midnight)
— source: plugin_wiki.readme_en (fallback readme_raw)
FAQ
What needs to be done after installation?
After installing the plugin, you still need to enable it in the shared settings (web端 Setting → Plugins → Fallbacks card, or the fallbacks: section in $DSH_HOME/settings.yaml) by setting enabled to true and configuring at least one rootChain; otherwise, the plugin will be a no-op with zero intervention on requests.
Where is the configuration saved?
Saved in the DSH shared settings document (default $DSH_HOME/settings.yaml under the fallbacks: namespace). The web settings card, dsh-tui /settings, and YAML all read and write the same configuration; the plugin does not store a local copy, so upgrades won't lose your configuration.
Why can't old sessions be opened after upgrading to 0.2.2?
Versions before 0.2.2 wrote fallbacks/switch events to session logs. The plugin and host parsed different module instances, causing new dsh versions to fail loading such sessions. See the Repair section in README for the fix: stop dsh first, then run pnpm repair:fallbacks-switch-logs -- --apply --backup. The script marks these old events as ignorable and keeps .bak backups. 0.2.2+ no longer writes new events, so no repair needed.
Does the last item of rootChain have to be the V4 official model?
Yes, the last item of the full-day chain must be exactly one of deepseek-official/deepseek-v4-flash or deepseek-official/deepseek-v4-pro, as the final fallback; the preceding items are the fallback items traversed in order. Non-official model tail nodes only warn on startup without error, but the web settings card and gateway save will directly reject them, making it impossible to save via the UI.
How to use dsh-tui?
Under dsh-tui profile, /fallbacks is read-only diagnostics (shows current session's origin, role, fallback chain, recent switches, cooldown), /fallbacks config is config review (same as above). For editing, use the fallbacks section in /settings; requires dsh-tui ≥ v0.8.5; older versions can only edit the YAML file.
How to temporarily disable without uninstalling?
Just set enabled to false, which has the same effect as not being installed; you can also use fallbacks.presets: 'none' to stop automatic declaration of the 7 built-in preset roles. All states will be automatically cleared, and reactivating with enabled: true will start fresh.
What built-in time presets are there?
4 UTC+8 freeze window presets: liang-peak (daily 09:00–12:00 & 14:00–18:00) / liang-valley (other times) / glm-peak (Monday–Friday 14:00–18:00, requires zai-coding-cn configuration) / glm-valley (other times). When presets are enabled, tz is locked to Asia/Shanghai and cannot be changed.
What is the Auto that appears in the model selector?
After enabling the plugin, a virtual provider/model named FallbacksChain with model name Auto is automatically registered. Selecting it uses the current effective fallback chain directly as the root agent's primary model (does not require failure to trigger); any real model still maintains its fallback behavior after failure. Disabling the plugin immediately removes this virtual entry.
— source: plugin_wiki.faq_json
Compatibility
- DSH: 0.1.1-rc.1+ (peerDependency)
- Node: >=22 (engines.node)
— source: plugin_wiki.compatibility_json
Pitfalls
Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.
— source: general rule