mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(fix) raise exception budget_duration is set and max_budget is Not
This commit is contained in:
parent
3ef2afb0e4
commit
126b87e3fa
1 changed files with 6 additions and 5 deletions
|
@ -1651,11 +1651,12 @@ async def startup_event():
|
||||||
user_id="default_user_id",
|
user_id="default_user_id",
|
||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if prisma_client is not None and litellm.max_budget > 0:
|
||||||
prisma_client is not None
|
if litellm.budget_duration is None:
|
||||||
and litellm.max_budget > 0
|
raise Exception(
|
||||||
and litellm.budget_duration is not None
|
"budget_duration not set on Proxy. budget_duration is required to use max_budget."
|
||||||
):
|
)
|
||||||
|
|
||||||
# add proxy budget to db in the user table
|
# add proxy budget to db in the user table
|
||||||
await generate_key_helper_fn(
|
await generate_key_helper_fn(
|
||||||
user_id=litellm_proxy_budget_name,
|
user_id=litellm_proxy_budget_name,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue