|
1 | 1 | :_module-type: ASSEMBLY |
2 | 2 |
|
3 | 3 | ifdef::context[:parent-context: {context}] |
4 | | -[id="configuring-the-guardrails-orchestrator-service_{context}"] |
5 | | -= Configuring the Guardrails Orchestrator service |
| 4 | +[id="enable-ai-safety-with-guardrails_{context}"] |
| 5 | += Enabling AI safety with Guardrails |
6 | 6 |
|
7 | 7 | The TrustyAI Guardrails Orchestrator service is a tool to invoke detections on text generation inputs and outputs, as well as standalone detections. |
8 | 8 |
|
9 | 9 | It is underpinned by the open-source project link:https://github.com/foundation-model-stack/fms-guardrails-orchestrator[FMS-Guardrails Orchestrator] from IBM. You can deploy the Guardrails Orchestrator service through a Custom Resource Definition (CRD) that is managed by the TrustyAI Operator. |
10 | 10 |
|
11 | | -You can use the following detectors with trustyai_fms: |
| 11 | +The following sections describe the Guardrails components, how to deploy them and provide example use cases of how to protect your AI applications using these tools: |
12 | 12 |
|
| 13 | +Deploy a Guardrails Orchestrator instance:: |
| 14 | +The guardrails orchestrator is the main networking layer of the guardrails ecosystem, and “orchestrates” the network requests between the user, generative models, and detector servers. |
| 15 | + |
| 16 | +Configure and use the built-in detectors:: |
| 17 | +The Guardrails framework provides a set of “built-in” detectors out-of-the-box, that provides a number of simple detection algorithms. You can use the following detector with trustyai_fms: |
| 18 | ++ |
13 | 19 | * *Regex Detectors*: Pattern-based content detection for structured rule enforcement. These are the built-in detectors in the Guardrails Orchestrator service. Learn more about the link:https://github.com/trustyai-explainability/guardrails-regex-detector[guardrails-regex-detector]. |
14 | 20 |
|
15 | | -* *Hugging Face Detectors*: Compatible with most Hugging Face `AutoModelForSequenceClassification` models, such as `granite-guardian-hap-38m` or `deberta-v3-base-prompt-injection-v2`. Learn more about the detector algorithms for the link:https://github.com/trustyai-explainability/guardrails-detectors[FMS Guardrails Orchestrator]. |
16 | 21 |
|
| 22 | +Use Hugging Face models as detectors in Guardrails Orchestrator:: |
| 23 | +Any text classification model from link:https://huggingface.co/ibm-granite/granite-guardian-hap-38m[Huggingface] can be used as a detector model within the Guardrails ecosystem. |
| 24 | ++ |
| 25 | +* *Hugging Face Detectors*: Compatible with most Hugging Face `AutoModelForSequenceClassification` models, such as `granite-guardian-hap-38m` or `deberta-v3-base-prompt-injection-v2`. Learn more about the detector algorithms for the link:https://github.com/trustyai-explainability/guardrails-detectors[FMS Guardrails Orchestrator]. |
17 | 26 | * *vLLM Detector Adapter*: Content detection compatible with Hugging Face `AutoModelForCausalLM` models, for example `ibm-granite/granite-guardian-3.1-2b`. Learn more about link:https://github.com/foundation-model-stack/vllm-detector-adapter[vllm-detector-adapter]. |
18 | 27 |
|
19 | | -The following sections describe how to deploy Guardrails Orchestrator and provide example use cases: |
| 28 | +Configure and use the guardrails gateway:: |
| 29 | +The optional Guardrails Gateway lets you create preset guardrailing pipelines that can be interacted with via /chat/completions endpoints. |
20 | 30 |
|
21 | | -* Deploy a Guardrails Orchestrator instance |
22 | | -* Monitor user-inputs to your LLM |
23 | | -* Configure and use the built-in detectors |
24 | | -* Configure and use the guardrails gateway |
25 | | -* Enable the OpenTelemetry exporter for metrics and tracing |
26 | | -* Use Hugging Face models as detectors in Guardrails Orchestrator |
| 31 | +*Monitor user-inputs to your LLM* |
| 32 | +Enable a safer LLM by filtering hateful, profane, or toxic inputs. |
27 | 33 |
|
| 34 | +*Enable the OpenTelemetry exporter for metrics and tracing* |
| 35 | +Provide observability for the security and governance mechanisms of AI applications. |
28 | 36 |
|
| 37 | +== Deploying and Configuring Guardrails components |
| 38 | +Set up the Orchestrator, Detectors, and Gateway. |
29 | 39 |
|
30 | 40 | include::modules/deploying-the-guardrails-orchestrator-service.adoc[leveloffset=+1] |
31 | 41 | include::modules/auto-configuring-guardrails.adoc[leveloffset=+1] |
32 | 42 | include::modules/guardrails-orchestrator-parameters.adoc[leveloffset=+1] |
33 | | -include::modules/guardrails-orchestrator-hap-scenario.adoc[leveloffset=+1] |
34 | 43 | include::modules/guardrails-detectors.adoc[leveloffset=+1] |
| 44 | +include::modules/configuring-the-built-in-detector-and-guardrails-gateway.adoc[leveloffset=+2] |
35 | 45 | include::modules/configuring-the-guardrails-detector-hugging-face-serving-runtime.adoc[leveloffset=+2] |
36 | | -include::modules/using-a-hugging-face-prompt-injection-detector-with-the-guardrails-orchestrator.adoc[leveloffset=+2] |
37 | 46 | include::modules/using-hugging-face-models-with-guardrails-orchestrator.adoc[leveloffset=+2] |
38 | | -include::modules/configuring-the-built-in-detector-and-guardrails-gateway.adoc[leveloffset=+2] |
39 | | -include::modules/sending-requests-to-the-regex-detector.adoc[leveloffset=+2] |
40 | | -include::modules/guardrails-orchestrator-querying-using-guardrails-gateway.adoc[leveloffset=+2] |
41 | 47 | include::modules/configuring-the-opentelemetry-exporter.adoc[leveloffset=+1] |
42 | 48 |
|
| 49 | +== Using Guardrails for AI Safety |
| 50 | +Use the Guardrails tools to ensure the safety and security of your generative AI applications in production. |
| 51 | + |
| 52 | +include::modules/guardrails-orchestrator-hap-scenario.adoc[leveloffset=+1] |
| 53 | +include::modules/using-a-hugging-face-prompt-injection-detector-with-the-guardrails-orchestrator.adoc[leveloffset=+1] |
| 54 | +include::modules/filtering-flagged-content-by-sending-requests-to-the-regex-detector.adoc[leveloffset=+2] |
| 55 | +include::modules/enforcing-configured-safety-pipelines-for-llm-inference-using-guardrails-gateway.adoc[leveloffset=+1] |
| 56 | + |
| 57 | + |
| 58 | + |
43 | 59 |
|
44 | 60 | ifdef::parent-context[:context: {parent-context}] |
45 | 61 | ifndef::parent-context[:!context:] |
0 commit comments