---
last_updated: 2026-11-20
source_url: https://opper.ai/meta/llama-guard-4-12b
title: "Llama Guard 4 12B by Meta"
description: "Meta Llama Guard 4 12B, a dense multimodal safety classifier that flags harmful content in text and image inputs and model outputs."
---

# Llama Guard 4 12B

By [Meta](https://opper.ai/meta).

Released 29 Apr 2025, 24 days after [Llama 4 Maverick 17B 128E Instruct](https://opper.ai/meta/llama-4-maverick-17b-128e-instruct) · [Announcement](https://ai.meta.com/blog/ai-defenders-program-llama-protection-tools/) · [All Meta releases](https://opper.ai/model-releases/meta)

Llama Guard 4 is a 12-billion-parameter safety classification model that detects harmful content in both model inputs and outputs. It is built by pruning the Llama 4 Scout foundation, keeping only the shared expert to give it a dense feedforward early-fusion architecture rather than a mixture-of-experts design, which lets it run on a single GPU with 24GB of VRAM.

The model classifies content against the hazard categories defined in the MLCommons taxonomy along with code interpreter abuse, covering areas such as violent crimes, sexual content, hate speech, self-harm, and intellectual property. It evaluates multilingual text and can process mixed text-and-image prompts, combining the capabilities of the earlier Llama Guard 3-8B and 3-11B-vision models into a single classifier with added multi-image support.

Meta reports that, compared to Llama Guard 3, version 4 improves English recall by about 4% and F1 by about 8%, with roughly 17 to 20% gains on multi-image detection. It is designed to safeguard multimodal Llama 4 applications while staying light enough for real-time prompt and response filtering.

## Available routes

Llama Guard 4 12B runs on 1 route through the Opper gateway. Prices are per 1M tokens. Its route also sells flex and priority processing: the same model at another price, picked per request with service_tier. [How service tiers work](https://docs.opper.ai/build/gateway/service-tiers). Its routes and prices, live from the catalogue, are public JSON with no API key needed at https://api.opper.ai/v3/models?q=deepinfra%2Fmeta-llama%2FLlama-Guard-4-12B.

| Provider | Model id | Region | Zero data retention | Training | Input | Output | Cache read |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [DeepInfra](https://opper.ai/provider/deepinfra) | `deepinfra/meta-llama/Llama-Guard-4-12B` | US (United States) | Yes | No | $0.18 | $0.18 | Input price |
| [DeepInfra](https://opper.ai/provider/deepinfra), Flex | `deepinfra:flex/meta-llama/Llama-Guard-4-12B` | US (United States) | Yes | No | $0.14 | $0.14 | $0.14 |
| [DeepInfra](https://opper.ai/provider/deepinfra), Priority | `deepinfra:priority/meta-llama/Llama-Guard-4-12B` | US (United States) | Yes | No | $0.27 | $0.27 | $0.27 |

## Key info

- Model id: `deepinfra/meta-llama/Llama-Guard-4-12B`
- Input: Text, Image
- Output: Text
- Features: Tools
- Context window: 164K
- Max output: 164K
- Input price: $0.18 per 1M tokens
- Output price: $0.18 per 1M tokens
- Released: 29 Apr 2025
- US residency available
- Zero data retention on pay-as-you-go
- No training by default

## Data handling per route

Each route hosting Llama Guard 4 12B has its own privacy posture, residency, and GDPR terms. Postures are maintained by Opper with a last-verification timestamp.

### DeepInfra — United States

Zero data retention: nothing is logged, held for abuse monitoring or used for training. No training on customer data. US; SCCs.

- Zero data retention: Yes. Nothing is logged, held for abuse monitoring or used for training.
- Training: No training on customer data.
- Logging: None
- Abuse monitoring: No classifier
- Transfer mechanism: SCCs

Verified by Opper on 2026-10-19.

## Get started

Call Llama Guard 4 12B through the Opper gateway with one API key. Opper is drop-in compatible with the OpenAI, Anthropic and Google AI SDKs.

Llama Guard 4 12B is a premium model on Opper. Sign up needs no credit card: you get an API key straight away and the free models work in the playground and the API. Add a card to use premium models, pay-as-you-go with no minimum.

### Set it up with your agent

Paste this into a coding agent like Claude Code, Cursor or Codex and it will wire up Opper for you:

```text
Use curl to download, read and follow: https://skills.opper.ai Call Llama Guard 4 12B
```

### Or call it directly

OpenAI:

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPPER_API_KEY,
  baseURL: "https://api.opper.ai/v3/compat",
});

const completion = await client.chat.completions.create({
  model: "deepinfra/meta-llama/Llama-Guard-4-12B",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);
```

Anthropic:

```javascript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.OPPER_API_KEY,
  baseURL: "https://api.opper.ai/v3/compat",
});

const message = await client.messages.create({
  model: "deepinfra/meta-llama/Llama-Guard-4-12B",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(message.content);
```

Gemini:

```javascript
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: process.env.OPPER_API_KEY,
  httpOptions: { baseUrl: "https://api.opper.ai/v3/compat" },
});

const response = await ai.models.generateContent({
  model: "deepinfra/meta-llama/Llama-Guard-4-12B",
  contents: "Hello",
});
console.log(response.text);
```

cURL:

```bash
curl https://api.opper.ai/v3/compat/chat/completions \
  -H "Authorization: Bearer $OPPER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepinfra/meta-llama/Llama-Guard-4-12B",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'
```

## Use Llama Guard 4 12B in your apps

Pick your tool to see how to run it on Llama Guard 4 12B through Opper.

- [Claude Code](https://opper.ai/apps/claude-code/llama-guard-4-12b)
- [Claude Cowork](https://opper.ai/apps/claude-cowork/llama-guard-4-12b)
- [Codex](https://opper.ai/apps/codex/llama-guard-4-12b)
- [DeepSeek Harness](https://opper.ai/apps/deepseek-harness/llama-guard-4-12b)
- [GitHub Copilot CLI](https://opper.ai/apps/github-copilot-cli/llama-guard-4-12b)
- [Aider](https://opper.ai/apps/aider/llama-guard-4-12b)
- [Goose](https://opper.ai/apps/goose/llama-guard-4-12b)
- [Droid](https://opper.ai/apps/droid/llama-guard-4-12b)
- [OpenCode](https://opper.ai/apps/opencode/llama-guard-4-12b)
- [Pi](https://opper.ai/apps/pi/llama-guard-4-12b)
- [OpenClaw](https://opper.ai/apps/openclaw/llama-guard-4-12b)
- [Hermes](https://opper.ai/apps/hermes/llama-guard-4-12b)
- [Copilot for Obsidian](https://opper.ai/apps/obsidian-copilot/llama-guard-4-12b)
- [OmniRoute](https://opper.ai/apps/omniroute/llama-guard-4-12b)
- [Cursor](https://opper.ai/apps/cursor/llama-guard-4-12b)
- [Cline](https://opper.ai/apps/cline/llama-guard-4-12b)
- [Continue](https://opper.ai/apps/continue/llama-guard-4-12b)
- [Kilo Code](https://opper.ai/apps/kilo-code/llama-guard-4-12b)
- [GitHub Copilot](https://opper.ai/apps/github-copilot/llama-guard-4-12b)
- [Zed](https://opper.ai/apps/zed/llama-guard-4-12b)
- [JetBrains AI Assistant](https://opper.ai/apps/jetbrains-ai-assistant/llama-guard-4-12b)
- [Voidleap Code](https://opper.ai/apps/voidleap-code/llama-guard-4-12b)
- [n8n](https://opper.ai/apps/n8n/llama-guard-4-12b)
- [LibreChat](https://opper.ai/apps/librechat/llama-guard-4-12b)
- [Open WebUI](https://opper.ai/apps/open-webui/llama-guard-4-12b)
- [See all apps](https://opper.ai/apps)

## Other models from Meta

- [Muse Spark 1.3](https://opper.ai/meta/muse-spark-1-3)
- [Muse Spark Open](https://opper.ai/meta/muse-spark-open)
- [Muse Spark 1.2](https://opper.ai/meta/muse-spark-1-2)
- [Llama 3.3 70B](https://opper.ai/meta/llama-3-3-70b-instruct)
- [Llama 3.3 70B Instruct FP8](https://opper.ai/meta/llama-3-3-70b-instruct-fp8)
- [Llama 3.1 8B Instruct](https://opper.ai/meta/llama-3-1-8b-instruct)
