Launch special: 50% off Pro monthly with code LAUNCH50 Upgrade now
Skip to main content
← All problems
chini-006-rate-limiter

Distributed Rate Limiter

Allow bursty legitimate traffic. Reject abuse without blocking the world.

Source: Classic system-design interview corpus (API gateway / rate-limit service)

Prompt

Design a distributed rate-limiting service that fronts a public API.

Functional:
- Every inbound request carries an API key. The limiter decides allow/deny in <10ms p99.
- Limits are per-key and per-route (e.g. 100 req/sec write, 1000 req/sec read).
- Counters must be shared across at least two limiter replicas so a client cannot bypass by hitting a different node.

Non-functional:
- A 4x traffic burst from a small set of keys must not degrade unrelated keys.
- If the shared counter store has a brief outage, the limiter must fail open (allow) rather than fail closed (deny everyone).
- The limiter itself must not become the bottleneck.

Return a Chinilla CanvasState. You will likely want a fast counter store, a circuit-breaker on the dependency, and at least two limiter replicas.

Constraints

Max components
10
Required behaviors
ratelimit, circuitbreaker
Monthly budget
$500

Stress scenarios

Baseline traffic

baseline

Mixed key traffic at normal volume.

4x abuse burst

spike

A subset of keys burst 4x. Limiter must absorb without harming the rest.

Counter store outage

outage

The shared counter store dies. Limiter should fail open and keep serving.

Pass criteria (overall)

Min stability score
70
Max drop rate
5.0%
Min delivery rate
90.0%
Max errors
5

Submit your run

Submissions go through the chini-bench CLI. It calls your model with your key, scores the result locally, and posts to the leaderboard. Nothing leaves your machine except the canvas it produces.

End-to-end:
pip install git+https://github.com/collapseindex/chini-bench-cli.git
export OPENROUTER_API_KEY=...

chini-bench run chini-006-rate-limiter \
  --provider openrouter --model google/gemini-2.0-flash-001 \
  --as alice --x alice --linkedin alice-builds
Or inspect the prompt first:
chini-bench prompt chini-006-rate-limiter
Providers: openai · anthropic · google · openrouter · ollama

Leaderboard

Rank Submitter Model Score Stability Delivery Design Pass Links
#1 alex default
G google/gemini-3.1-pro-preview
84 68.0 100.0 75.0 X
#2 alex default
O openai/gpt-5.4
79 57.0 100.0 100.0 X
#3 alex default
X x-ai/grok-4.20
61 22.0 100.0 75.0 X
#4 alex default
A anthropic/claude-sonnet-4.6
50 0.0 100.0 75.0 X
Per-scenario breakdown of the top run
Scenario Health Drop rate Delivered Pass
baseline 69.0 8.1% 142
abuse-burst 64.0 9.8% 499
counter-outage 71.0 3.3% 15