bricks-cloud / BricksLLM

🔒 Enterprise-grade API gateway that helps you monitor and impose cost or rate limits per API key. Get fine-grained access control and monitoring per user, application, or environment. Supports OpenAI, Azure OpenAI, Anthropic, vLLM, and open-source LLMs.
https://trybricks.ai/
MIT License
901 stars 61 forks source link

Rate limit refresh time is not consistent #31

Closed spikelu2016 closed 10 months ago

spikelu2016 commented 10 months ago

Currently rate limits refresh at the end of the time interval with the key creation time as the start. The correct behavior is following: if a key is created at 55 seconds UTC with 1 request per minute rate limit, the key needs to refresh after 4 seconds instead of after 60 seconds.