Skip to main content

How to use dsh-llm-fallbacks

Provides automatic LLM model fallback chain for DSH agents: automatically switches to the next backup model when requests trigger authentication, quota, or rate limit errors, ensuring uninterrupted task execution.

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 github:btspoony/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

Will it automatically take over my model selection after installation?

No. enabled is off by default (src/schema.ts:29). When not enabled or when no chain is configured, the plugin is a zero-intrusion no-op, exactly as if it wasn't installed. You need to actively turn on the switch and fill in the chain for it to take effect.

What failure types trigger fallback switching?

Default triggerCodes = ['AUTH', 'QUOTA', 'RATE_LIMIT'] (src/config.ts:145). 5xx and other retryable errors are first retried with backoff by the host llm-retry, and after budget exhaustion they also enter this plugin's decision flow, so no additional triggerCodes are needed.

Can I use a single real model as the primary choice and have the chain intervene only on failure?

Yes. Selecting any real model in the model selector gives you "fallback-only" behavior: the session model remains the primary choice, and only when it fails does it go through the chain (README.md:153). To use the chain as the primary choice, select the virtual entry "FallbacksChain / Auto" in the model selector.

Will old chains / roles.default configurations be automatically migrated?

No automatic rewriting. The plugin only prints a warning at startup, and a migration banner appears at the top of the config panel. You need to manually rewrite according to the migration table in docs/configuration.md (README.md:133).

What should I do if old sessions won't open after upgrading to 0.2.2+?

Versions before 0.2.2 wrote durable events to sessions, and the new dsh will refuse to load them (issue #52). First stop dsh, then clone this repo and run pnpm repair:fallbacks-switch-logs -- --apply --backup. The script will mark the old events as ignorable to let the session load again (README.md:46-58).

Will it modify DSH's core code?

No. The installation method is just bundle line insertion + client injection + built-in gateway channel, zero dsh source code changes, no postinstall steps, so dsh upgrades don't require re-patching (README.md:182-184).

Does it support macOS / Windows / Linux?

package.json declares no os/cpu restrictions, it runs on any platform that Node.js actually supports; this plugin doesn't introduce native modules.

How do I view the current fallback status in the terminal?

Execute /fallbacks in the dsh-tui profile to see session-level read-only diagnostics (origin, role, chain, recent switches, cooldown). Execute /fallbacks config to see the full config echo. There's also a complete Fallbacks editing area in /settings (requires dsh-tui ≥ v0.8.5, README.md:137-145).

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 0.1.1-rc.1+
  • Node: >=22
  • Platforms: 跨平台

— 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