Merge pull request #9258 from BerriAI/litellm_fix_models_view_edit

(UI) Fix model edit + delete - instantly show edit + deletes to models
This commit is contained in:
Ishaan Jaff 2025-03-14 21:21:46 -07:00 committed by GitHub
commit 2cd1301eaa
4 changed files with 36 additions and 9 deletions

View file

@ -5475,18 +5475,18 @@ async def model_info_v2(
"""
global llm_model_list, general_settings, user_config_file_path, proxy_config, llm_router
if llm_model_list is None or not isinstance(llm_model_list, list):
if llm_router is None:
raise HTTPException(
status_code=500,
detail={
"error": f"No model list passed, models={llm_model_list}. You can add a model through the config.yaml or on the LiteLLM Admin UI."
"error": f"No model list passed, models router={llm_router}. You can add a model through the config.yaml or on the LiteLLM Admin UI."
},
)
# Load existing config
await proxy_config.get_config()
all_models = copy.deepcopy(llm_router.model_list)
all_models = copy.deepcopy(llm_model_list)
if user_model is not None:
# if user does not use a config.yaml, https://github.com/BerriAI/litellm/issues/2061
all_models += [user_model]