Skip to main content

venice_ai.rate_limiting.config

Rate limiter configuration.

RateLimiterMode Objects

class RateLimiterMode(StrEnum)

Rate limiter mode selection.

RateLimiterMode.SIMPLE

SIMPLE = "simple"

Default, in-memory, reactive

RateLimiterMode.ADAPTIVE

ADAPTIVE = "adaptive"

Requires adaptive-rate-limiter package, proactive

RateLimiterMode.DISABLED

DISABLED = "disabled"

No rate limiting (testing only, NOT recommended for production)

RateLimiterConfig Objects

@dataclass
class RateLimiterConfig()

Configuration for rate limiting behavior.

For SimpleRateLimiter (mode=SIMPLE): - Reactive rate limiting (responds to 429s with backoff) - Single-process only - No Redis required

For AdaptiveScheduler (mode=ADAPTIVE): - Proactive rate limiting (prevents 429s) - Multi-process/worker coordination via Redis - Token prediction and cold-start protection - Requires: pip install venice-ai[adaptive] - Requires: redis_url configuration

RateLimiterConfig.account_id

account_id = None

Required for key scoping in adaptive mode