Skip to content

Commit

Permalink
chore: use rps for rate limit (#3493)
Browse files Browse the repository at this point in the history
* chore: use rps for rate limit

Signed-off-by: Wei Zhang <[email protected]>

* chore: use rpm for max and init in rate limit

Signed-off-by: Wei Zhang <[email protected]>

---------

Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper authored Nov 29, 2024
1 parent 0f8a5a0 commit 6236c30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/http-api-bindings/src/rate_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use ratelimit::Ratelimiter;
use tabby_inference::{ChatCompletionStream, CompletionOptions, CompletionStream, Embedding};

fn new_rate_limiter(rpm: u64) -> Ratelimiter {
Ratelimiter::builder(rpm, Duration::from_secs(60))
Ratelimiter::builder(rpm/60, Duration::from_secs(1))
.max_tokens(rpm)
.initial_available(rpm)
.build()
Expand Down

0 comments on commit 6236c30

Please sign in to comment.