Integration Guide
Installation
To configure LiteLLM with Aporia, start by installing LiteLLM:Use LiteLLM AI Gateway with Aporia Guardrails
In this tutorial we will use LiteLLM Proxy with Aporia to detect PII in requests.1. Setup guardrails on Aporia
Pre-Call: Detect PII
Add thePII - Prompt to your Aporia project.
2. Define Guardrails on your LiteLLM config.yaml
- Define your guardrails under the
guardrailssection and setpre_call_guardrails
Supported values for mode
pre_callRun before LLM call, on inputpost_callRun after LLM call, on input & outputduring_callRun during LLM call, on input
3. Start LiteLLM Gateway
4. Test request
- Unsuccessful call
- Successful Call
5. Control Guardrails per Project (API Key)
Use this to control what guardrails run per project. In this tutorial we only want the following guardrails to run for 1 project (API Key)guardrails: [“aporia-pre-guard”, “aporia”]
- /key/generate
- /key/update