updates to get model list

This commit is contained in:
Krrish Dholakia 2023-08-24 19:06:44 -07:00
parent 7d16df98ac
commit acccf17e44
3 changed files with 9 additions and 2 deletions

View file

@ -1197,8 +1197,15 @@ def get_model_list():
data = response.json()
# update model list
model_list = data["model_list"]
# check if all model providers are in environment
model_providers = data["model_providers"]
missing_llm_provider = None
for item in model_providers:
if f"{item.upper()}_API_KEY" not in os.environ:
missing_llm_provider = item
break
# update environment - if required
threading.Thread(target=get_all_keys, args=()).start()
threading.Thread(target=get_all_keys, args=(missing_llm_provider)).start()
return model_list
return [] # return empty list by default
except:

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "litellm"
version = "0.1.481"
version = "0.1.482"
description = "Library to easily interface with LLM API providers"
authors = ["BerriAI"]
license = "MIT License"