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 & Desktop UI: List every key a provider can use and toggle rotation right inside Settings → Plugins.
- 🧠 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
└──────────────────────────────────────────────────────────┘
- You keep working with your currently-active key as usual.
- If a request fails (
QUOTA, RATE_LIMIT, or AUTH), the plugin loads the next key from your configured chain.
- The turn retries with the new key, and future requests continue with the working key.
🚀 Quick Start
1. Install the plugin
Desktop app — open the Plugins page and install @m1khal3v/dsh-llm-key-rotation. The desktop client is a web client, so the same browser-half card renders there.
CLI / local install — add the plugin to your web profile:
dsh plugin --profile web add @m1khal3v/dsh-llm-key-rotation
2. Configure via the Plugins UI
Navigate to Settings → Plugins → Key Rotation tab:
- Toggle on rotation for your target provider.
- Select your trigger codes (default:
QUOTA, AUTH).
- 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).
3. Desktop
Install through the desktop Plugins page, then open Settings → Plugins → Key Rotation. Keys are stored in the desktop profile's credential store. Rotation runs host-side on the same credential seam as the web build, so a rotated key reaches the next request without restarting the app or the session.
⚙️ Behavior & Good to Know
🧑💻 Development
pnpm install
pnpm run verify # typecheck + test
pnpm run build
📄 License
MIT