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
model_dump()
Ishaan Jaff0af0de8a9634
diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.pyindex 8f91f9bbc99..1f5dcd82409 100644--- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py+++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py@@ -1,8 +1,9 @@#### CRUD ENDPOINTS for UI Settings #####-from typing import List+from typing import Any, Dict, List, Optionalfrom fastapi import APIRouter, Depends, HTTPException+import litellmfrom litellm._logging import verbose_proxy_loggerfrom litellm.proxy._types import *from litellm.proxy.auth.user_api_key_auth import user_api_key_auth@@ -108,3 +109,67 @@ async def delete_allowed_ip(ip_address: IPAddress):await proxy_config.save_config(new_config=config)return {"message": f"IP {ip_address.ip} deleted successfully", "status": "success"}+++ "/sso_settings",+ tags=["SSO Settings"],+ dependencies=[Depends(user_api_key_auth)],+)+async def get_sso_settings():+ """+ Get all SSO settings from the litellm_settings configuration.+ Returns a structured object with values and descriptions for UI display.+ """+ from pydantic import TypeAdapter++ # Create the settings object first+ sso_settings = UISSOSettings(+ max_internal_user_budget=litellm.max_internal_user_budget,+ internal_user_budget_duration=litellm.internal_user_budget_duration,+ default_internal_user_params=DefaultInternalUserParams(+ **(+ litellm.default_internal_user_params+ if isinstance(litellm.default_internal_user_params, dict)+ else {}+ )+ ),+ upperbound_key_generate_params=UpperboundKeyGenerateParams(+ **(+ litellm.upperbound_key_generate_params+ if isinstance(litellm.upperbound_key_generate_params, dict)+ else {}+ )+ ),+ )++ # Get the schema for UISSOSettings+ schema = TypeAdapter(UISSOSettings).json_schema(by_alias=True)++ # Convert to dict for response+ settings_dict = sso_settings.model_dump()++ # Add descriptions to the response+ result = {+ "values": settings_dict,+ "schema": {"description": schema.get("description", ""), "properties": {}},+ }++ # Add property descriptions+ for field_name, field_info in schema["properties"].items():+ result["schema"]["properties"][field_name] = {+ "description": field_info.get("description", ""),+ "type": field_info.get("type", "string"),+ }++ # Add nested object descriptions+ for def_name, def_schema in schema.get("definitions", {}).items():+ result["schema"][def_name] = {+ "description": def_schema.get("description", ""),+ "properties": {+ prop_name: {"description": prop_info.get("description", "")}+ for prop_name, prop_info in def_schema.get("properties", {}).items()+ },+ }++ return result