File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed
tests/proxy_admin_ui_tests Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,13 @@ class LiteLLMRoutes(enum.Enum):
240
240
mapped_pass_through_routes = [
241
241
"/bedrock" ,
242
242
"/vertex-ai" ,
243
+ "/vertex_ai" ,
244
+ "/cohere" ,
243
245
"/gemini" ,
246
+ "/anthropic" ,
244
247
"/langfuse" ,
248
+ "/azure" ,
249
+ "/openai" ,
245
250
]
246
251
247
252
anthropic_routes = [
Original file line number Diff line number Diff line change @@ -180,23 +180,10 @@ def is_llm_api_route(route: str) -> bool:
180
180
if RouteChecks ._is_azure_openai_route (route = route ):
181
181
return True
182
182
183
- # Pass through Bedrock, VertexAI, and Cohere Routes
184
- if "/bedrock/" in route :
185
- return True
186
- if "/vertex-ai/" in route :
187
- return True
188
- if "/gemini/" in route :
189
- return True
190
- if "/cohere/" in route :
191
- return True
192
- if "/langfuse/" in route :
193
- return True
194
- if "/anthropic/" in route :
195
- return True
196
- if "/azure/" in route :
197
- return True
198
- if "/openai/" in route :
199
- return True
183
+ for _llm_passthrough_route in LiteLLMRoutes .mapped_pass_through_routes .value :
184
+ if _llm_passthrough_route in route :
185
+ return True
186
+
200
187
return False
201
188
202
189
@staticmethod
Original file line number Diff line number Diff line change 30
30
from litellm .proxy .pass_through_endpoints .llm_passthrough_endpoints import (
31
31
router as llm_passthrough_router ,
32
32
)
33
+ from litellm .proxy .vertex_ai_endpoints .vertex_endpoints import (
34
+ router as vertex_router ,
35
+ )
33
36
34
37
# Replace the actual hash_token function with our mock
35
38
import litellm .proxy .auth .route_checks
@@ -93,8 +96,11 @@ def test_is_llm_api_route():
93
96
assert RouteChecks .is_llm_api_route ("/key/regenerate/82akk800000000jjsk" ) is False
94
97
assert RouteChecks .is_llm_api_route ("/key/82akk800000000jjsk/delete" ) is False
95
98
99
+ all_llm_api_routes = vertex_router .routes + llm_passthrough_router .routes
100
+
96
101
# check all routes in llm_passthrough_router, ensure they are considered llm api routes
97
- for route in llm_passthrough_router .routes :
102
+ for route in all_llm_api_routes :
103
+ print ("route" , route )
98
104
route_path = str (route .path )
99
105
print ("route_path" , route_path )
100
106
assert RouteChecks .is_llm_api_route (route_path ) is True
You can’t perform that action at this time.
0 commit comments