You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/my-website/docs/proxy/guardrails/ibm_guardrails.md
+12-5Lines changed: 12 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,18 @@ import TabItem from '@theme/TabItem';
3
3
4
4
# IBM Guardrails
5
5
6
-
LiteLLM works with IBM's FMS Guardrails for content safety. You can use it to detect jailbreaks, PII, hate speech, and more.
6
+
LiteLLM works with [IBM's FMS Guardrails](https://github.com/foundation-model-stack/fms-guardrails-orchestrator) for content safety. You can use it to detect jailbreaks, PII, hate speech, and more.
7
7
8
8
## What it does
9
9
10
-
IBM Guardrails analyzes text and tells you if it contains things you want to avoid. It gives each detection a score. Higher scores mean it's more confident.
10
+
IBM's FMS Guardrails is a framework for invoking detectors on LLM inputs and outputs. To configure these detectors, you can use e.g. [TrustyAI detectors](https://github.com/trustyai-explainability/guardrails-detectors), an open-source project maintained by the Red Hat's [TrustyAI team](https://github.com/trustyai-explainability) that allows the user to configure detectors that are:
11
+
12
+
- regex patterns
13
+
- file type validators
14
+
- custom Python functions
15
+
- Hugging Face [AutoModelForSequenceClassification](https://huggingface.co/docs/transformers/en/model_doc/auto#transformers.AutoModelForSequenceClassification), i.e. sequence classification models
16
+
17
+
Each detector outputs an API response based on the following [openapi schema](https://foundation-model-stack.github.io/fms-guardrails-orchestrator/docs/api/openapi_detector_api.yaml).
-`auth_token` - str - Your IBM Guardrails auth token. Can use `os.environ/IBM_GUARDRAILS_AUTH_TOKEN`
76
-
-`base_url` - str - URL of your IBM Guardrails server
83
+
-`base_url` - str - URL of your IBM Detector or Guardrails server
77
84
-`detector_id` - str - Which detector to use (e.g., "jailbreak-detector", "pii-detector")
78
85
79
86
### Optional params
@@ -97,7 +104,7 @@ IBM Guardrails has two APIs you can use:
97
104
98
105
### Detector Server (recommended)
99
106
100
-
The simpler one. Sends all messages at once.
107
+
[This Detectors API](https://foundation-model-stack.github.io/fms-guardrails-orchestrator/?urls.primaryName=Detector+API#/Text) uses `api/v1/text/contents` endpoint to run a single detector; it can accept multiple text inputs within a request.
101
108
102
109
```yaml
103
110
guardrails:
@@ -113,7 +120,7 @@ guardrails:
113
120
114
121
### Orchestrator
115
122
116
-
If you're using the IBM FMS Guardrails Orchestrator, you can use this.
123
+
If you're using the IBM FMS Guardrails Orchestrator, you can use [FMS Orchestrator API](https://foundation-model-stack.github.io/fms-guardrails-orchestrator/?urls.primaryName=Orchestrator+API), specifically by leveraging the `api/v2/text/detection/content` to potentially run multiple detectors in a single request; however, this endpoint can only accept one text input per request.
0 commit comments