diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index fbb714211..a968e80d4 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -12,10 +12,10 @@ model_list: vertex_ai_project: "adroit-crow-413218" vertex_ai_location: "us-east5" -litellm_settings: - key_generation_settings: - team_key_generation: - allowed_team_member_roles: ["admin"] - required_params: ["tags"] # require team admins to set tags for cost-tracking when generating a team key - personal_key_generation: # maps to 'Default Team' on UI - allowed_user_roles: ["proxy_admin"] \ No newline at end of file +# litellm_settings: +# key_generation_settings: +# team_key_generation: +# allowed_team_member_roles: ["admin"] +# required_params: ["tags"] # require team admins to set tags for cost-tracking when generating a team key +# personal_key_generation: # maps to 'Default Team' on UI +# allowed_user_roles: ["proxy_admin"] \ No newline at end of file diff --git a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py index 3f4643afc..6a96638a7 100644 --- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py @@ -54,12 +54,19 @@ def create_request_copy(request: Request): } -@router.api_route("/gemini/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"]) +@router.api_route( + "/gemini/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Google AI Studio Pass-through", "pass-through"], +) async def gemini_proxy_route( endpoint: str, request: Request, fastapi_response: Response, ): + """ + [Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio) + """ ## CHECK FOR LITELLM API KEY IN THE QUERY PARAMS - ?..key=LITELLM_API_KEY api_key = request.query_params.get("key") @@ -111,13 +118,20 @@ async def gemini_proxy_route( return received_value -@router.api_route("/cohere/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"]) +@router.api_route( + "/cohere/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Cohere Pass-through", "pass-through"], +) async def cohere_proxy_route( endpoint: str, request: Request, fastapi_response: Response, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): + """ + [Docs](https://docs.litellm.ai/docs/pass_through/cohere) + """ base_target_url = "https://api.cohere.com" encoded_endpoint = httpx.URL(endpoint).path @@ -154,7 +168,9 @@ async def cohere_proxy_route( @router.api_route( - "/anthropic/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"] + "/anthropic/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Anthropic Pass-through", "pass-through"], ) async def anthropic_proxy_route( endpoint: str, @@ -162,6 +178,9 @@ async def anthropic_proxy_route( fastapi_response: Response, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): + """ + [Docs](https://docs.litellm.ai/docs/anthropic_completion) + """ base_target_url = "https://api.anthropic.com" encoded_endpoint = httpx.URL(endpoint).path @@ -201,13 +220,20 @@ async def anthropic_proxy_route( return received_value -@router.api_route("/bedrock/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"]) +@router.api_route( + "/bedrock/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Bedrock Pass-through", "pass-through"], +) async def bedrock_proxy_route( endpoint: str, request: Request, fastapi_response: Response, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): + """ + [Docs](https://docs.litellm.ai/docs/pass_through/bedrock) + """ create_request_copy(request) try: @@ -275,13 +301,22 @@ async def bedrock_proxy_route( return received_value -@router.api_route("/azure/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"]) +@router.api_route( + "/azure/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Azure Pass-through", "pass-through"], +) async def azure_proxy_route( endpoint: str, request: Request, fastapi_response: Response, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): + """ + Call any azure endpoint using the proxy. + + Just use `{PROXY_BASE_URL}/azure/{endpoint:path}` + """ base_target_url = get_secret_str(secret_name="AZURE_API_BASE") if base_target_url is None: raise Exception( diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 70bf5b523..a982ba39f 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -5663,11 +5663,11 @@ async def anthropic_response( # noqa: PLR0915 user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): """ - This is a BETA endpoint that calls 100+ LLMs in the anthropic format. + 🚨 DEPRECATED ENDPOINT🚨 - To do a simple pass-through for anthropic, do `{PROXY_BASE_URL}/anthropic/v1/messages` + Use `{PROXY_BASE_URL}/anthropic/v1/messages` instead - [Docs](https://docs.litellm.ai/docs/anthropic_completion). - Docs - https://docs.litellm.ai/docs/anthropic_completion + This was a BETA endpoint that calls 100+ LLMs in the anthropic format. """ from litellm import adapter_completion from litellm.adapters.anthropic_adapter import anthropic_adapter diff --git a/litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py b/litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py index ba8653d82..6ce9d5dd8 100644 --- a/litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py +++ b/litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py @@ -58,12 +58,21 @@ def create_request_copy(request: Request): } -@router.api_route("/langfuse/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"]) +@router.api_route( + "/langfuse/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Langfuse Pass-through", "pass-through"], +) async def langfuse_proxy_route( endpoint: str, request: Request, fastapi_response: Response, ): + """ + Call Langfuse via LiteLLM proxy. Works with Langfuse SDK. + + [Docs](https://docs.litellm.ai/docs/pass_through/langfuse) + """ ## CHECK FOR LITELLM API KEY IN THE QUERY PARAMS - ?..key=LITELLM_API_KEY api_key = request.headers.get("Authorization") or "" diff --git a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py index fbf37ce8d..470744e19 100644 --- a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py +++ b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py @@ -113,13 +113,20 @@ def construct_target_url( @router.api_route( - "/vertex-ai/{endpoint:path}", methods=["GET", "POST", "PUT", "DELETE"] + "/vertex-ai/{endpoint:path}", + methods=["GET", "POST", "PUT", "DELETE"], + tags=["Vertex AI Pass-through", "pass-through"], ) async def vertex_proxy_route( endpoint: str, request: Request, fastapi_response: Response, ): + """ + Call LiteLLM proxy via Vertex AI SDK. + + [Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai) + """ encoded_endpoint = httpx.URL(endpoint).path import re