diff --git a/litellm/__init__.py b/litellm/__init__.py index d364335ab..ef7bfe91d 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -101,7 +101,8 @@ for key, value in model_cost.items(): elif value.get('litellm_provider') == 'anthropic': anthropic_models.append(key) elif value.get('litellm_provider') == 'openrouter': - openrouter_models.append(key) + split_string = key.split('/', 1) + openrouter_models.append(split_string[1]) elif value.get('litellm_provider') == 'vertex_ai-text-models': vertex_text_models.append(key) elif value.get('litellm_provider') == 'vertex_ai-code-text-models': diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index f98964ab7..77b9f46da 100644 Binary files a/litellm/__pycache__/__init__.cpython-311.pyc and b/litellm/__pycache__/__init__.cpython-311.pyc differ diff --git a/litellm/__pycache__/main.cpython-311.pyc b/litellm/__pycache__/main.cpython-311.pyc index 9f7c5169e..24ef31d5f 100644 Binary files a/litellm/__pycache__/main.cpython-311.pyc and b/litellm/__pycache__/main.cpython-311.pyc differ diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index ae0db3f8d..dbb232368 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_completion.py b/litellm/tests/test_completion.py index fe8915372..4d418ccbd 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -336,6 +336,8 @@ def test_completion_openai_litellm_key(): # except Exception as e: # pytest.fail(f"Error occurred: {e}") +# test_completion_openrouter() + def test_completion_openai_with_more_optional_params(): try: response = completion( @@ -816,7 +818,7 @@ def test_completion_ai21(): except Exception as e: pytest.fail(f"Error occurred: {e}") -# test_completion_ai21() +test_completion_ai21() # test config file with completion # # def test_completion_openai_config(): # try: