We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience and analyze website traffic…

🚀 New models by Bria.ai, generate and edit images at scale 🚀

meta-llama logo

meta-llama/

Llama-Guard-4-12B

$0.18

/ 1M tokens

Llama Guard 4 is a natively multimodal safety classifier with 12 billion parameters trained jointly on text and multiple images. Llama Guard 4 is a dense architecture pruned from the Llama 4 Scout pre-trained model and fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM inputs (prompt classification) and in LLM responses (response classification). It itself acts as an LLM: it generates text in its output that indicates whether a given prompt or response is safe or unsafe, and if unsafe, it also lists the content categories violated.

Deploy Private Endpoint
Public
bfloat16
163,840
Multimodal
ProjectLlama
meta-llama/Llama-Guard-4-12B cover image

OpenAI-compatible HTTP API

You can POST to our OpenAI Chat Completions compatible endpoint.

Passing a url to an image is the easiest way to perform OCR.

curl "https://api.deepinfra.com/v1/openai/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPINFRA_TOKEN" \
  -d '{
      "model": "meta-llama/Llama-Guard-4-12B",
      "max_tokens": 4092,
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://url.com/to/shakespeare.png"
              }
            }
          ]
        }
      ]
    }'
copy

Another options is to read the image from a file


BASE64_IMAGE=$(base64 -w 0 shakespeare.png)

curl "https://api.deepinfra.com/v1/openai/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPINFRA_TOKEN" \
  -d @- <<EOF
{
  "model": "meta-llama/Llama-Guard-4-12B",
  "max_tokens": 4092,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,$BASE64_IMAGE"
          }
        }
      ]
    }
  ]
}
EOF

copy

Input fields

Input Schema

Output Schema

Streaming Schema