Skip to content

Commit 7669722

Browse files
committed
Style/consistency updates from preview inspection
1 parent 80a578c commit 7669722

11 files changed

+103
-131
lines changed

assemblies/enabling-ai-safety-with-guardrails.adoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@ Enable the OpenTelemetry exporter for metrics and tracing::
3333
Provide observability for the security and governance mechanisms of AI applications.
3434

3535
include::modules/guardrails-orchestrator-detectors.adoc[leveloffset=+1]
36-
include::modules/guardrails-configuring-the-hugging-face-detector-serving-runtime.adoc[leveloffset=+2]
37-
include::modules/guardrails-orchestrator-configmap-parameters.adoc[leveloffset=+1]
38-
include::modules/guardrails-gateway-config-parameters.adoc[leveloffset=+1]
39-
include::modules/guardrails-deploying-the-guardrails-orchestrator-service.adoc[leveloffset=+1]
40-
include::modules/guardrails-auto-config.adoc[leveloffset=+1]
41-
4236

4337
[role='_additional-resources']
4438
.Additional resources
4539
ifndef::upstream[]
46-
* To learn how to use the built-in detectors with `trustyai_fms` orchestrator server external provider for Llama Stack to detect PII, see link:{rhoaidocshome}{default-format-url}/monitoring_data_science_models#detecting-pii-by-using-guardrails-with-llama-stack[Adding a model server to your data science project].
40+
* To learn how to use the built-in detectors with `trustyai_fms` orchestrator server external provider for Llama Stack to detect PII, see link:{rhoaidocshome}{default-format-url}/monitoring_data_science_models#detecting-pii-by-using-guardrails-with-llama-stack[Detecting personally identifiable information (PII) by using Guardrails with Llama Stack].
4741
endif::[]
48-
include::modules/guardrails-filtering-flagged-content-by-sending-requests-to-the-regex-detector.adoc[leveloffset=+1]
49-
include::modules/guardrails-using-hugging-face-models-with-guardrails-orchestrator.adoc[leveloffset=+1]
42+
43+
include::modules/guardrails-configuring-the-hugging-face-detector-serving-runtime.adoc[leveloffset=+2]
44+
include::modules/guardrails-orchestrator-configmap-parameters.adoc[leveloffset=+1]
45+
include::modules/guardrails-gateway-config-parameters.adoc[leveloffset=+1]
46+
include::modules/guardrails-deploying-the-guardrails-orchestrator-service.adoc[leveloffset=+1]
47+
include::modules/guardrails-auto-config.adoc[leveloffset=+1]
5048
include::modules/guardrails-configuring-the-opentelemetry-exporter.adoc[leveloffset=+1]
5149

5250

assemblies/using-guardrails-for-ai-safety.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Use the Guardrails tools to ensure the safety and security of your generative AI
77

88
== Detecting PII and sensitive data
99
include::modules/detecting-pii-by-using-guardrails-with-llama-stack.adoc[leveloffset=+1]
10-
include::modules/filtering-flagged-content-by-sending-requests-to-the-regex-detector.adoc[leveloffset=+1]
10+
include::modules/guardrails-filtering-flagged-content-by-sending-requests-to-the-regex-detector.adoc[leveloffset=+1]
1111

1212
== Securing prompts
1313
include::modules/mitigating-prompt-injection-by-using-a-hugging-face-prompt-injection-detector.adoc[leveloffset=+1]
1414

1515
== Moderating and safeguarding content
1616
include::modules/detecting-hateful-and-profane-language.adoc[leveloffset=+1]
17-
include::modules/enforcing-configured-safety-pipelines-for-llm-inference-using-guardrails-gateway.adoc[leveloffset=+1]
17+
include::modules/guardrails-enforcing-configured-safety-pipelines-for-llm-inference-using-guardrails-gateway.adoc[leveloffset=+1]
1818

1919
ifdef::parent-context[:context: {parent-context}]
2020
ifndef::parent-context[:!context:]

