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]

fix: GuardrailConfigModel

Ishaan Jafferbea8e13a94b0
diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/base.py b/litellm/types/proxy/guardrails/guardrail_hooks/base.py
index d2607e89128..0acda1ba927 100644
--- a/litellm/types/proxy/guardrails/guardrail_hooks/base.py
+++ b/litellm/types/proxy/guardrails/guardrail_hooks/base.py
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
-from typing import Generic, TypeVar
+from typing import Generic, Optional, TypeVar
from pydantic import BaseModel, Field
@@ -9,7 +9,8 @@ T = TypeVar("T", bound=BaseModel)
class GuardrailConfigModel(BaseModel, Generic[T], ABC):
"""Base model for guardrail configuration"""
- optional_params: T = Field(
+ optional_params: Optional[T] = Field(
+ default=None,
description="Optional parameters for the guardrail",
)