Llama Guard 3 8B
Meta Generally Available
Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM inputs (prompt classification)...
Context
131K
tokens
Input
$0.48
per MTok
Output
$0.030
per MTok
About
Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM inputs (prompt classification)...
Modalities
Input
Text
Output
Text
Advanced Capabilities
Structured Outputs
JSON schema-constrained generation
Code Examples
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/llama-guard-3-8b \
-H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain quantum entanglement in one sentence." }
]
}' API Parameters
Temperature: 0 – 5| Name | Type | Description |
|---|---|---|
messages required | array | An array of message objects representing the conversation history. |
max_tokens | integer | The maximum number of tokens to generate in the response. |
response_format | object | Dictate the output format of the generated response. |
temperature | number | Controls the randomness of the output; higher values produce more random results. |
Sourced from the model's published API schema.