dsh-llm-key-rotation
Curated pickMaintenance: Activem1khal3v/dsh-llm-key-rotation
Seamless API-key rotation for DeepSeek Harness
$ dsh plugin add dsh-llm-key-rotationInstall
dsh has no central install command — add this plugin’s entry (documented in its README below) to your profile or patch config, then restart.
How installs work7
stars
0
forks
TypeScript
Language
MIT
License
2026-08-20
Created
2026-08-30
Last push
README
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
└──────────────────────────────────────────────────────────┘
- You keep working with your currently-active key as usual.
- If a request fails (
QUOTA,RATE_LIMIT, orAUTH), 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
dsh plugin --profile web add @m1khal3v/dsh-llm-key-rotation
2. Configure via Web UI
Navigate to Settings → Plugins → Key Rotation:
- 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).
⚙️ 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:QUOTAandAUTHrotate immediately.RATE_LIMITis handled bydsh-llm-retryfirst (with backoff). To rotate instantly on 429 errors instead, simply removeRATE_LIMITfrom your provider'sretryableCodes.
- Live Terminal Logs: Watch rotation events in real time right in your
dshterminal:
(Secret values are never logged — only provider names, indices, and error codes).[llm-key-rotation] rotated provider="opencode-go" chain[0]→"OPENCODE_GO_API_KEY" (QUOTA)
🧑💻 Development
pnpm install
pnpm run verify # typecheck + test
pnpm run build
📄 License
More in Usage & Billing
dsh-cost-meter
by han-1413141
Cost tracking for DeepSeek Harness: session and model costs, token usage, budgets, provider balances, and coding-plan quotas. Bilingual English/Chinese UI.
dsh-usage-stats
by ychris12138
Provider balances, subscription quotas, and token-usage analytics for the DeepSeek Harness Web GUI (dsh web).
tokdash
by jingbiaomei
Agent Dashboard: Visualization and analytics for Sessions and Quota Usage. Track, analyze, and optimize token usage across providers with heatmaps, cost tracking, token counting and quota resets..
dsh-balance-meter
by ghost011118
DeepSeek account balance and session cost readout for the DeepSeek Harness Web GUI
