soffits/dsh-fallback-models ↗★ 0
dsh-fallback-models
Fallback model chain for DeepSeek Harness: when a model request keeps failing after DSH's own retries, the work continues on the next model in a configured list.
同名套件的其他儲存庫
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:soffits/dsh-fallback-models說明文件
閱讀完整 README ↗Configuration
The settings page lists models from DSH's catalog (the same set the model picker inside the composer shows), so you can pick a provider, choose a model, and set a reasoning effort when the model supports one. Rows can be reordered. The same values live inside the profile patch attached to the plugin's row:
- id: fallback-models
name: 'dsh-fallback-models'
config:
chain:
- provider: deepseek
model: deepseek-reasoner
- provider: openrouter
model: qwen/qwen3-coder
reasoningEffort: high
presets:
reviewer:
- provider: openrouter
model: anthropic/claude-sonnet-4.5
quick: [] # no fallback for this preset
scope: turn # or: session
# codes: [...] # optional, see below
| Field | Default | Meaning |
|---|---|---|
chain | [] | Fallback models tried in order. An empty value disables the plugin. |
presets | {} | Maps a preset id to a separate list that overrides chain for agents in that preset. An empty list turns fallback off for it. |
scope | turn | turn: switch back to the model the session started with when the fallback-using turn ends. session: keep the fallback until the session ends. |
codes | see below | Failure codes that cause a switch to another model. |
All fields apply at the next failure; DSH does not need a restart.
Failures that cause a switch
DSH's adapters report every failed request with a code independent of the provider. By default, these codes cause a switch:
| Code | Meaning |
|---|---|
RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, EMPTY_RESPONSE | Service overload, outage, slowness, or a broken connection. DSH retries these before any model switch. |
QUOTA, ACCOUNT_QUOTA | Balance or quota used up. DSH does not retry these, so the switch is immediate. |
PI_AI_ERROR | A provider error the pi-ai adapter failed to classify, for example a 404 for a withdrawn model. |
AUTH (rejected credentials), INVALID_REQUEST, and CONTEXT_WINDOW_EXCEEDED (handled by DSH compaction) do not switch models by default, because a model change would hide a problem you probably need to fix. To allow it anyway, include them in codes or tick them via the settings page. Cancelled requests (ABORTED, or any turn you stopped) never switch.
This plugin sees only failures reported by the model request. When DSH hits an error while it prepares a request (a model id that does not exist, or a missing API key), nothing is sent, the turn ends, and fallback does not happen.