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
3 changes
1) moved configuration first, before supported model types
2) moved note about llamaguard to llamaguard section
3) added link to workers ai dashboard
Copy file name to clipboardExpand all lines: src/content/docs/ai-gateway/guardrails/set-up-guardrail.mdx
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,6 @@ sidebar:
5
5
order: 3
6
6
---
7
7
8
-
## Supported model types
9
-
10
-
AI Gateway's Guardrails detects the type of AI model being used and applies safety checks accordingly:
11
-
12
-
-**Text generation models**: Both prompts and responses are evaluated.
13
-
-**Embedding models**: Only the prompt is evaluated, as the response consists of numerical embeddings, which are not meaningful for moderation.
14
-
-**Unknown models**: If the model type cannot be determined, only the prompt is evaluated, while the response bypass Guardrails.
15
-
16
8
## Configuration
17
9
18
10
Within AI Gateway settings, you can customize Guardrails:
@@ -21,18 +13,27 @@ Within AI Gateway settings, you can customize Guardrails:
21
13
- Choose evaluation scope: Analyze user prompts, model responses, or both.
22
14
- Define hazard categories: Select categories like violence, hate, or sexual content and assign actions (ignore, flag, or block).
23
15
24
-
## Workers AI and Guardrails
16
+
## Supported model types
25
17
26
-
Guardrails currently uses [Llama Guard 3 8B](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) on [Workers AI](/workers-ai/) to perform content evaluations. The underlying model may be updated in the future, and we will reflect those changes within Guardrails.
18
+
AI Gateway's Guardrails detects the type of AI model being used and applies safety checks accordingly:
27
19
28
-
Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You can monitor usage through the Workers AI Dashboard.
20
+
-**Text generation models**: Both prompts and responses are evaluated.
21
+
-**Embedding models**: Only the prompt is evaluated, as the response consists of numerical embeddings, which are not meaningful for moderation.
22
+
-**Unknown models**: If the model type cannot be determined, only the prompt is evaluated, while the response bypass Guardrails.
29
23
30
-
## Additional considerations
24
+
## Workers AI and Guardrails
31
25
32
-
- Latency impact: Enabling Guardrails adds some latency. Consider this when balancing safety and speed.
26
+
Guardrails currently uses [Llama Guard 3 8B](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) on [Workers AI](/workers-ai/) to perform content evaluations. The underlying model may be updated in the future, and we will reflect those changes within Guardrails.
27
+
28
+
Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You can monitor usage through the [Workers AI Dashboard](https://dash.cloudflare.com/?to=/:account/ai/workers-ai).
33
29
34
30
:::note
35
31
32
+
36
33
Llama Guard is provided as-is without any representations, warranties, or guarantees. Any rules or examples contained in blogs, developer docs, or other reference materials are provided for informational purposes only. You acknowledge and understand that you are responsible for the results and outcomes of your use of AI Gateway.
37
34
38
35
:::
36
+
37
+
## Additional considerations
38
+
39
+
- Latency impact: Enabling Guardrails adds some latency. Consider this when balancing safety and speed.
0 commit comments