AI Agent Rate Limiter & Task Queue

•
1
•

Manages LLM API traffic using dual token buckets, priority queuing, and exponential backoff to eliminate 429 rate limit errors in AI agents.

Agent Rate Limiter & Task Queue provides production-ready rate limiting and asynchronous scheduling for multi-agent workflows calling LLM APIs. By combining dual token buckets (RPM and TPM), task priority queuing, asyncio concurrency semaphores, and exponential backoff retry mechanisms, it smooths out traffic spikes, eliminates catastrophic 429 retry storms, and ensures critical real-time user queries are executed before background batch tasks.

主要功能

01Priority queue scheduler guaranteeing real-time user prompts precede background jobs
02Exponential backoff retry policy to prevent cascading retry storms
03Dual token bucket tracking for Requests Per Minute (RPM) and Tokens Per Minute (TPM)
04Non-blocking asynchronous waiting to maintain high agent responsiveness
051 GitHub stars
06Concurrency semaphore controls limiting parallel connections and memory usage

使用场景

01Preventing 429 Too Many Requests errors in multi-user conversational support agents during peak traffic
02Scheduling bulk document summarization or batch evaluation tasks alongside interactive user sessions
03Optimizing LLM token costs by eliminating wasteful duplicate retries after transient failures