LLM ReferenceLLM Reference
Replicate API

Llama Guard 4 12B on Replicate API

Llama Guard · AI at Meta

ServerlessOpen Source

Last refreshed 2026-04-19. Next refresh: weekly.

Why use Llama Guard 4 12B on Replicate API?

Replicate API offers Llama Guard 4 12B with pay-as-you-go pricing at $0.20/1M input tokens. Replicate is a cloud-based platform that enables users to run machine learning models easily and efficiently.

Compare Llama Guard 4 12B across 3 providers to find the best fit for your use case
Input / 1M
$0.20
Output / 1M
$0.20
Cache
Not sourced
Batch
Not sourced

Setup recipe

Python + curl
Install
pip install replicate
Auth
export REPLICATE_API_TOKEN=...
Call
import replicate
output = replicate.run(
    "llama-guard-4-12b",
    input={"prompt": "Hello"}
Model ID
llama-guard-4-12b

Request example

import replicate

# reads REPLICATE_API_TOKEN from env
# llama-guard-4-12b format: "owner/model-name" (latest version) or "owner/model-name:version-hash"
output = replicate.run(
    "llama-guard-4-12b",
    input={"prompt": "Hello"}
)
# Output is a list or generator depending on the model
print("".join(output))

Gotchas

  • Replicate uses "owner/model-name" format (e.g. "meta/meta-llama-3-8b-instruct") for the latest version, or "owner/model-name:version-sha" to pin to a specific version. The REST endpoint splits owner and model-name into the path: /v1/models/{owner}/{model-name}/predictions.
  • The examples expect REPLICATE_API_TOKEN; rename it only if your application config maps the new variable.

Compare Llama Guard 4 12B Across Providers

ProviderInput (per 1M)Output (per 1M)
NVIDIA NIM
Replicate API$0.20$0.20
OpenRouter$0.18$0.18

Pricing

TypePrice (per 1M)
Input tokens$0.20
Output tokens$0.20

Capabilities

Structured Outputs

About Llama Guard 4 12B

Meta: Llama Guard 4 12B available via OpenRouter. Pricing: $0.18/1M input, $0.18/1M output.

FAQ

What does Llama Guard 4 12B cost on Replicate API?

On Replicate API, Llama Guard 4 12B costs $0.2 per 1M input tokens and $0.2 per 1M output tokens.

What is the context window for Llama Guard 4 12B on Replicate API?

Llama Guard 4 12B supports a 164,000 token context window on Replicate API.

How does Replicate API compare to other Llama Guard 4 12B providers?

Llama Guard 4 12B is available from 3 providers. The cheapest input pricing is $0.18/1M tokens from OpenRouter.

Who created Llama Guard 4 12B?

Llama Guard 4 12B was created by AI at Meta as part of the Llama Guard model family.

Is Llama Guard 4 12B open source?

Llama Guard 4 12B is open source according to the seed data.

Get Started

Model Specs

Released2025-04-05
Context164K
ArchitectureDecoder Only

GPU-Hour Providers(1)

Related Models on Replicate API