From f6fad3b09ed52278fcba5747a094cd9f766da874 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 16 Oct 2024 18:14:07 -0400 Subject: [PATCH] collab: Remove lifetime spending limit in favor of LLM usage billing (#19321) This PR removes the lifetime spending limit that was added in #16780. We had previously added this as a way to prevent runaway usage, but now that we have a cap on free usage per month with paid access after that, we don't need this check anymore. Release Notes: - N/A --- crates/collab/src/llm.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/crates/collab/src/llm.rs b/crates/collab/src/llm.rs index 1facfa20ea..e54c9e133e 100644 --- a/crates/collab/src/llm.rs +++ b/crates/collab/src/llm.rs @@ -443,9 +443,6 @@ pub const FREE_TIER_MONTHLY_SPENDING_LIMIT: Cents = Cents::from_dollars(10); /// Used to prevent surprise bills. pub const DEFAULT_MAX_MONTHLY_SPEND: Cents = Cents::from_dollars(10); -/// The maximum lifetime spending an individual user can reach before being cut off. -const LIFETIME_SPENDING_LIMIT: Cents = Cents::from_dollars(1_000); - async fn check_usage_limit( state: &Arc, provider: LanguageModelProvider, @@ -487,14 +484,6 @@ async fn check_usage_limit( } } - // TODO: Remove this once we've rolled out monthly spending limits. - if usage.lifetime_spending >= LIFETIME_SPENDING_LIMIT { - return Err(Error::http( - StatusCode::FORBIDDEN, - "Maximum spending limit reached.".to_string(), - )); - } - let active_users = state.get_active_user_count(provider, model_name).await?; let users_in_recent_minutes = active_users.users_in_recent_minutes.max(1);