From a5ef6aeaf38abc8233489db64d062da29f95c30a Mon Sep 17 00:00:00 2001 From: mateo Date: Thu, 24 Sep 2026 17:34:59 +0000 Subject: [PATCH] feat: expose litellm.__version__ Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/__init__.py | 2 ++ tests/test_litellm/test___init__.py | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/test_litellm/test___init__.py diff --git a/litellm/__init__.py b/litellm/__init__.py index 8b1b5a5d008..30a6c516793 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -17,6 +17,8 @@ import os # Load .env before any other litellm imports so env vars (e.g. LITELLM_UI_SESSION_DURATION) are available import dotenv as _dotenv +from ._version import version as __version__ + def _dev_env_hot_reload_enabled() -> bool: """The proxy exports this flag when started with ``--reload``. A reloaded diff --git a/tests/test_litellm/test___init__.py b/tests/test_litellm/test___init__.py new file mode 100644 index 00000000000..1190490936c --- /dev/null +++ b/tests/test_litellm/test___init__.py @@ -0,0 +1,7 @@ +from importlib.metadata import version + +import litellm + + +def test_dunder_version_matches_installed_distribution() -> None: + assert litellm.__version__ == version("litellm")