ai_lib/rate_limiter/
mod.rs

1//! 速率限制和背压控制模块,防止AI API调用过载
2//!
3//! Rate limiting and backpressure control module for AI API calls.
4//!
5//! This module implements token bucket algorithms and backpressure mechanisms
6//! to prevent overwhelming AI providers with too many concurrent requests.
7//!
8//! Key components:
9//! - `TokenBucket`: Token bucket rate limiter implementation
10//! - `BackpressureController`: Manages concurrent request limits
11//! - `RateLimiterConfig`: Configuration for rate limiting parameters
12
13pub mod backpressure;
14pub mod config;
15pub mod token_bucket;
16
17pub use backpressure::{BackpressureController, BackpressurePermit};
18pub use config::RateLimiterConfig;
19pub use token_bucket::TokenBucket;