modules/guardrails-auto-config.adoc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ spec:
4343
+
4444
* `inferenceServiceToGuardrail`: Specifies the name of the vLLM inference service to protect with Guardrails.
4545
* `detectorServiceLabelToMatch`: Specifies the label that you applied to each of your detector servers in the `metadata.labels` specification for the detector. The Guardrails Orchestrator `ConfigMap` automatically updates to reflect detectors in your namespace that match the label set in the `detectorServiceLabelToMatch` field.
46-
46+
+
4747
If `enableGuardrailsGateway` is true, a template Guardrails gateway config called `<ORCHESTRATOR_NAME>-gateway-auto-config` is generated. You can modify this file to tailor
4848
your Guardrails Gateway setup as desired. The Guardrails Orchestrator automatically deploys when changes are detected. Once modified, the label `trustyai/has-diverged-from-auto-config` is applied. To revert the file back to the auto-generated starting point, simply delete it and the original auto-generated file is recreated.
49-
49+
+
5050
If `enableBuiltInDetectors` is true, the built-in detector server is automatically added to your orchestrator configuration under the same `built-in-detector`, and a sample configuration is included in the auto-generated guardrails gateway config if desired.
5151

52-
53-
54-
55-
5652
. Deploy the orchestrator custom resource. This step creates a service account, deployment, service, and route object in your namespace.
5753
+
5854
[source,terminal]
@@ -61,7 +57,7 @@ oc apply -f guardrails_orchestrator_auto_cr.yaml -n <your_namespace>
6157
----
6258

6359
.Verification
64-
You can verify that the `GuardrailsOrchestrator` CR and corresponding automatically generated configuration objects were successfully created in your namespace by running the following commands:
60+
You can verify that the `GuardrailsOrchestrator` CR and corresponding automatically-generated configuration objects were successfully created in your namespace by running the following commands:
6561

6662
. Confirm that the `GuardrailsOrchestrator` CR was created:
6763
+
@@ -77,7 +73,7 @@ $ oc get guardrailsorchestrator -n <your_namespace>
7773
$ oc get configmap -n <your_namespace> | grep auto-config
7874
----
7975

80-
. You can then view the automatically generated config:
76+
. You can then view the automatically generated configmap:
8177
+
8278
[source,terminal]
8379
----

modules/guardrails-configuring-the-hugging-face-detector-serving-runtime.adoc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,12 @@ spec:
5757
- containerPort: 8000
5858
protocol: TCP
5959
----
60+
+
6061
The above serving runtime example matches the default template used with {productname-long}, and should suffice
61-
for the majority of use-cases. The main relevant configuration parameter is the `SAFE_LABELS` environment variable,
62-
which specifies which prediction label(s) from the `AutoModelForSequenceClassification` constitute a "safe" response and thus
63-
should not trigger guardrailing. For example, if `[0, 1]` is specified as `SAFE_LABELS`
64-
for a four-class model, a predicted label of `0` or `1` will be considered "safe", while a predicted label
65-
of `2` or `3` will trigger guardrailing. The default value is `[0]`.
62+
for the majority of use-cases. The main relevant configuration parameter is the `SAFE_LABELS` environment variable. This specifies which prediction label or labels from the `AutoModelForSequenceClassification` constitute a "safe" response and therefore should not trigger guardrailing. For example, if `[0, 1]` is specified as `SAFE_LABELS`
63+
for a four-class model, a predicted label of `0` or `1` is considered "safe", while a predicted label of `2` or `3` triggers guardrailing. The default value is `[0]`.
6664

67-
The following tables describe configuration values for the Guardrails Detector Hugging Face serving runtime:
65+
== Guardrails Detector Hugging Face serving runtime configuration values
6866

6967
.Template configuration
7068
[cols="2,5"]
@@ -148,8 +146,6 @@ The following tables describe configuration values for the Guardrails Detector H
148146
|===
149147

150148

151-
152-
153149
.Parameters for API endpoints
154150
[cols="3,2,3,2,3a"]
155151
|===

