DeepSeek Harness plugin

dsh-llm-rate-limit

LLM API rate limiting, concurrency control, queuing, and adaptive cooldown for DeepSeek Harness

Jump to install

Source facts

Repository
Asong6824/dsh-llm-rate-limit
Latest update
Aug 20, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Asong6824/dsh-llm-rate-limit
Plugin: dsh-llm-rate-limit
Author: Asong6824

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

dsh-llm-rate-limit

![npm](https://www.npmjs.com/package/dsh-llm-rate-limit) ![downloads](https://www.npmjs.com/package/dsh-llm-rate-limit) ![CI](https://github.com/Asong6824/dsh-llm-rate-limit/actions/workflows/ci.yml) ![license](LICENSE)

English | 中文

A DeepSeek Harness (DSH) plugin that prevents avoidable API rate-limit errors by pacing LLM requests before they reach the provider. It provides per-provider RPM limits, optional token budgets, concurrency control, bounded FIFO queuing, and adaptive cooldown for DeepSeek API, Volcengine Ark, and other DSH providers.

Use it when parallel agents, subagents, retries, or background requests are producing HTTP 429 errors, provider throttling, or traffic bursts.

Install from npm

Install the latest release into the Web profile:

dsh plugin --profile web add dsh-llm-rate-limit
dsh web

Pin a version for reproducible environments:

dsh plugin --profile web add dsh-llm-rate-limit@0.1.1

Install separately for Headless:

dsh plugin --profile headless add dsh-llm-rate-limit

GitHub installation is also supported:

dsh plugin --profile web add github:Asong6824/dsh-llm-rate-limit#v0.1.1

The bundled default protects deepseek-official with 30 requests per minute, burst 1, two concurrent requests, and a bounded queue.

Features

  • Provider-scoped requests-per-minute token buckets with configurable burst capacity.
  • Optional estimated-token-per-minute budgets with actual-usage reconciliation.
  • Concurrency limits and bounded FIFO queues with timeout and cancellation.
  • Adaptive cooldown for provider error codes, HTTP statuses, and Retry-After.
  • Explicit auxiliary-request shedding so background traffic does not block primary work.
  • Durable admission wait/start events for DSH session diagnostics.
  • Clean lifecycle disposal without abandoning queued or active requests.
  • Retry-aware admission: every dsh-llm-retry attempt is admitted independently; this plugin never retries requests itself.

Configure DeepSeek and Ark

Override the complete llm-rate-limit config in $DSH_HOME/profiles/<profile>/cordis.patch.yml:

- id: llm-rate-limit
  config:
    providers:
      deepseek-official:
        requests: { perMinute: 30, burst: 1 }
        maxConcurrentRequests: 2
        queue: { maxSize: 100, maxWaitMs: 300000, auxiliary: reject }
        cooldown:
          codes: [RATE_LIMIT, SERVER]
          statuses: [429, 529]
          initialDelayMs: 500
          maxDelayMs: 60000
          maxProviderDelayMs: 3600000
          jitterRatio: 0.1
      volcengine-ark-coding:
        requests: { perMinute: 30, burst: 1 }
        maxConcurrentRequests: 2
        queue: { maxSize: 100, maxWaitMs: 300000, auxiliary: reject }

Provider keys must exactly match GenerateOptions.provider. Optional token limiting adds:

tokens:
  perMinute: 1000000
  burst: 200000
  estimatedOutputTokens: 8192
  imageTokens: 1024

tokens.burst must be large enough for one complete request estimate. Omit tokens when a provider should have RPM and concurrency control without a local token ceiling.

How it works

Before each provider call, the plugin reserves request capacity, estimated token capacity, and a concurrency slot. Requests without capacity wait in FIFO order. Provider throttling responses activate a shared cooldown; successful responses reconcile estimated tokens with actual usage. The state is process-local and resets when DSH restarts.

The plugin deliberately does not provide distributed quotas, automatic retries, or provider failover.

Compatibility and links

Development

pnpm install
pnpm run check

MIT