Xidong-AI/dsh-rate-limiter
DeepSeek Harness的主动速率限制器插件。
Project Overview项目介绍
This is a DSH-native proactive rate limiting plugin built exclusively for DeepSeek Harness, designed to prevent upstream 429 “too many requests” errors by controlling request rates per model provider before any requests are sent out. When a request exceeds the per-provider configured rate limit, it is queued with a delay instead of being rejected, so no user requests are ever lost. It can be installed via the official DSH plugin command from the npm registry, directly from the GitHub repository, or added as a local development package for testing.
After installation, users need to configure token bucket parameters for each provider that requires rate limiting in their DSH profile configuration file. Each provider requires two parameters: the token refill rate in tokens per second, which sets the long-term average request QPS, and the burst capacity, which sets the maximum number of concurrent burst requests allowed. Providers that are not listed in the configuration are not rate limited at all, and pass through untouched with zero intrusion into your existing workflow. This plugin is ideal for any DSH user that needs to avoid hitting model provider rate limits when making frequent requests.
This plugin uses a custom hand-written reservation-based concurrency-safe token bucket algorithm, and does not depend on any external third-party rate limiting libraries. It only hooks into the DSH agent/request waterfall lifecycle, and never modifies request content, changes routing logic, or swallows errors. It only controls when a request is issued to the upstream provider. Queued requests honor the user abort signal immediately: if you stop the request generation mid-wait, the wait is canceled right away. The plugin is released under the permissive MIT open source license, so anyone can use, modify, or redistribute it freely for any purpose.
这是一款专为 DeepSeek Harness 开发的原生速率限制插件,采用令牌桶算法实现每个模型提供商级别的主动限流,在模型请求发出前检查速率,超出限制的请求排队延迟处理,而非直接返回失败,从根源上避免上游返回 429 错误。它可与官方的 dsh-llm-retry 插件配合,前者事前限流预防,后者出错后退避重试,二者互不干扰可互补工作。用户可通过 dsh 插件命令从 npm 或 GitHub 安装该插件。
安装完成后,用户需要在配置文件中对每个需要限流的模型提供商单独配置令牌桶参数,包括每秒补充的令牌速率(即长期平均请求 QPS)和令牌桶容量(即允许的突发请求数)。未在配置中列出的提供商,请求会直接通过不做任何限制,对原有工作流无侵入。该插件适合需要控制大模型请求频率、避免触发提供商限流的 DSH 用户使用。
该插件使用自研的基于预留的并发安全令牌桶算法实现,不依赖任何第三方限流库,仅挂载在 agent/request 生命周期钩子上,不会修改请求内容、改变路由或吞掉错误,仅控制请求发出的时机。排队等待的请求会响应用户中断信号,用户中断操作会立即停止等待。该插件采用 MIT 许可证开源,可免费使用修改。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-rate-limiter(Xidong-AI/dsh-rate-limiter)
仓库:https://github.com/Xidong-AI/dsh-rate-limiter
本站详情页:https://www.yhbd.top/plugins/xidong-ai-dsh-rate-limiter/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-12 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add @xidong-ai/dsh-rate-limiter
把 Xidong-AI/dsh-rate-limiter 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-rate-limiter
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.
Features
- Per-provider token bucket, enforced before the request is sent (proactive prevention)
- Over-limit requests are queued with a delay instead of rejected (no 429s, no lost requests)
- Unconfigured providers pass through untouched (zero intrusion)
- Queued waits honor the abort signal: stopping the user interrupts the wait immediately
- Hand-written reservation-based token bucket (concurrency-safe), zero third-party rate-limiting dependencies
- Mounts on
agent/request, coexists naturally withdsh-llm-retry
Installation
Install 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: {}
Configuration
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.- Providers not listed are not rate-limited; requests pass through untouched (zero intrusion).
enabled: falsedisables the plugin entirely.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
PerryLink/dsh-auto-review
PerryLink/dsh-mcp-panel
fb0sh/dsh-pentester
shaokeyibb/dsh-plugin-product-subagents
lusblead/dsh-Kingdom
JayZz210l/deepseek-harness-for-ide