diff --git a/litellm/__init__.py b/litellm/__init__.py index fea7a27a5fb..cc00a19dfd0 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")