Model
Llama Guard 4 evaluates text against a predefined taxonomy of unsafe content categories: violence, sexual content, hate speech, self-harm, criminal activity, and more. It returns a structured verdict you can use for automated decisions.
Classify a single message
safe or unsafe followed by the violated category (e.g., unsafe\nS1 for violence-related content).
Moderation middleware
Build a reusable moderation function for your app:Next steps
- Route between AI models — run moderation with Llama Guard, then route safe content to a generation model.
- Build an AI SaaS backend — full production backend with moderation, chat, and structured output.
- Model catalog — browse all available models.