dsh-llm-failover

by HB00

0 模型与账号接入github收录于 08-21

限流或配额耗尽时自动切换模型提供方:可按提供方配置模型,带冷却机制与永久最终兜底。

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.

安装

dsh plugin --profile web add github:HB00/dsh-llm-failover

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

目录

Provider failover for DeepSeek Harness (dsh): when a model provider returns rate-limit (429) or quota-exhausted errors, switch to the next provider automatically — with a configurable per-provider model mapping, a permanent final fallback, and a visible notice in the UI.

模型提供方故障转移插件:遇到限流(429)或配额耗尽时,自动切换到下一个提供方——支持按提供方配置模型、永久最终兜底,并在界面显示切换提示。

Features / 功能

  • Automatic switch on RATE_LIMIT / QUOTA failures, with configurable retry threshold (fallbackAfterRetries). / 遇到限流/配额错误自动切换,可配置切换前连续失败次数。
  • Per-provider model mapping — a switched provider can use a different model. / 每个提供方可单独指定切换后使用的模型。
  • Cooldown per provider (cooldownMs): a cooled-down provider is skipped until it recovers. / 提供方冷却机制:冷却期间直接跳过,到期自动恢复。
  • The last entry in the provider list is the permanent fallback and is never switched away (no retry loops). / 列表最后一条是永久兜底,永远不会被切走(不会死循环)。
  • UI notice bar on every switch (auto-dismiss). / 每次切换在输入框上方显示提示条(自动消失)。
  • Configuration card in Settings → Plugins → Plugin configuration. / 设置 → 插件 → 插件配置 页面卡片直接配置。

Install / 安装

dsh plugin --profile web add dsh-llm-failover

Configuration / 配置

Either use the Settings UI card, or edit ~/.dsh/settings.yaml:

llm-failover:
  enabled: true                     # master switch / 总开关
  providers:                        # tried in order; last one is the fallback / 按顺序尝试,最后一条是兜底
    - provider: huoshan             # provider key from your llm-pi-ai / llm-deepseek config
      model: deepseek-v4-flash      # optional: model to use after switching / 可选:切换后使用的模型
    - provider: huoshan2
      model: deepseek-v4-flash
    - provider: deepseek-official   # permanent fallback, never switched away / 永久兜底
      model: deepseek-v4-flash
  fallbackAfterRetries: 2           # consecutive failures before cooldown+switch / 连续失败几次后冷却并切换
  cooldownMs: 60000                 # cooldown duration in ms / 冷却时长(毫秒)

How it works / 原理

Hooks two official agent waterfalls:

  • agent/request — picks the first non-cooled provider in the configured order at request time (returns a new config object; the seed config is deep-frozen).
  • agent/request-error (prepended, so it counts failures before dsh-llm-retry) — after fallbackAfterRetries consecutive RATE_LIMIT/QUOTA failures, cools the provider down and returns { kind: "retry" }; the last list entry never switches.

The config card talks to the plugin-owned /llm-failover RPC channel (the official settings RPC serves only allowlisted namespaces); writes go through the standard settings service — schema-validated and persisted to settings.yaml, live without restart.

License

MIT

原始 README: https://github.com/HB00/dsh-llm-failover/blob/main/README.md ↗

同类插件

查看全部 →
模型与账号接入Anionex

agent-vision-toolkit

为纯文本模型"看图“设计更好的视觉工具箱和技能,支持多图理解,图片问答,前端UI还原、GUI 自动化等,并可选无缝接入多个主流agent,直接识别粘贴图片| A vision toolkit and skill designed for text-only llms — image Q&A, long-screenshot OCR, frontend UI restoration, and GUI automation, with optional seamless integration for Codex, Claude Code, Pi, Oh My Pi, and OpenCode

查看详情
928github+08-16
模型与账号接入toby-bridges

api-relay-audit

从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。

查看详情
791github+08-21
模型与账号接入ZJU-LLMs

OpenStory

✨ OpenStory 现已支持 DeepSeek Harness 插件! 现在可以通过 dsh-openstory 将 OpenStory 多智能体推演接入 DeepSeek Harness,让 agent 直接启动模拟、查看角色、下达指令并逐回合推进故事。查看 DSH 插件配置与使用指南。

查看详情
377github+08-17
模型与账号接入pulseaiclub

phi

pi的编码代理 ∞ 提供者、子代理、hashline编辑和权限门

查看详情
89github+08-16
模型与账号接入anysearch-team

anysearch-dsh

DeepSeek Harness(DSH)的 AnySearch 网络搜索提供方与高级搜索工具。

查看详情
79github+08-17
模型与账号接入kuangre123

codex-switch

Codex Switch 是一个 macOS 工具,一键配置 Codex 的自定义 API,同时保留官方 OpenAI 登录。保存后 Codex 的模型选择器里只会出现你选的那个 provider 的模型。也支持 Claude Code 的官方 / 自定义 API 切换。Codex Switch is a lightweight helper for configuring multiple coding-agent API routes. For Codex, it keeps Official OpenAI and a custom API provider configured in parallel, registers the custom model in Codex's mod

查看详情
67github+08-16