DeepSHPlugins
dsh-llm-key-rotation 项目预览
GITHUB / COMMUNITY PROJECT

dsh-llm-key-rotation

安全与运维TypeScriptMIT

在配额、速率限制或身份验证失败后轮换已配置的 LLM API 密钥。

6 Starsm1khal3v 更新时间 2026-08-30
访问 GitHub 仓库
dsh-llm-key-rotation 项目预览

项目介绍

中文

在配额、速率限制或身份验证失败后轮换已配置的 LLM API 密钥。

English

Rotates configured LLM API keys after quota, rate-limit, or authentication failures.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
m1khal3v
仓库
m1khal3v/dsh-llm-key-rotation
GitHub Stars
6
Forks
0
开发语言
TypeScript
许可证
MIT
最近推送
2026-08-30
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

60/ 100
维护活跃
93
文档与实用信息
50
生态关注度
24
安装便捷信号
80
项目声明信号
100

近 12 天仍在更新;关注度尚低(6)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

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

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

npm

DeepSeek Harness

MIT License

dsh-llm-key-rotation

изображение

Seamless API-key rotation for DeepSeek Harness.
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.


⚡️ 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 Settings → Plugins → Key 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:
  [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

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目