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
perf(proxy): gc.freeze() the startup heap once the proxy is up so gen-2 passes stop re-walking it (#47137)
Kerry Lu1436a8851afc
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 27bfd03d7f8..1e16eb626fe 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -1,6 +1,7 @@import asyncioimport copyimport enum+import gcimport importlibimport inspectimport io@@ -1746,6 +1747,8 @@ async def proxy_startup_event(app: FastAPI) -> AsyncGenerator[ProxyLifespanStateasync with AsyncExitStack() as admin_mcp_stack:try:await admin_mcp_stack.enter_async_context(admin_mcp_lifespan(app))+ gc.freeze()+ verbose_proxy_logger.warning("gc.freeze pinned %d startup objects", gc.get_freeze_count())yield statefinally:if model_info_scheduler is not None and model_info_scheduler.running: