Hacker
Krrish Kumar
@krrishkumar
Projects
Pacing Wars: retry on 429 or pace your LLM calls? A Flagsmith A/B test settles it
Flagsmith Experimentation HackathonNov 2026
Pacing Wars is a pre-registered A/B test, run with Flagsmith Experimentation, on a question every team calling an LLM API runs into: when jobs hit the provider's rate limit, do you retry on 429 with full jitter, or pace calls on the client so you never send what the limit cannot take? The usual advice is retry with backoff and jitter. But OpenAI's own docs say failed requests count against your per minute limit, so retries can keep a full limit full. Pacing avoids 429s but makes jobs wait in line. Nobody should settle this by arguing, so we let a flag and the numbers decide. Both strategies sit behind one Flagsmith multivariate flag. 320 simulated customers, each a Flagsmith identity, send seeded bursts of 9,545 jobs through a BullMQ queue on Redis to an OpenAI shaped fake API with per customer RPM and TPM limits. Workers send exposure and metric events to Flagsmith, a live dashboard shows both arms side by side, and a second flag is a kill switch. The result: token pacing finished 97.7% of jobs within 60 s versus 86.1% for jitter retry (+11.7 points, 95% CI +8.3 to +15.0), with zero 429s against 1.43 per job, and none of its jobs gave up against 933. Flagsmith gives pacing over a 99.9% chance to win, so the pre-registered rule said ship, and token_pacing went out to every customer through the same flag with no redeploy. We also tested where the answer flips. If the provider stops counting rejected requests, jitter retry edges ahead, 98.9% vs 97.8%. So the practical advice is clear: pace on the client when failed requests count against your limit, otherwise jitter retry is fine. Everything reruns with one command on self hosted Flagsmith, no paid services, and every committed results page can be rebuilt offline from its job log (checked in CI).