openevidence-rate-limits

Solid

Implement OpenEvidence rate limiting, backoff, and request optimization. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for clinical queries. Trigger with phrases like "openevidence rate limit", "openevidence throttling", "openevidence 429", "openevidence retry", "openevidence backoff".

Code & Development 44 stars 14 forks Updated 3 days ago Apache-2.0

Install

View on GitHub

Quality Score: 89/100

Stars 20%
55
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# OpenEvidence Rate Limits Self-harnessing rate limiter for the OpenEvidence cookie API. Tuned so the client never bursts above its own configured RPM, even before the server returns a 429. ## Overview OpenEvidence does not publish a stable `X-RateLimit-*` contract for the cookie-based web API. This skill ships a defense-in-depth limiter that: 1. **Sliding-window self-throttle** caps requests-per-window at a configurable target usage (default 80% of `maxRequestsPerWindow`). 2. **Hard burst cap** prevents tight loops from firing more than `burstCap` requests in any 1-second slice. 3. **Priority queue** — `stat` > `urgent` > `routine` > `research` — so a STAT clinical query jumps ahead of a research batch. 4. **Exponential backoff with jitter** on 408/425/429/5xx, with `Retry-After` honored verbatim when the server sends it. 5. **Opportunistic header parsing** — if `X-RateLimit-Remaining` / `X-RateLimit-Reset` ever appear, they tighten the limiter; otherwise we rely on the client-side counters. The limiter is fully testable: clock and sleeper are injectable so the test suite runs in ~1 second. ## Implementation map | File | Role | | --- | --- | | `src/rate-limit.ts` | `RateLimitController`, `withExponentialBackoff`, `computeBackoffDelay`, `parseRetryAfterMs`, `HttpError`. | | `src/openevidence-client.ts` | `requestWithRateLimit` wraps every fetch with `acquire/observe/release` + retry. | | `src/config.ts` | `resolveRateLimitConfig` reads env vars and fo...

Details

Author
htlin222
Repository
htlin222/openevidence-mcp
Created
2 months ago
Last Updated
3 days ago
Language
TypeScript
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category