modules/guardrails-configuring-the-opentelemetry-exporter.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ kind: GuardrailsOrchestrator
2222
metadata:
2323
name: gorch-test
2424
spec:
25-
orchestratorConfig: "fms-orchestr8-config-nlp" <1>
25+
orchestratorConfig: "fms-orchestr8-config-nlp"
2626
replicas: 1
2727
otelExporter:
2828
protocol: "http"
2929
otlpEndpoint: "localhost:4318"
3030
otlpExport: "metrics"
3131
----
32-
<1> This references the config map that was created in Step 1 of "Deploying the Guardrails Orchestrator service".
32+
+
33+
* `orchestratorConfig`: This references the config map that was created in Step 1 of "Deploying the Guardrails Orchestrator service".
3334

3435
. Deploy the orchestrator custom resource:
3536
+

modules/guardrails-deploying-the-guardrails-orchestrator-service.adoc

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ endif::[]
3939
$ oc apply -f <orchestrator_configmap>.yaml -n <namespace>
4040
----
4141

42-
. (optionally) Deploy your Guardrails gateway config map:
42+
. Optional: Deploy your Guardrails gateway config map:
4343
+
4444
[source,terminal]
4545
----
4646
$ oc apply -f <gateway_configmap>.yaml -n <namespace>
4747
----
48-
. Create a Guardrails Orchestrator custom resource. Make sure that `orchestratorConfig` and `guardrailsGatewayConfig` matches the names of the resources you created in steps 1 and 2.
48+
. Create a Guardrails Orchestrator custom resource. Make sure that the `orchestratorConfig` and `guardrailsGatewayConfig` match the names of the resources you created in steps 1 and 2.
4949
+
5050
.Example `orchestrator_cr.yaml` CR
5151
[source,yaml]
@@ -55,39 +55,40 @@ kind: GuardrailsOrchestrator
5555
metadata:
5656
name: guardrails-orchestrator-sample
5757
spec:
58-
orchestratorConfig: <NAME OF ORCHESTRATOR CONFIGMAP>
59-
guardrailsGatewayConfig: <NAME OF GUARDRAILS GATEWAY CONFIGMAP>
60-
customDetectorsConfig: <NAME OF CUSTOM DETECTORS CONFIG>
58+
orchestratorConfig: <orchestrator_configmap>
59+
guardrailsGatewayConfig: <guardrails_gateway_configmap>
60+
customDetectorsConfig: <custom_detectors_config>
6161
autoConfig:
62-
- <AUTO CONFIG SETTINGS>
62+
- <auto_config_settings>
6363
enableBuiltInDetectors: True
6464
enableGuardrailsGateway: True
6565
logLevel: INFO
6666
tlsSecrets:
67-
- <TLS SECRET 1 TO MOUNT>
67+
- <tls_secret_1_to_mount>
6868
- ...
69-
- <TLS SECRET 2 TO MOUNT>
69+
- <tls_secret_2_to_mount>
7070
otelExporter:
71-
- <OPEN TELEMETRY CONFIG>
71+
- <open_telemetry_config>
7272
replicas: 1
7373
----
7474
+
75-
If desired, the TrustyAI controller can automatically generate an orchestratorConfig and guardrailsGatewayConfig based on the available resources in your namespace.
76-
To access this, include the `autoConfig` parameter inside your Custom Resource, and consult <<guardrails-auto-config_{context}, Auto Configuring Guardrails>> for documentation on its usage.
75+
If desired, the TrustyAI controller can automatically generate an `orchestratorConfig` and `guardrailsGatewayConfig` based on the available resources in your namespace.
76+
To access this, include the `autoConfig` parameter inside your Custom Resource, and see _Auto Configuring Guardrails_ for documentation on its usage.
7777
+
78+
.Parameters from example `orchestrator_cr.yaml` CR
7879
[cols="1,2a", options="header"]
7980
|===
8081
| Parameter |Description
8182
| *`orchestratorConfig`* *(optional)*|The name of the `ConfigMap` object that contains generator, detector, and chunker arguments. If using `autoConfig`, this field can be omitted.
82-
|`guardrailsGatewayConfig` *(optional)*| The name of the ConfigMap object that specifies gateway configurations. This field can be omitted if you do not wish to use the Guardrails Gateway or are using `autoConfig`.
83+
|`guardrailsGatewayConfig` *(optional)*| The name of the ConfigMap object that specifies gateway configurations. This field can be omitted if you are not using the Guardrails Gateway or are using `autoConfig`.
8384
|`customDetectorsConfig` *(optional)*| This feature is in development preview.
84-
| `autoConfig` *(optional)* | A list of paired name and value arguments to define how the Guardrails AutoConfig. Any manually-specified configuration files in `orchestratorConfig` or `guardrailsGatewayConfig` will take precedence over the automatically-generated configuration files.
85+
| `autoConfig` *(optional)* | A list of paired name and value arguments to define how the Guardrails AutoConfig. Any manually-specified configuration files in `orchestratorConfig` or `guardrailsGatewayConfig` takes precedence over the automatically-generated configuration files.
8586

