dshbase

插件目录 / Developer / llm-fallback

llm-fallback

已验证 · 实测可装 CanGeng

✓ 持续维护 2 位贡献者

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-16最近推送
跨平台平台

功能简介

Multi-level provider fallback for same-named models (dsh plugin)

✅
我们的评价
可用 — 实测通过,早期项目

Multi-level provider fallback for same-named models (dsh plugin) 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

llm-fallback

English | 中文

Multi-level provider fallback for same-named models in the DeepSeek Harness.

A pool maps one model id to an ordered provider list. The first provider is the
primary; each later one is a fallback. The plugin keeps every step on the
primary (stable request prefix → KV cache reuse) and only fails over when the
current level is exhausted.

Behavior

  • agent/request picks the pool level for each step. A new step starts at the
    primary (level 0) unless the explicitly requested provider is itself a pool
    member
    — then it starts there and fails over forward. A recovered primary is
    therefore reused immediately on the next step. It also probes each candidate
    with resolveCallConfig and skips (recording) any that would fail before
    streaming — a missing route (NO_ADAPTER), an unknown model, or an
    unsupported reasoning effort.
  • agent/request-error records each level's failure, then advances the level by
    returning { kind: 'retry' }. When every level is exhausted it throws one
    aggregated error listing each level's failure (provider: code — message).

Same-provider retries happen first (via dsh-llm-retry, which sits outside this
plugin), so transient errors like RATE_LIMIT never trigger a failover and never
break the prefix. Only terminal errors (QUOTA, AUTH, …) or an exhausted
retry budget fail over.

retryPolicy.mode: always is incompatible

always retries one provider forever and cannot be stopped from a listener, so
it conflicts with a terminating fallback chain:

  • alwaysPolicy: reject (default) — refuse the provider, naming it and the
    model. Providers registered at load time are rejected when the plugin loads;
    routes activated later through settings (dormant routes) are rejected the
    first time a pool request would use them.
  • alwaysPolicy: degrade — warn and cap that provider at alwaysMaxRetries
    same-provider retries before failing over.

In both modes, an always provider may never be the last level of a pool
(that can never terminate) — it is always rejected.

Configuration

See cordis.patch.yml. The pools list maps a model id to its ordered
provider chain. The config is validated when the plugin loads: an unknown
alwaysPolicy, a pool without a non-empty model, or a pool whose providers
is not an array throws immediately instead of failing silently later.

config:
  alwaysPolicy: reject
  alwaysMaxRetries: 2
  pools:
    - model: deepseek-v4-pro
      providers: [deepseek-official, ark-coding, ark-agent]

Development

node --test   # or: npm test

Install

dsh plugin --profile web add link:/path/to/llm-fallback
dsh web   # restart to load the new bundle layer

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 llm-fallback」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:CanGeng/llm-fallback

Headless(CLI)profile:

dsh plugin --profile headless add github:CanGeng/llm-fallback

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7819 个插件 →