diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index be5d0331df..24aab1cfdd 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -362,6 +362,8 @@ class LiteLLMRoutes(enum.Enum): "/v1/ocr", # containers API + "/containers", + "/v1/containers", "/containers/*", "/v1/containers/*", ] diff --git a/litellm/proxy/auth/route_checks.py b/litellm/proxy/auth/route_checks.py index 24f53b16be..96a70b8016 100644 --- a/litellm/proxy/auth/route_checks.py +++ b/litellm/proxy/auth/route_checks.py @@ -308,7 +308,7 @@ class RouteChecks: return True # fuzzy match routes like "/v1/threads/thread_49EIN5QF32s4mH20M7GFKdlZ" - # Check for routes with placeholders + # Check for routes with placeholders or wildcard patterns for openai_route in LiteLLMRoutes.openai_routes.value: # Replace placeholders with regex pattern # placeholders are written as "/threads/{thread_id}" @@ -317,6 +317,12 @@ class RouteChecks: route=route, pattern=openai_route ): return True + # Check for wildcard patterns like "/containers/*" + if RouteChecks._is_wildcard_pattern(pattern=openai_route): + if RouteChecks._route_matches_wildcard_pattern( + route=route, pattern=openai_route + ): + return True # Check for Google routes with placeholders like "/v1beta/models/{model_name}:generateContent" for google_route in LiteLLMRoutes.google_routes.value: