From 3140d6ce8c5dea97a728372b7e5c19a0c7ce4011 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sun, 11 Aug 2024 14:41:49 -0400 Subject: [PATCH] collab: Temporarily bypass LLM rate limiting for staff (#16089) This PR makes it so staff members will be exempt from rate limiting by the LLM service. This is just a temporary measure until we can tweak the rate-limiting heuristics. Staff members are still subject to upstream LLM provider rate limits. Release Notes: - N/A --- crates/collab/src/llm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/collab/src/llm.rs b/crates/collab/src/llm.rs index 43bbca1df0bb324ff2214e215f704cfa9340beee..e406526fbf22a8cb52948016a642be2b6e45b517 100644 --- a/crates/collab/src/llm.rs +++ b/crates/collab/src/llm.rs @@ -400,6 +400,11 @@ async fn check_usage_limit( ]; for (usage, limit, resource) in checks { + // Temporarily bypass rate-limiting for staff members. + if claims.is_staff { + continue; + } + if usage > limit { return Err(Error::http( StatusCode::TOO_MANY_REQUESTS,