The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Add lazy loading for GaladrielChatConfig to reduce import memory overhead (#18260)
Alexsander Hamirf3b97356fb28
diff --git a/litellm/__init__.py b/litellm/__init__.pyindex 9b69beccd79..0463282c089 100644--- a/litellm/__init__.py+++ b/litellm/__init__.py@@ -1066,7 +1066,6 @@ from .utils import clientfrom .llms.bytez.chat.transformation import BytezChatConfigfrom .llms.custom_llm import CustomLLMfrom .llms.aiohttp_openai.chat.transformation import AiohttpOpenAIChatConfig-from .llms.galadriel.chat.transformation import GaladrielChatConfigfrom .llms.github.chat.transformation import GithubChatConfigfrom .llms.compactifai.chat.transformation import CompactifAIChatConfigfrom .llms.empower.chat.transformation import EmpowerChatConfigdiff --git a/litellm/_lazy_imports.py b/litellm/_lazy_imports.pyindex 94b3e4a8da1..14772862686 100644--- a/litellm/_lazy_imports.py+++ b/litellm/_lazy_imports.py@@ -158,6 +158,7 @@ DOTPROMPT_NAMES = (LLM_CONFIG_NAMES = ("AmazonConverseConfig","OpenAILikeChatConfig",+ "GaladrielChatConfig",)# Types that support lazy loading via _lazy_import_types@@ -660,4 +661,12 @@ def _lazy_import_llm_configs(name: str) -> Any:_globals["OpenAILikeChatConfig"] = _OpenAILikeChatConfigreturn _OpenAILikeChatConfig+ if name == "GaladrielChatConfig":+ from .llms.galadriel.chat.transformation import (+ GaladrielChatConfig as _GaladrielChatConfig,+ )++ _globals["GaladrielChatConfig"] = _GaladrielChatConfig+ return _GaladrielChatConfig+raise AttributeError(f"LLM config lazy import: unknown attribute {name!r}")\ No newline at end of file