From dacb1d7fde4f5dbfd4ced0e493c1b453924aa1d0 Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Mon, 2 Feb 2026 14:25:25 -0800 Subject: [PATCH] fix(proxy): wait 5 min after health before auto-benchmark (worker init) Default LITELLM_AUTO_BENCHMARK_STABILIZE_SECONDS changed from 15s to 300s (5 min) so all workers have time to initialize before benchmark starts. --- litellm/proxy/proxy_cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index 7469d6103d8..973e645b2a9 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -212,7 +212,11 @@ class ProxyInitializationHelpers: else: print("LiteLLM: Auto-benchmark timed out waiting for proxy health", file=sys.stderr) return - # Proxy is up: run benchmark (single run or RPS suite) + # Wait for workers to finish initializing (simple fixed delay after first health 200) + stabilize_seconds = float(os.getenv("LITELLM_AUTO_BENCHMARK_STABILIZE_SECONDS", "300")) + if stabilize_seconds > 0: + time.sleep(stabilize_seconds) + # Proxy and workers are up: run benchmark (single run or RPS suite) from datetime import datetime mock_base, _ = ProxyInitializationHelpers._get_mock_chat_endpoint()