86-
* `inferenceServiceToGuardrail` - The name of the inference service you wish to guardrail. This should exactly match the model name provided when deploying the model. For a list of valid names, you can run
87+
* `inferenceServiceToGuardrail` - The name of the inference service you want to guardrail. This should exactly match the model name provided when deploying the model. For a list of valid names, you can run
8788
`oc get isvc -n $NAMESPACE`
88-
* `detectorServiceLabelToMatch` - A string label to use when searching for available detector servers. All inference services in your namespace with the label `$detectorServiceLabelToMatch: true` will be automatically configured as a detector.
89+
* `detectorServiceLabelToMatch` - A string label to use when searching for available detector servers. All inference services in your namespace with the label `$detectorServiceLabelToMatch: true` is automatically configured as a detector.
8990
+
90-
See <<guardrails-auto-config_{context}, Auto Configuring Guardrails>>for more information.
91+
See _Auto Configuring Guardrails_ for more information.
9192

9293
|`enableBuiltInDetectors` *(optional)*| A boolean value to inject the built-in detector sidecar container into the orchestrator pod. The built-in detector is a lightweight HTTP server containing a number of available guardrailing algorithms.
9394
|`enableGuardrailsGateway` *(optional)*| A boolean value to enable controlled interaction with the orchestrator service by enforcing stricter access to its exposed endpoints. It provides a mechanism of configuring detector pipelines, and then provides a unique `/v1/chat/completions` endpoint per configured detector pipeline.
@@ -101,8 +102,8 @@ See <<guardrails-auto-config_{context}, Auto Configuring Guardrails>>for more in
101102
+
102103
| `logLevel` *(optional)* | The log level to be used in the Guardrails Orchestrator- available values are `Error`, `Warn`, `Info` (default), `Debug`, and `Trace`.
103104
[[tlsSecrets-param]]
104-
| `tlsSecrets` *(optional)* | A list of names of `Secret` objects to mount to the Guardrails Orchestrator container. All secrets provided here will be mounted into the directory `/etc/tls/$SECRET_NAME` for use in your orchestrator config TLS configuration. We recommend that each secret contain a `tls.crt` and a `tls.key` field.
105-
|*`replicas`*| The number of orchestrator pods to create.
105+
| `tlsSecrets` *(optional)* | A list of names of `Secret` objects to mount to the Guardrails Orchestrator container. All secrets provided here are mounted into the directory `/etc/tls/$SECRET_NAME` for use in your orchestrator config TLS configuration. Each secret should contain a `tls.crt` and a `tls.key` field.
106+
|`replicas`| The number of orchestrator pods to create.
106107
|===
107108

108109
. Deploy the orchestrator CR, which creates a service account, deployment, service, and route object in your namespace:

modules/guardrails-filtering-flagged-content-by-sending-requests-to-the-regex-detector.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ifdef::context[:parent-context: {context}]
88
You can use the Guardrails Orchestrator API to send requests to the regex detector. The regex detector filters conversations by flagging content that matches specified regular expression patterns.
99

1010
.Prerequisites
11-
You have deployed a Guardrails Orchestrator with the built-in-detector server, e.g.:
11+
You have deployed a Guardrails Orchestrator with the built-in-detector server, such as in the following example:
1212

1313
.Example `guardrails_orchestrator_auto_cr.yaml` CR
1414
[source,yaml]

0 commit comments

Comments
 (0)