Skip to content

Commit 5ad108b

Browse files
authored
📝 updated ibm_guardrails.md to better indicate how detectors could be configured (#15971)
1 parent c5c37bf commit 5ad108b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/my-website/docs/proxy/guardrails/ibm_guardrails.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ import TabItem from '@theme/TabItem';
33

44
# IBM Guardrails
55

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.
77

88
## What it does
99

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).
1118

1219
You can run these checks:
1320
- Before sending to the LLM (on user input)
@@ -73,7 +80,7 @@ curl -i http://localhost:4000/v1/chat/completions \
7380

7481
- `guardrail` - str - Set to `ibm_guardrails`
7582
- `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
7784
- `detector_id` - str - Which detector to use (e.g., "jailbreak-detector", "pii-detector")
7885

7986
### Optional params
@@ -97,7 +104,7 @@ IBM Guardrails has two APIs you can use:
97104

98105
### Detector Server (recommended)
99106

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.
101108

102109
```yaml
103110
guardrails:
@@ -113,7 +120,7 @@ guardrails:
113120
114121
### Orchestrator
115122
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.
117124

118125
```yaml
119126
guardrails:

0 commit comments

Comments
 (0)