1
Install the Qualifire SDK
Install the Qualifire Python SDK:
2
Configure Guardrails in LiteLLM
Define your guardrails under the
guardrails section in your config.yaml:litellm config.yaml
Supported values for
mode:pre_call- Run before LLM call, on inputpost_call- Run after LLM call, on input & outputduring_call- Run during LLM call, on input. Same aspre_callbut runs in parallel as LLM call. Response not returned until guardrail check completes
3
Start LiteLLM Gateway
Start the LiteLLM gateway with your configuration:
4
Test Your Integration
Test your integration with a request. The guardrail will block requests that violate your policies.
Using Pre-configured Evaluations
You can use evaluations pre-configured in the Qualifire Dashboard by specifying theevaluation_id:
litellm config.yaml
When
evaluation_id is provided, LiteLLM will use invoke_evaluation()
instead of evaluate(), running the pre-configured evaluation from your
dashboard.Available Checks
- Inline Checks
- Pre-configured Evaluations
Parameter Reference
Default Behavior
- If no
evaluation_idis provided and no checks are explicitly enabled,prompt_injectionsdefaults totrue - When
evaluation_idis provided, it takes precedence and individual check flags are ignored on_flagged: "block"raises an HTTP 400 exception when violations are detectedon_flagged: "monitor"logs violations but allows the request to proceed
Complete Configuration Example
litellm config.yaml
Tool Call Support
Qualifire supports evaluating tool/function calls. When usingtool_selection_quality_check, the guardrail will analyze tool calls in assistant messages: