fix(proxy_server.py): fix model info check

This commit is contained in:
Krrish Dholakia 2024-03-23 15:59:17 -07:00
parent 5bcf92f4f5
commit c81c9c2583
2 changed files with 46 additions and 1 deletions

View file

@ -6409,6 +6409,9 @@ async def add_new_model(model_params: ModelParams):
async def model_info_v2(
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
"""
BETA ENDPOINT. Might change unexpectedly. Use `/v1/model/info` for now.
"""
global llm_model_list, general_settings, user_config_file_path, proxy_config
# Load existing config
@ -6550,7 +6553,7 @@ async def model_info_v1(
if len(user_api_key_dict.models) > 0:
model_names = user_api_key_dict.models
all_models = [m for m in config["model_list"] if m in model_names]
all_models = [m for m in config["model_list"] if m["model_name"] in model_names]
else:
all_models = config["model_list"]
for model in all_models: