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]

test fix: tests.test_litellm.proxy.guardrails.guardrail_hooks.guardrails_ai.test_guardrails_ai::test_guardrails_ai_process_input

Ishaan Jaffer80af02a1c3c6
diff --git a/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/guardrails_ai.py b/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/guardrails_ai.py
index 84cbef05266..2d04517de2b 100644
--- a/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/guardrails_ai.py
+++ b/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/guardrails_ai.py
@@ -167,6 +167,10 @@ class GuardrailsAI(CustomGuardrail):
set_last_user_message,
)
+ # Only process completion-related call types
+ if call_type not in ["completion", "acompletion"]:
+ return data
+
if "messages" not in data: # invalid request
return data