fix using wildcard models on proxy

This commit is contained in:
Ishaan Jaff 2024-04-15 14:04:37 -07:00
parent 50081479f9
commit 020fb54ea7

View file

@ -703,7 +703,11 @@ async def user_api_key_auth(
verbose_proxy_logger.debug(
f"model: {model}; allowed_models: {filtered_models}"
)
if model is not None and model not in filtered_models:
if (
model is not None
and model not in filtered_models
and "*" not in filtered_models
):
raise ValueError(
f"API Key not allowed to access model. This token can only access models={valid_token.models}. Tried to access {model}"
)