mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
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:
parent
8831f30e9d
commit
2776d9cb0d
3 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,3 +2,12 @@ model_list:
|
|||
- model_name: "gpt-4"
|
||||
litellm_params:
|
||||
model: "gpt-4"
|
||||
api_key: "bad_key"
|
||||
- model_name: "gpt-4o"
|
||||
litellm_params:
|
||||
model: "gpt-4o"
|
||||
|
||||
litellm_settings:
|
||||
max_internal_user_budget: 0.001
|
||||
internal_user_budget_duration: "5m"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue