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
This commit is contained in:
parent
6614feff97
commit
f6fad3b09e
1 changed files with 0 additions and 11 deletions
|
@ -443,9 +443,6 @@ pub const FREE_TIER_MONTHLY_SPENDING_LIMIT: Cents = Cents::from_dollars(10);
|
||||||
/// Used to prevent surprise bills.
|
/// Used to prevent surprise bills.
|
||||||
pub const DEFAULT_MAX_MONTHLY_SPEND: Cents = Cents::from_dollars(10);
|
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(
|
async fn check_usage_limit(
|
||||||
state: &Arc<LlmState>,
|
state: &Arc<LlmState>,
|
||||||
provider: LanguageModelProvider,
|
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 active_users = state.get_active_user_count(provider, model_name).await?;
|
||||||
|
|
||||||
let users_in_recent_minutes = active_users.users_in_recent_minutes.max(1);
|
let users_in_recent_minutes = active_users.users_in_recent_minutes.max(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue