mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-09 15:09:20 +00:00
docs update
This commit is contained in:
@@ -71,11 +71,105 @@ For each step you choose an action for **pass**, **fail**, and optionally **erro
|
||||
3. Select **Flow Builder** (instead of the simple form)
|
||||
4. Design your flow:
|
||||
- **Trigger** — Incoming LLM request (runs when the policy matches)
|
||||
- **Steps** — Add guardrails, set **ON PASS**, **ON FAIL**, and **ON ERROR** actions per step (ON ERROR is optional; when unset, errors follow ON FAIL)
|
||||
- **End** — Request proceeds to the LLM
|
||||
5. Use the **+** between steps to insert new steps
|
||||
6. Use the **Test** panel to run sample messages through the pipeline before saving
|
||||
7. Click **Save** to create or update the policy
|
||||
- **Steps** — Add guardrails; set **ON PASS**, **ON FAIL**, and **ON API FAILURE** / **ON ERROR** per step (when **ON API FAILURE** is unset, technical errors follow **ON FAIL**)
|
||||
- **End** — Request proceeds to the LLM when the pipeline allows it
|
||||
5. Use **+** between steps to insert another guardrail step (for fallbacks, retries, or stricter second checks)
|
||||
6. Use **Test Pipeline** to run sample messages before saving
|
||||
7. Click **Save Policy** (or **Save**) to create or update the policy
|
||||
|
||||
### Configure guardrail fallbacks in the UI (walkthrough)
|
||||
|
||||
1. Click **Policies**
|
||||
|
||||

|
||||
|
||||
2. Click **+ Add New Policy**
|
||||
|
||||

|
||||
|
||||
3. Click **Flow Builder**
|
||||
|
||||

|
||||
|
||||
4. Click **Continue to Builder**
|
||||
|
||||

|
||||
|
||||
5. Click the **guardrail search** field on the first step
|
||||
|
||||

|
||||
|
||||
6. Choose **Test Moderation** (or your primary guardrail)
|
||||
|
||||

|
||||
|
||||
7. For one branch (e.g. **ON API FAILURE**), set the action to **Next Step** so the pipeline can fall through to the next guardrail when the API errors
|
||||
|
||||

|
||||
|
||||
8. For **ON PASS**, set **Allow** (or **Next Step** if you need more steps before allowing)
|
||||
|
||||

|
||||
|
||||
9. Open the next outcome’s search/dropdown (e.g. **ON FAIL**)
|
||||
|
||||

|
||||
|
||||
10. Set that branch to **Next Step** if failed checks should continue to your backup guardrail
|
||||
|
||||

|
||||
|
||||
11. Click **+** between steps to add a second guardrail
|
||||
|
||||

|
||||
|
||||
12. Open the guardrail search field on the new step
|
||||
|
||||

|
||||
|
||||
13. Select **Insults & Personal Attacks** (or your fallback / stricter guardrail)
|
||||
|
||||

|
||||
|
||||
14. Set **Next Step** or **Block** on the branches as needed for this step
|
||||
|
||||

|
||||
|
||||
15. Set **ON PASS** to **Allow** when this guardrail should complete the pipeline successfully
|
||||
|
||||

|
||||
|
||||
16. Open the branch where you want a **Custom Response** (e.g. **ON FAIL** on the last step)
|
||||
|
||||

|
||||
|
||||
17. Choose **Custom Response**
|
||||
|
||||

|
||||
|
||||
18. Click **Enter custom response...** and type your message
|
||||
|
||||

|
||||
|
||||
19. Confirm or edit the message in **Enter custom response...** as needed
|
||||
|
||||

|
||||
|
||||
20. Open **Test Pipeline**
|
||||
|
||||

|
||||
|
||||
21. Click **Run Test**
|
||||
|
||||

|
||||
|
||||
22. Expand **Step 1** (or the first guardrail row) in the results to see **ERROR** / **Next Step** vs **PASS** / **Allow**
|
||||
|
||||

|
||||
|
||||
23. Expand **Step 2** (e.g. **Insults & Personal Attacks**) to confirm **PASS** and **Allow** after the fallback
|
||||
|
||||

|
||||
|
||||
## Config (YAML)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user