> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerogpu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# llama-guard-4-12b

> Model details for llama-guard-4-12b. Multimodal safety classification for prompts and responses.

> Meta's Llama Guard 4 12B is a multimodal safety classification model for moderating text, images, and mixed text-image inputs. It evaluates both incoming prompts and generated responses, returning a safe or unsafe classification along with the policy categories a violation falls under. It handles multilingual text and multiple images in one call, which makes it a fit for chat moderation, prompt and response filtering, policy enforcement, and agent guardrails. Built on a dense 12B architecture derived from Llama 4 Scout, it is designed as a dedicated safety layer in front of a production model rather than as a general-purpose generator.

**References:** [Model docs](https://huggingface.co/meta-llama/Llama-Guard-4-12B) • [Terms](https://huggingface.co/meta-llama/Llama-Guard-4-12B) • [Privacy](https://huggingface.co/meta-llama/Llama-Guard-4-12B)


## OpenAPI

````yaml api-reference/openapi/playgrounds/llama-guard-4-12b.openapi.json POST /moderations
openapi: 3.1.0
info:
  title: llama-guard-4-12b playground
  version: '1.0'
  description: >-
    Interactive playground for **llama-guard-4-12b**.

    Model is always `llama-guard-4-12b` on this page (shown in the form, not
    editable).

    Routable on `/v1/moderations`, `/v1/chat/completions`, and `/v1/responses`.
servers:
  - url: https://api.zerogpu.ai/v1
    description: Production
security:
  - ApiKey: []
paths:
  /moderations:
    post:
      tags:
        - llama-guard-4-12b
      summary: 'llama-guard-4-12b: Moderations'
      operationId: createModeration_llama-guard-4-12b
      parameters:
        - name: x-project-id
          in: header
          required: false
          schema:
            type: string
          description: >-
            Optional project identifier. Scopes the request to a specific
            project when provided.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateModerationRequest'
                - type: object
                  properties:
                    model:
                      type: string
                      const: llama-guard-4-12b
                      default: llama-guard-4-12b
                      example: llama-guard-4-12b
                      description: Model identifier (fixed for this playground).
            examples:
              default:
                summary: Default
                value:
                  model: llama-guard-4-12b
                  input: >-
                    I am so angry at this person that I want to hurt them. They
                    are worthless and should be scared of what I might do next.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '420':
          description: Insufficient quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
components:
  schemas:
    CreateModerationRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          const: llama-guard-4-12b
          default: llama-guard-4-12b
          example: llama-guard-4-12b
          description: Model identifier (fixed for this playground).
        input:
          description: >-
            Text to classify. Accepts a single string, an array of strings (one
            result per element), or an array of content parts (`{ "type":
            "text", "text": "..." }`) that form a single multi-modal input.
          oneOf:
            - type: string
              minLength: 1
              format: textarea
              maxLength: 131072
            - type: array
              minItems: 1
              items:
                type: string
                minLength: 1
                maxLength: 131072
            - type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/InputContentPart'
    ModerationResponse:
      type: object
      description: OpenAI-compatible moderations envelope. One `results` entry per input.
      properties:
        id:
          type: string
          description: Unique identifier for the moderation request.
          example: modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90
        model:
          type: string
          description: The model used for classification.
          example: llama-guard-4-12b
        results:
          type: array
          description: >-
            Moderation verdicts, one per input (a string input yields a
            single-element array).
          items:
            $ref: '#/components/schemas/ModerationResult'
    ErrorResponse:
      type: object
      additionalProperties: true
    InputContentPart:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          const: text
          default: text
        text:
          type: string
          minLength: 1
          format: textarea
          maxLength: 131072
          description: Text content of this part.
    ModerationResult:
      type: object
      description: A single entry of the `results` array — the verdict for one input.
      properties:
        flagged:
          type: boolean
          description: True when the model flagged the input in one or more categories.
          example: true
        categories:
          $ref: '#/components/schemas/ModerationCategories'
        category_scores:
          $ref: '#/components/schemas/ModerationCategoryScores'
        category_applied_input_types:
          $ref: '#/components/schemas/ModerationAppliedInputTypes'
    ModerationCategories:
      type: object
      description: >-
        Per-category boolean verdicts. All 13 categories are always present, in
        OpenAI's order.
      properties:
        harassment:
          type: boolean
          description: >-
            Content that expresses, incites, or promotes harassing language
            towards any target.
          example: true
        harassment/threatening:
          type: boolean
          description: >-
            Harassment that also includes violence or serious harm towards any
            target.
          example: true
        hate:
          type: boolean
          description: >-
            Content that expresses, incites, or promotes hate based on a
            protected attribute.
          example: false
        hate/threatening:
          type: boolean
          description: >-
            Hateful content that also includes violence or serious harm towards
            a protected group.
          example: false
        illicit:
          type: boolean
          description: >-
            Content that gives advice or instruction on how to commit a
            wrongdoing.
          example: false
        illicit/violent:
          type: boolean
          description: Illicit content that also references violence or procuring a weapon.
          example: false
        self-harm:
          type: boolean
          description: Content that promotes, encourages, or depicts acts of self-harm.
          example: false
        self-harm/intent:
          type: boolean
          description: >-
            Content where the speaker expresses that they are engaging or intend
            to engage in self-harm.
          example: false
        self-harm/instructions:
          type: boolean
          description: >-
            Content that provides instructions or advice on how to commit acts
            of self-harm.
          example: false
        sexual:
          type: boolean
          description: >-
            Content meant to arouse sexual excitement or that promotes sexual
            services.
          example: false
        sexual/minors:
          type: boolean
          description: Sexual content that includes an individual under 18 years old.
          example: false
        violence:
          type: boolean
          description: Content that depicts death, violence, or physical injury.
          example: true
        violence/graphic:
          type: boolean
          description: >-
            Content that depicts death, violence, or physical injury in graphic
            detail.
          example: false
    ModerationCategoryScores:
      type: object
      description: >-
        Per-category confidence scores in [0, 1]. All 13 categories are always
        present, in OpenAI's order.
      properties:
        harassment:
          type: number
          description: Confidence score for `harassment`.
          example: 0.9412
        harassment/threatening:
          type: number
          description: Confidence score for `harassment/threatening`.
          example: 0.9016
        hate:
          type: number
          description: Confidence score for `hate`.
          example: 0.0231
        hate/threatening:
          type: number
          description: Confidence score for `hate/threatening`.
          example: 0.0104
        illicit:
          type: number
          description: Confidence score for `illicit`.
          example: 0.0057
        illicit/violent:
          type: number
          description: Confidence score for `illicit/violent`.
          example: 0.0039
        self-harm:
          type: number
          description: Confidence score for `self-harm`.
          example: 0.0021
        self-harm/intent:
          type: number
          description: Confidence score for `self-harm/intent`.
          example: 0.0012
        self-harm/instructions:
          type: number
          description: Confidence score for `self-harm/instructions`.
          example: 0.0008
        sexual:
          type: number
          description: Confidence score for `sexual`.
          example: 0.0006
        sexual/minors:
          type: number
          description: Confidence score for `sexual/minors`.
          example: 0.0002
        violence:
          type: number
          description: Confidence score for `violence`.
          example: 0.8774
        violence/graphic:
          type: number
          description: Confidence score for `violence/graphic`.
          example: 0.0311
    ModerationAppliedInputTypes:
      type: object
      description: >-
        Which input modality triggered each category. This is a text-only model,
        so every category maps to ["text"].
      properties:
        harassment:
          type: array
          items:
            type: string
          example:
            - text
        harassment/threatening:
          type: array
          items:
            type: string
          example:
            - text
        hate:
          type: array
          items:
            type: string
          example:
            - text
        hate/threatening:
          type: array
          items:
            type: string
          example:
            - text
        illicit:
          type: array
          items:
            type: string
          example:
            - text
        illicit/violent:
          type: array
          items:
            type: string
          example:
            - text
        self-harm:
          type: array
          items:
            type: string
          example:
            - text
        self-harm/intent:
          type: array
          items:
            type: string
          example:
            - text
        self-harm/instructions:
          type: array
          items:
            type: string
          example:
            - text
        sexual:
          type: array
          items:
            type: string
          example:
            - text
        sexual/minors:
          type: array
          items:
            type: string
          example:
            - text
        violence:
          type: array
          items:
            type: string
          example:
            - text
        violence/graphic:
          type: array
          items:
            type: string
          example:
            - text
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key

````