fix _model_custom_llm_provider_matches_wildcard_pattern

This commit is contained in:
Ishaan Jaff 2025-01-29 18:09:49 -08:00
parent 0eb23f635f
commit d215b65f51

View file

@ -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,