fix(internal_user_endpoints.py): expose new 'internal_user_budget_duration' flag

Relevant to - https://github.com/BerriAI/litellm/issues/5106
This commit is contained in:
Krrish Dholakia 2024-08-08 13:05:03 -07:00
parent 5d664c0441
commit 5da4c27e8d
6 changed files with 8 additions and 5 deletions

View file

@ -261,6 +261,7 @@ default_user_params: Optional[Dict] = None
default_team_settings: Optional[List] = None
max_user_budget: Optional[float] = None
max_internal_user_budget: Optional[float] = None
internal_user_budget_duration: Optional[str] = None
max_end_user_budget: Optional[float] = None
#### REQUEST PRIORITIZATION ####
priority_reservation: Optional[Dict[str, float]] = None

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -11,5 +11,6 @@ model_list:
model: "gpt-4o"
litellm_settings:
enable_json_schema_validation: true
fallbacks: [{"gpt-3.5-turbo": ["gpt-4", "gpt-4o"]}]
max_internal_user_budget: 0.001
internal_user_budget_duration: "5m"

View file

@ -91,6 +91,10 @@ async def new_user(
if litellm.max_internal_user_budget is not None:
data_json["max_budget"] = litellm.max_internal_user_budget
if "budget_duration" in data_json and data_json["budget_duration"] is None:
if litellm.internal_user_budget_duration is not None:
data_json["budget_duration"] = litellm.internal_user_budget_duration
response = await generate_key_helper_fn(request_type="user", **data_json)
# Admin UI Logic