diff --git a/litellm/__init__.py b/litellm/__init__.py index 368beb08ca1..e6cdf7ea21a 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -46,8 +46,9 @@ client_session: Optional[requests.Session] = None model_fallbacks: Optional[List] = None ############################################# -def get_model_cost_map(): - url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" +def get_model_cost_map(url: Optional[str]=None): + if url is None: + url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" try: response = requests.get(url) response.raise_for_status() # Raise an exception if request is unsuccessful diff --git a/litellm/tests/test_get_model_file.py b/litellm/tests/test_get_model_file.py index 42a86153c50..820465273c7 100644 --- a/litellm/tests/test_get_model_file.py +++ b/litellm/tests/test_get_model_file.py @@ -7,6 +7,6 @@ import litellm import pytest try: - print(litellm.get_model_cost_map()) + print(litellm.get_model_cost_map(url="fake-url")) except Exception as e: pytest.fail(f"An exception occurred: {e}") \ No newline at end of file