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
Fix undefined kwargs in InFlightRequestsMiddleware
Julio Quinteros Pro22140b06536b
diff --git a/litellm/proxy/middleware/in_flight_requests_middleware.py b/litellm/proxy/middleware/in_flight_requests_middleware.pyindex ac3ab2c1552..e5e405fb07c 100644--- a/litellm/proxy/middleware/in_flight_requests_middleware.py+++ b/litellm/proxy/middleware/in_flight_requests_middleware.py@@ -62,13 +62,14 @@ class InFlightRequestsMiddleware:try:from prometheus_client import Gauge+ kwargs: dict[str, Any] = {}if "PROMETHEUS_MULTIPROC_DIR" in os.environ:# livesum aggregates across all worker processes in the scrape responsekwargs["multiprocess_mode"] = "livesum"InFlightRequestsMiddleware._gauge = Gauge("litellm_in_flight_requests","Number of HTTP requests currently in-flight on this uvicorn worker",- **kwargs, # type: ignore[arg-type]+ **kwargs,)except Exception:InFlightRequestsMiddleware._gauge = None