mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
patch - auth checks for model access (#8924)
This commit is contained in:
parent
428ed1360c
commit
5508239375
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
# What is this?
|
||||
## Common checks for /v1/models and `/model/info`
|
||||
import copy
|
||||
from typing import Dict, List, Optional, Set
|
||||
|
||||
import litellm
|
||||
|
|
@ -30,7 +31,7 @@ def get_provider_models(provider: str) -> Optional[List[str]]:
|
|||
return get_valid_models()
|
||||
|
||||
if provider in litellm.models_by_provider:
|
||||
provider_models = litellm.models_by_provider[provider]
|
||||
provider_models = copy.deepcopy(litellm.models_by_provider[provider])
|
||||
for idx, _model in enumerate(provider_models):
|
||||
if provider not in _model:
|
||||
provider_models[idx] = f"{provider}/{_model}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue