The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(internal_user_endpoints.py): expose new 'internal_user_budget_duration' flag
Krrish Dholakia2776d9cb0da7
diff --git a/litellm/__init__.py b/litellm/__init__.pyindex 0429c654748..8d0e1b31495 100644--- a/litellm/__init__.py+++ b/litellm/__init__.py@@ -261,6 +261,7 @@ default_user_params: Optional[Dict] = Nonedefault_team_settings: Optional[List] = Nonemax_user_budget: Optional[float] = Nonemax_internal_user_budget: Optional[float] = None+internal_user_budget_duration: Optional[str] = Nonemax_end_user_budget: Optional[float] = None#### REQUEST PRIORITIZATION ####priority_reservation: Optional[Dict[str, float]] = Nonediff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yamlindex 97457ef84b2..0388b4b94a6 100644--- a/litellm/proxy/_new_secret_config.yaml+++ b/litellm/proxy/_new_secret_config.yaml@@ -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"+diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.pyindex f54eca9a2fc..173b205fc30 100644--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py@@ -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