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
rename Aporia Guardrail
Ishaan Jaff042350bd746c
diff --git a/enterprise/enterprise_hooks/aporia_ai.py b/enterprise/enterprise_hooks/aporia_ai.pyindex af909a8b515..14a9a06f644 100644--- a/enterprise/enterprise_hooks/aporia_ai.py+++ b/enterprise/enterprise_hooks/aporia_ai.py@@ -36,7 +36,7 @@ litellm.set_verbose = TrueGUARDRAIL_NAME = "aporia"-class _ENTERPRISE_Aporia(CustomGuardrail):+class AporiaGuardrail(CustomGuardrail):def __init__(self, api_key: Optional[str] = None, api_base: Optional[str] = None, **kwargs):diff --git a/litellm/proxy/common_utils/callback_utils.py b/litellm/proxy/common_utils/callback_utils.pyindex 26aa28d62a0..9516f72fb53 100644--- a/litellm/proxy/common_utils/callback_utils.py+++ b/litellm/proxy/common_utils/callback_utils.py@@ -120,7 +120,7 @@ def initialize_callbacks_on_proxy(imported_list.append(lakera_moderations_object)elif isinstance(callback, str) and callback == "aporia_prompt_injection":from litellm.proxy.guardrails.guardrail_hooks.aporia_ai import (- _ENTERPRISE_Aporia,+ AporiaGuardrail,)if premium_user is not True:@@ -129,7 +129,7 @@ def initialize_callbacks_on_proxy(+ CommonProxyErrors.not_premium_user.value)- aporia_guardrail_object = _ENTERPRISE_Aporia()+ aporia_guardrail_object = AporiaGuardrail()imported_list.append(aporia_guardrail_object)elif isinstance(callback, str) and callback == "google_text_moderation":from enterprise.enterprise_hooks.google_text_moderation import (diff --git a/litellm/proxy/guardrails/guardrail_hooks/aporia_ai.py b/litellm/proxy/guardrails/guardrail_hooks/aporia_ai.pyindex 29566d94db6..9572a413bc0 100644--- a/litellm/proxy/guardrails/guardrail_hooks/aporia_ai.py+++ b/litellm/proxy/guardrails/guardrail_hooks/aporia_ai.py@@ -40,7 +40,7 @@ litellm.set_verbose = TrueGUARDRAIL_NAME = "aporia"-class _ENTERPRISE_Aporia(CustomGuardrail):+class AporiaGuardrail(CustomGuardrail):def __init__(self, api_key: Optional[str] = None, api_base: Optional[str] = None, **kwargs):diff --git a/litellm/proxy/guardrails/init_guardrails.py b/litellm/proxy/guardrails/init_guardrails.pyindex 6938a6fc116..93b8e3d5c1e 100644--- a/litellm/proxy/guardrails/init_guardrails.py+++ b/litellm/proxy/guardrails/init_guardrails.py@@ -114,10 +114,10 @@ def init_guardrails_v2(all_guardrails: dict):# Init guardrail CustomLoggerClassif litellm_params["guardrail"] == "aporia":from litellm.proxy.guardrails.guardrail_hooks.aporia_ai import (- _ENTERPRISE_Aporia,+ AporiaGuardrail,)- _aporia_callback = _ENTERPRISE_Aporia(+ _aporia_callback = AporiaGuardrail(api_base=litellm_params["api_base"],api_key=litellm_params["api_key"],guardrail_name=guardrail["guardrail_name"],diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yamlindex 3c1c64292ef..2f0690e173d 100644--- a/litellm/proxy/proxy_config.yaml+++ b/litellm/proxy/proxy_config.yaml@@ -12,9 +12,10 @@ guardrails:mode: "post_call"api_key: os.environ/APORIA_API_KEY_1api_base: os.environ/APORIA_API_BASE_1- - guardrail_name: "aporia-post-guard"+ - guardrail_name: "lakera-pre-guard"litellm_params:- guardrail: aporia # supported values: "aporia", "bedrock", "lakera"- mode: "post_call"- api_key: os.environ/APORIA_API_KEY_2- api_base: os.environ/APORIA_API_BASE_2\ No newline at end of file+ guardrail: lakera # supported values: "aporia", "bedrock", "lakera"+ mode: "pre_call"+ api_key: os.environ/LAKERA_API_KEY+ api_base: os.environ/LAKERA_API_BASE+\ No newline at end of file