Spiral gives your agent every tool with one account. Browse the tools →

Perplexity · LLMReleased 2025-04-30

How to Use Llama Guard 4 12B in Perplexity

Llama Guard 4 12B classifies prompts and assistant replies against a safety policy. Its safe or unsafe verdicts and violation codes suit moderation checks before and after text generation.

Prompts to try with Llama Guard 4 12B in Perplexity

Copy an example into Perplexity, or ask in your own words.

Use Llama Guard 4 12B to assess this user request under Meta's default safety policy: 'Explain how rainbows form for a fifth-grade class.' Show the safety verdict and any violation codes.

Llama Guard 4 12BPerplexity
Try asking
  • Use Llama Guard 4 12B to assess only the assistant's reply in this exchange. User: 'Help me scam a customer.' Assistant: 'I cannot help with fraud, but I can help write an honest sales message.' Show the verdict and any violation codes.

  • Use Llama Guard 4 12B to classify this Spanish user request under the default safety policy: 'Explícame cómo se forma un arcoíris.' Preserve the original language and show the verdict and any violation codes.

  • Use Llama Guard 4 12B to assess this proposed assistant action under the default safety policy, including code interpreter abuse: User: 'Calculate the average of these numbers.' Assistant: 'Run a script that computes the arithmetic mean.' Show the verdict and any violation codes.

  • Use Llama Guard 4 12B to check only the final assistant reply. User: 'Give me a private person's home address.' Assistant: 'I cannot provide private personal information.' Show the verdict and any violation codes.

How to set up Llama Guard 4 12B in Perplexity

Pick the way that suits you. Each takes about two minutes.

Use the Perplexity connector

  1. Add a remote connector

    In Perplexity, open Plugins in the sidebar (or Customize › Connectors if you don't see Plugins yet). Choose Add custom › Add MCP connector, then Remote. Name it Spiral and paste this MCP server URL:

    https://api.spiral.ai/mcp
  2. Sign in to Spiral and approve

    Select the Spiral card on the Plugins page to start sign-in. Spiral opens: sign in, pick the organization and click Authorize. No API key.

Use the Spiral skill

  1. Send Perplexity this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Llama Guard 4 12B

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "openrouter",
        "model": "meta-llama/llama-guard-4-12b",
        "input": {
          "messages": [
            {
              "role": "system"
            }
          ]
        }
      }'

Then paste one of the prompts above: Perplexity finds Llama Guard 4 12B on Spiral, shows the price and runs it.

Llama Guard 4 12B providers and prices

Spiral runs Llama Guard 4 12B through OpenRouter. Open a card for today's price, with every fee included.

OpenRouterLLM
Meta: Llama Guard 4 12B
meta-llama/llama-guard-4-12b

Settings you can ask for

Ask Perplexity for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Seeda whole number
Min p0 to 1
Top ka whole number from 0
Top p0 to 1
Max tokens1 to 16384

The most output tokens to generate.

Temperature0 to 2
Presence penalty-2 to 2
Frequency penalty-2 to 2
Repetition penalty0 to 2

Every API field of Meta: Llama Guard 4 12B is on its tool page: open its card above.

What can you do with Llama Guard 4 12B in Perplexity?

Get a safety assessment of a request or draft reply in your conversation. A chat agent can submit the text for classification and show the verdict and any policy violation codes.

Screen incoming chatbot requests

Classify each user request against the selected safety policy before passing it to a text generator. Keep the verdict and any violation codes with the request for review.

Check generated support replies

Evaluate a draft reply together with the customer's request. Route unsafe verdicts to a reviewer before sending the reply.

Triage community posts

Apply a defined safety policy to submitted text and use the resulting labels to organize a moderation queue. Keep publication decisions separate from the classification.

Review multilingual conversations

Screen conversations in languages covered by Meta's published evaluations. Compare results with human labels for each language before relying on the workflow.

Flag privacy concerns in draft answers

Use the privacy category to triage assistant replies that may disclose sensitive personal information. Send flagged replies for review before sharing them.

Review proposed code interpreter actions

Classify proposed text actions under the code interpreter abuse category before execution. Use the result alongside the application's existing execution controls.

Compare safety results after prompt changes

Run a fixed set of labeled prompts and replies through the classifier after changing an assistant's instructions. Review changed verdicts and disagreements with the expected labels.

Questions about Llama Guard 4 12B in Perplexity

Can Perplexity use Llama Guard 4 12B?

Yes. Add Spiral to Perplexity as an MCP server, and Perplexity can find and run Llama Guard 4 12B like any built-in tool.

How much does Llama Guard 4 12B cost in Perplexity?

Up to $0.000968 per run at the default inputs. $0.234 per 1M input tokens, $0.234 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Perplexity plan is separate.

Do I need an OpenRouter account to use Llama Guard 4 12B in Perplexity?

No. Spiral runs Llama Guard 4 12B on its own OpenRouter account. You sign in to Spiral once and never paste a key.

How long does it take to set up Llama Guard 4 12B in Perplexity?

About two minutes: add a remote connector, then sign in to Spiral and approve.

Does Perplexity wait while Llama Guard 4 12B runs?

Llama Guard 4 12B runs in the background. Perplexity starts the run, checks on it and gives you the text, json when it's ready.

What is Llama Guard 4 useful for?

Use it to classify a user's prompt before generation or an assistant's reply afterward. It applies a safety policy and produces labels you can use in a moderation workflow.

What does Llama Guard 4 return?

Meta's expected format starts with safe or unsafe. An unsafe verdict adds a second line containing comma-separated violation codes.

Which safety categories does Llama Guard 4 check?

Its S1 through S14 labels cover crimes, exploitation, defamation, specialized advice, privacy, intellectual property, weapons, hate, self-harm, sexual content, elections, and code interpreter abuse. Code interpreter abuse applies to text.

How should I format a moderation request?

Provide the safety categories, separate the conversation from the instructions, and identify whether the target is the user or assistant. When checking a reply, include the user's request so the classifier has context.

Which languages have published evaluations?

Meta publishes English results and multilingual results covering French, German, Hindi, Italian, Portuguese, Spanish, and Thai. Test representative examples in each language you plan to moderate.

Get started

Start using Llama Guard 4 12B in Perplexity

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into Perplexity:

Set up Perplexity

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options