From 36fda549705e4c0f90fc1dcbe22e09b3240ef511 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 30 Aug 2024 16:08:44 -0700 Subject: [PATCH] allow pass through routes as LLM API routes --- litellm/proxy/auth/auth_utils.py | 11 +++++++++++ litellm/tests/test_proxy_routes.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py index 7c78eb586..6b9c9cefd 100644 --- a/litellm/proxy/auth/auth_utils.py +++ b/litellm/proxy/auth/auth_utils.py @@ -78,6 +78,17 @@ def is_llm_api_route(route: str) -> bool: if re.match(pattern, route): return True + # Pass through Bedrock, VertexAI, and Cohere Routes + if "/bedrock/" in route: + return True + if "/vertex-ai/" in route: + return True + if "/gemini/" in route: + return True + if "/cohere/" in route: + return True + if "/langfuse/" in route: + return True return False diff --git a/litellm/tests/test_proxy_routes.py b/litellm/tests/test_proxy_routes.py index 90fda07a1..4064e5e0f 100644 --- a/litellm/tests/test_proxy_routes.py +++ b/litellm/tests/test_proxy_routes.py @@ -77,6 +77,9 @@ def test_routes_on_litellm_proxy(): ("/v2/chat/completions", False), ("/threads/invalid/format", False), ("/v1/non_existent_endpoint", False), + # Bedrock Pass Through Routes + ("/bedrock/model/cohere.command-r-v1:0/converse", True), + ("/vertex-ai/model/text-embedding-004/embeddings", True), ], ) def test_is_llm_api_route(route: str, expected: bool):