diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index 89d8eddd5..81e6034e2 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/tests/test_get_model_list.py b/litellm/tests/test_get_model_list.py index 570a0e207..af91715e4 100644 --- a/litellm/tests/test_get_model_list.py +++ b/litellm/tests/test_get_model_list.py @@ -3,6 +3,9 @@ import os, sys, traceback sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path +import litellm from litellm import get_model_list -print(get_model_list()) \ No newline at end of file +print(get_model_list()) +print(get_model_list()) +# print(litellm.model_list) \ No newline at end of file diff --git a/litellm/utils.py b/litellm/utils.py index ad6af63c4..b532ba7d5 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1019,10 +1019,11 @@ def get_model_list(): if time_delta > 300 or last_fetched_at == None: # make the api call last_fetched_at = time.time() + 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"] - return model_list + 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 43d85c960..3563989ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.449" +version = "0.1.450" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"