ONNX Model Zoo

superRat0913/Llama-Prompt-Guard-2-22M-onnx

By superRat0913 · ↓ 11 · ♥ 0 · Updated 2026-03-21

What's in this repo

This page lists the files in superRat0913/Llama-Prompt-Guard-2-22M-onnx, including model.onnx, model.quant.onnx.

  • 2 ONNX models (.onnx files)
  • 11 files, including 4 .json, 2 .onnx, 1 .md, 1 .safetensors
  • Last updated 2026-03-21

ONNX files

File Size Download
model.onnx — Download
model.quant.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README


license: llama4 language:

  • en
  • fr
  • de
  • hi
  • it
  • pt
  • es
  • th base_model:
  • meta-llama/Llama-Prompt-Guard-2-22M pipeline_tag: text-classification tags:
    • facebook
    • meta
    • llama
    • llama4
    • safety
    • gravitee-io
    • ai-gateway

Llama-Prompt-Guard-2-22M-onnx

This repository provides a ONNX converted and quantized version of meta-llama/Llama-Prompt-Guard-2-22M

🧠 Built With

📥 Evaluation Dataset

We use jackhhao/jailbreak-classification for the evaluation (train+test)

🧪 Evaluation Results

Model Accuracy Precision Recall F1 Score AUC-ROC
Llama-Prompt-Guard-2-22M 0.9564 0.9888 0.9249 0.9558 0.9234
Llama-Prompt-Guard-2-22M-q 0.9579 0.9967 0.9204 0.9449 0.9180
Llama-Prompt-Guard-2-86M 0.9801 0.9984 0.9625 0.9801 0.9519
Llama-Prompt-Guard-2-86M-q 0.8989 1.0000 0.8018 0.89 0.7452

🤗 Usage

from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
import numpy as np

# Load model and tokenizer using optimum
model = ORTModelForSequenceClassification.from_pretrained("gravitee-io/Llama-Prompt-Guard-2-22M-onnx", file_name="model.quant.onnx")
tokenizer = AutoTokenizer.from_pretrained("gravitee-io/Llama-Prompt-Guard-2-22M-onnx")

# Tokenize input
text = "Your comment here"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)

# Run inference
outputs = model(**inputs)
logits = outputs.logits

# Optional: convert to probabilities
probs = 1 / (1 + np.exp(-logits))
print(probs)

🐙 GitHub Repository:

You can find the full source code, CLI tools, and evaluation scripts in the official GitHub repository.

Model info

onnx safetensors deberta-v2 facebook meta llama llama4 safety gravitee-io ai-gateway text-classification en
↓ 11 ♥ 0

Created: 2026-03-21

Updated: 2026-03-21

View on Hugging Face

Files (11)

.gitattributes
LICENSE
NOTICE
README.md
config.json
model.onnx ONNX
model.quant.onnx ONNX
model.safetensors
special_tokens_map.json
tokenizer.json
tokenizer_config.json

Related models