In-memory ETS-based sliding window rate limiter.
Usage
LLMUtils.RateLimiter.check("nim", 40, 60_000)
# => :ok | :rate_limitedOverride by passing a module implementing check/3 in Client options.
Summary
Functions
@spec check(String.t(), non_neg_integer(), pos_integer()) :: :ok | :rate_limited
Check if a request is within rate limits.
provider_id— Provider identifier (used as ETS table name)max_requests— Maximum number of requests in the windowwindow_ms— Window duration in milliseconds
Returns :ok if under limit, :rate_limited if at/over limit.
@spec reset(String.t()) :: :ok
Reset rate limiter state for a provider.