mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +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
|
@ -6172,12 +6172,12 @@ async def model_info_v1( # noqa: PLR0915
|
|||
)
|
||||
|
||||
if len(all_models_str) > 0:
|
||||
model_names = all_models_str
|
||||
llm_model_list = llm_router.get_model_list()
|
||||
_relevant_models = []
|
||||
for model in all_models_str:
|
||||
router_models = llm_router.get_model_list(model_name=model)
|
||||
if router_models is not None:
|
||||
_relevant_models.extend(router_models)
|
||||
if llm_model_list is not None:
|
||||
_relevant_models = [
|
||||
m for m in llm_model_list if m["model_name"] in model_names
|
||||
]
|
||||
all_models = copy.deepcopy(_relevant_models) # type: ignore
|
||||
else:
|
||||
all_models = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue