rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Xidong-AI/dsh-rate-limiter
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A proactive rate limiter plugin for DeepSeek Harness (dsh): it controls the request rate per provider (token bucket) before model requests are issued, and queues the request with a delay instead of failing when the limit is exceeded — avoiding upstream 429s.
It complements the official dsh-llm-retry (exponential backoff after failure): rate limiting comes first (prevention), backoff comes last (safety net); the two do not interfere with each other.
agent/request, coexists naturally with dsh-llm-retryInstall from npm:
dsh plugin --profile web add @xidong-ai/dsh-rate-limiter
npm registry URLs are case-sensitive; use the lowercase package name.
Or install directly from GitHub:
dsh plugin --profile web add github:Xidong-AI/dsh-rate-limiter
For local development, add the checkout directly:
dsh plugin --profile web add .
After installing, dsh --profile web --dump-config should show the plugin entry:
- id: rate-limiter
name: @xidong-ai/dsh-rate-limiter
config:
enabled: true
providers: {}
Configure the token bucket per provider in the profile's cordis.patch.yml (or this plugin's cordis.patch.yml):
- id: rate-limiter
config:
enabled: true
providers:
nvidia:
rate: 0.5 # tokens/second (long-term average QPS)
burst: 1 # bucket capacity (allowed burst requests)
sensenova:
rate: 0.02778
burst: 1
rate: refill rate (tokens/second), i.e. the long-term average request rate.burst: bucket capacity, the number of burst requests allowed.enabled: false disables the plugin entirely.The plugin hooks onto the agent/request waterfall: it await next() first to obtain the call config (which carries the provider), then performs a per-provider token bucket check; when tokens are insufficient, it queues the request with a delay (interrupted immediately by the abort signal when the user stops), then returns the config unchanged — it never modifies request content, never changes routing, never swallows errors. It only controls when a request is issued.
The rate-limiting algorithm is a hand-written reservation-based token bucket (concurrency-safe), with zero third-party rate-limiting dependencies.
| Plugin | Timing | Behavior |
|---|---|---|
dsh-rate-limiter |
Before the request is issued | Queue with a delay when over the limit (prevents 429s) |
dsh-llm-retry |
After the request fails | Exponential backoff retry (safety net) |
They mount at different points (agent/request vs agent/request-error) and coexist naturally.
Runtime feature detection lets one build run on both dsh 0.1.x and 0.2.x
hosts. On 0.2.x the settings form now saves without the
has no volatile fields error, and the card is registered on the bundle and
plugin-row config seats. Available since 0.3.3.
dsh plugin --profile web remove @xidong-ai/dsh-rate-limiter
npm install
npm run typecheck # tsc --noEmit
npm run test # vitest run
npm run build # esbuild transpiles lib/*.ts → lib/*.js
Thanks to the Linux.do community for support.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。