Using Llama Guard 3 8B on Replicate API
Implementation guide · Llama Guard · AI at Meta
Replicate API exposes Llama Guard 3 8B through model ID meta/llama-guard-3-8b. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.
Last refreshed 2026-07-09. Next refresh: weekly.
Quick Start
- 1
- 2Use the Replicate API SDK or REST API to call
meta/llama-guard-3-8b— see the documentation for request format. - 3
Code Examples
pip install replicateREPLICATE_API_TOKENmeta/llama-guard-3-8bReplicate uses "owner/model-name" format (e.g. "meta/meta-llama-3-8b-instruct") for the latest version, or "owner/model-name:version-sha" to pin to a specific version. The REST endpoint splits owner and model-name into the path: /v1/models/{owner}/{model-name}/predictions.
import replicate
# reads REPLICATE_API_TOKEN from env
# meta/llama-guard-3-8b format: "owner/model-name" (latest version) or "owner/model-name:version-hash"
output = replicate.run(
"meta/llama-guard-3-8b",
input={"prompt": "Hello"}
)
# Output is a list or generator depending on the model
print("".join(output))Pricing on Replicate API
| Type | Price (per 1M) |
|---|---|
| Input tokens | $0.30 |
| Output tokens | $0.30 |
Capabilities
About Llama Guard 3 8B
Llama Guard 3 8B is a specialized large language model developed by Meta for content safety classification. Fine-tuned from Llama 3.1, this 8-billion parameter model excels in moderation tasks, classifying both inputs and outputs across 14 hazard categories based on the MLCommons taxonomy. It supports multiple languages, including English, French, German, Hindi, Italian, Portuguese, Spanish, and Thai. Designed for AI engineers focusing on safe and responsible AI systems, Llama Guard 3 offers improved accuracy and reduced false positive rates in identifying unsafe content, making it a valuable tool for developing robust content moderation systems in conversational AI applications .