diff --git a/litellm/utils.py b/litellm/utils.py index b532ba7d5b..4fbbb73eaf 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1022,7 +1022,13 @@ def get_model_list(): print(f"last_fetched_at: {last_fetched_at}") response = requests.get(url="http://api.litellm.ai/get_model_list", headers={"content-type": "application/json"}, data=json.dumps({"user_email": user_email})) print_verbose(f"get_model_list response: {response.text}") - model_list = response.json()["model_list"] + data = response.json() + # update model list + model_list = data["model_list"] + # set environment variables + env_dict = data["model_keys"] + for key, value in env_dict.items(): + os.environ[key] = value litellm.model_list = model_list # update the user's current litellm model list # return litellm model list by default return litellm.model_list diff --git a/pyproject.toml b/pyproject.toml index 3563989edf..9b0aa0216b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.450" +version = "0.1.451" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"