← all trials
Trial T04 · round 2 · 12 models tried

Token-bucket rate limiter: claude-haiku-4-5 did it for $0.0011.

Exact refill math with an injectable clock. No drift allowed. A model passes this trial only when every test goes green — retries are included in the price, and the clock runs until done.

Cheapest to green
claude-haiku-4-5$0.0011 · x1
Fastest to green
gpt-5.45s · $0.0028
ModelVerdictTriesTimeCost to doneTokens
claude-haiku-4-5GREENx16s$0.0011328
gpt-5-miniGREENx111s$0.0026743
claude-sonnet-4-6GREENx16s$0.0028288
gpt-5.4GREENx15s$0.0028281
gpt-4.1GREENx15s$0.0029273
claude-opus-4-8GREENx16s$0.0038392
claude-fable-5GREENx19s$0.0042422
claude-sonnet-5GREENx16s$0.0044467
gpt-5.2GREENx110s$0.0057475
gpt-5.5GREENx15s$0.0057287
gpt-5.1GREENx19s$0.0059487
gpt-5GREENx110s$0.0090676
time to green — this trialfull width = 11s
gpt-5.45s · $0.0028
gpt-4.15s · $0.0029
gpt-5.55s · $0.0057
claude-haiku-4-56s · $0.0011
claude-sonnet-56s · $0.0044
claude-sonnet-4-66s · $0.0028
claude-opus-4-86s · $0.0038
gpt-5.19s · $0.0059
claude-fable-59s · $0.0042
gpt-5.210s · $0.0057
gpt-510s · $0.0090
gpt-5-mini11s · $0.0026

Green row = cheapest to done · blue time = fastest to done. REFUSED = the model declined the task (a failure mode token prices never show). claude-fable-5's line is high-variance: follow-up probes saw it stochastically refuse benign coding prompts it had previously attempted. One trial per model per round; replies capped at 2,048 output tokens uniformly. Costs metered per session by cerver.

THE EXACT PROMPT EVERY MODEL RECEIVED
Write `solution.py` with class `TokenBucket(rate: float, burst: float, clock)`:
- `clock` is a zero-arg callable returning seconds (float)
- `allow() -> bool`: consumes 1 token if available, else False
- bucket starts FULL (burst tokens); refills continuously at `rate`/sec,
  capped at `burst`
- must be exact: no drift when allow() is called at irregular times
Return the COMPLETE `solution.py` in one ```python block, nothing else.
THE TESTS — RUN THEM YOURSELF
from solution import TokenBucket

class FakeClock:
    def __init__(self): self.t = 0.0
    def __call__(self): return self.t

def test_burst_then_block():
    c = FakeClock(); b = TokenBucket(rate=1, burst=3, clock=c)
    assert [b.allow() for _ in range(4)] == [True, True, True, False]

def test_refill():
    c = FakeClock(); b = TokenBucket(rate=2, burst=2, clock=c)
    assert b.allow() and b.allow() and not b.allow()
    c.t = 0.5   # +1 token
    assert b.allow() and not b.allow()

def test_cap_at_burst():
    c = FakeClock(); b = TokenBucket(rate=100, burst=2, clock=c)
    b.allow(); b.allow()
    c.t = 999
    assert [b.allow() for _ in range(3)] == [True, True, False]

def test_never_exceeds_capacity_windowed():
    c = FakeClock(); b = TokenBucket(rate=20, burst=40, clock=c)
    admitted = []
    for i in range(400):
        c.t = i * 0.01           # 100 calls/sec attempted for 4s
        if b.allow(): admitted.append(c.t)
    for start in [x * 0.5 for x in range(7)]:
        window = [t for t in admitted if start <= t < start + 1.0]
        assert len(window) <= 60  # 40 burst + 20 refill max in any 1s
Make your own trial
your task, your tests, any model — free tier, no card