mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(router.py): fix get_model_list to return all wildcard models
enables viewing all wildcard models on `/model/info`
This commit is contained in:
parent
f859c6ac0f
commit
59e14fc45c
2 changed files with 10 additions and 9 deletions
|
@ -5286,10 +5286,11 @@ class Router:
|
|||
|
||||
if len(returned_models) == 0: # check if wildcard route
|
||||
potential_wildcard_models = self.pattern_router.route(model_name)
|
||||
if potential_wildcard_models is not None:
|
||||
returned_models.extend(
|
||||
[DeploymentTypedDict(**m) for m in potential_wildcard_models] # type: ignore
|
||||
)
|
||||
if model_name is not None and potential_wildcard_models is not None:
|
||||
for m in potential_wildcard_models:
|
||||
deployment_typed_dict = DeploymentTypedDict(**m) # type: ignore
|
||||
deployment_typed_dict["model_name"] = model_name
|
||||
returned_models.append(deployment_typed_dict)
|
||||
|
||||
if model_name is None:
|
||||
returned_models += self.model_list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue