diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index d6bbf760bde..2eeb525f557 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -1161,7 +1161,12 @@ def _model_custom_llm_provider_matches_wildcard_pattern( - `model=claude-3-5-sonnet-20240620` - `allowed_model_pattern=anthropic/*` """ - model, custom_llm_provider, _, _ = get_llm_provider(model=model) + try: + model, custom_llm_provider, _, _ = get_llm_provider(model=model) + except Exception as e: + verbose_proxy_logger.error(f"Error getting LLM provider for model {model}: {e}") + return False + return is_model_allowed_by_pattern( model=f"{custom_llm_provider}/{model}", allowed_model_pattern=allowed_model_pattern,