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: req changes to improve score
Harshit28ja28fbba3b17d
diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.pyindex e749b167c75..a3138b417dc 100644--- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py+++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py@@ -950,7 +950,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):Helper to recursively process a ModelResponse for PII.Handles all choices and tool calls."""- metadata = request_data.get("metadata", {}) if request_data else {}+ metadata = (request_data.get("metadata") or {}) if request_data else {}pii_tokens = metadata.get("pii_tokens", {})if not pii_tokens and mode == "unmask":verbose_proxy_logger.debug(@@ -1113,7 +1113,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):return# --- PII unmasking path (output_parse_pii=True) ---- metadata = request_data.get("metadata", {}) if request_data else {}+ metadata = (request_data.get("metadata") or {}) if request_data else {}pii_tokens = metadata.get("pii_tokens", {})if not pii_tokens and request_data:verbose_proxy_logger.debug(