LlamaGuard 2 8B

This safeguard model has 8B parameters and is based on the Llama 3 family. Just like is predecessor, [LlamaGuard 1](https://huggingface.co/meta-llama/LlamaGuard-7b), it can do both prompt and response classification. LlamaGuard 2 acts as a normal LLM would, generating text that indicates whether the given input/output is safe/unsafe. If deemed unsafe, it will also share the content categories violated. For best results, please use raw prompt input or the `/completions` endpoint, instead of the chat API. It has demonstrated strong performance compared to leading closed-source models in human evaluations. To read more about the model release, [click here](https://ai.meta.com/blog/meta-llama-3/). Usage of this model is subject to [Meta's Acceptable Use Policy](https://llama.meta.com/llama3/use-policy/).

by Meta

Overview

Quick stats across all benchmark runs.

Score

2 benchmarks

Avg Latency

1.6s

2 requests

Pricing

$0.20 in / $0.20 out

per 1M tokens

Context

8K

tokens

Alternatives

Models with similar or better quality but different tradeoffs

No alternatives found

Run benchmarks on this model to discover alternatives

Benchmark Performance

How this model performs across different benchmarks

No benchmark data available

Run benchmarks with this model to see performance breakdown

Price vs Performance

Compare cost efficiency across all models

Current model (baseline)
Other models (relative score)
Y-axis shows score difference from shared benchmarks. X-axis uses log scale.

Score Over Time

Performance trends across all benchmark runs

Benchmark Activity

Number of benchmark runs over time

Get started with this model using OpenRouter

import { OpenRouter } from "@openrouter/sdk";

const openrouter = new OpenRouter({
  apiKey: "<OPENROUTER_API_KEY>"
});

const completion = await openrouter.chat.completions.create({
  model: "meta-llama/llama-guard-2-8b",
  messages: [
    {
      role: "user",
      content: "Hello!"
    }
  ]
});

console.log(completion.choices[0].message.content);

Get your API key at openrouter.ai/keys

Other Models from Meta

Compare performance with other models from the same creator

ModelLatencyCost/1MScore
Llama 3.2 1B Instruct30.8s$0.1142%
Llama 3.3 70B Instruct20.5s$0.2141%
Llama 4 Maverick4.7s$0.3838%
Llama 4 Scout6.6s$0.1938%
Llama 3.2 3B Instruct31.0s$0.190%
Llama Guard 3 8B6.6s$0.26
Llama 3.1 70B Instruct14.5s$0.40
Llama 3.2 90B Vision Instruct$0.38
Llama Guard 4 12B513ms$0.18
Llama 3.1 8B Instruct23.7s$0.03
Llama 3 70B Instruct20.1s$0.63
Llama 3 8B Instruct8.8s$0.04
Llama 3.2 11B Vision Instruct44.8s$0.24
Llama 3.1 405B InstructFree
Llama 3.1 405B (base)39.5s$4.00