From 691ca03266539c7278c88a4d10eb161fc7e68e2b Mon Sep 17 00:00:00 2001 From: nate-berri Date: Sat, 10 Oct 2026 13:20:31 -0700 Subject: [PATCH] fix(sdk): resolve litellm.proxy lazily on attribute access (#45845) The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main --- litellm/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/__init__.py b/litellm/__init__.py index 4196912488f..a6bbd132cbf 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -2386,6 +2386,11 @@ def __getattr__(name: str) -> Any: handler_func: Final = registry[name] return handler_func(name) + if name == "proxy": + import importlib + + return importlib.import_module("litellm.proxy") + if name == "harness" or name in _AGENT_EXPORTS: import importlib