DeepSeek Harness 插件

dsh-llm-key-rotation

Seamless API-key rotation for DeepSeek Harness LLM providers when subscription limits are hit(英文原文)

跳到安装方式

来源信息

GitHub 仓库
m1khal3v/dsh-llm-key-rotation
最近更新
2026年8月21日
分类
工具与能力
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-21

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/m1khal3v/dsh-llm-key-rotation
插件名:dsh-llm-key-rotation
作者:m1khal3v

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

<p align="center"> <a href="https://www.npmjs.com/package/@m1khal3v/dsh-llm-key-rotation"><img alt="npm" src="https://img.shields.io/npm/v/@m1khal3v/dsh-llm-key-rotation?style=flat-square&color=4b6fff"></a> <img alt="DeepSeek Harness" src="https://img.shields.io/badge/deepseek--harness-v0.1.1--rc.1-263146?style=flat-square"> <a href="LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-263146?style=flat-square"></a> <img alt="Status" src="https://img.shields.io/badge/status-beta-7da1de?style=flat-square"> </p>

<h1 align="center">dsh-llm-key-rotation</h1> <p align="center"> <img width="500" height="502" alt="изображение" src="https://github.com/user-attachments/assets/84f63f77-3492-4027-ace7-30b6d08616ef" /> </p> <p align="center"> <b>Seamless API-key rotation for <a href="https://github.com/deepseek-ai/deepseek-harness">DeepSeek Harness</a>.</b><br> Hit a quota limit or 429 Rate Limit? The plugin swaps in the next key you configured and retries instantly — no restarts, no context loss, and zero interruptions. </p>

---

⚡️ Highlights

  • 🔄 Invisible to Agent & User: Request fails with quota/rate limit → plugin hot-swaps the key → request retries and succeeds seamlessly.
  • 🎛 Native Web UI: List every key a provider can use and toggle rotation right inside Settings.
  • 🧠 Smart Anti-Spin: Cooldown discipline prevents infinite loops if all your keys are exhausted.
  • 🧼 Zero Core Patches: Plugs cleanly into the Harness recovery waterfall — safe to install, safe to remove.

---

🛠 How It Works

┌─────────────────┐          429 / QUOTA / AUTH          ┌──────────────────────┐
│  Model Request  │ ───────────────────────────────────► │  llm-key-rotation    │
└─────────────────┘                                      └──────────┬───────────┘
         ▲                                                          │
         │                  { kind: 'retry' }                       │ 1. Pick next key
         │             (Adapter re-resolves key)                    │ 2. Hot-swap env ref
         └──────────────────────────────────────────────────────────┘

1. You keep working with your currently-active key as usual. 2. If a request fails (QUOTA, RATE_LIMIT, or AUTH), the plugin loads the next key from your configured chain. 3. The turn retries with the new key, and future requests continue with the working key.

---

🚀 Quick Start

1. Install the plugin

dsh plugin --profile web add @m1khal3v/dsh-llm-key-rotation

2. Configure via Web UI

Navigate to SettingsPluginsKey Rotation:

1. Toggle on rotation for your target provider. 2. Select your trigger codes (default: QUOTA, AUTH). 3. Click Add key, paste all the keys you want that provider to rotate through, and hit Save.

(Keys are safely saved to the Harness credential store).

---

⚙️ Behavior & Good to Know

  • Smart Rotation Window (300s): During consecutive failures, the plugin walks forward through your configured keys. If no failures occur for >5 minutes, the chain resets to start from the top again.
  • Interplay with dsh-llm-retry:

- QUOTA and AUTH rotate immediately. - RATE_LIMIT is handled by dsh-llm-retry first (with backoff). To rotate instantly on 429 errors instead, simply remove RATE_LIMIT from your provider's retryableCodes.

  • Live Terminal Logs: Watch rotation events in real time right in your dsh terminal:

``text [llm-key-rotation] rotated provider="opencode-go" chain[0]→"OPENCODE_GO_API_KEY" (QUOTA) `` (Secret values are never logged — only provider names, indices, and error codes).

---

🧑‍💻 Development

pnpm install
pnpm run verify    # typecheck + test
pnpm run build

📄 License

[MIT](LICENSE)