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
This commit is contained in:
nate-berri 2026-10-10 13:20:31 -07:00 • committed by GitHub
parent cf1284f3d5
commit 691ca03266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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