Skip to content

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]

refactor(proxy): freeze the filtered worker config before initialize

mateof7756d01cf03
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 9c4ea7e8599..72bfb2b53a9 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -8571,8 +8571,9 @@ def save_worker_config(**data):
LEGACY_WORKER_CONFIG_KEYS: Final = frozenset({"telemetry"})
-async def initialize_from_worker_config(worker_config: dict[str, object]) -> None:
- await initialize(**{k: v for k, v in worker_config.items() if k not in LEGACY_WORKER_CONFIG_KEYS})
+async def initialize_from_worker_config(worker_config: Mapping[str, object]) -> None:
+ supported: Final = MappingProxyType({k: v for k, v in worker_config.items() if k not in LEGACY_WORKER_CONFIG_KEYS})
+ await initialize(**supported)
async def initialize(