Text Classification
Safetensors
unsloth
qwen3_5
guardrails
safety
prompt-injection
jailbreak
decision-model
lora
qwen3.5
Eval Results (legacy)
Instructions to use AurelPx/SnapGuard-0.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Same-laptop comparison with Llama Guard: AUPRC and latency
Browse files54 unmodified lines5556575859606153 unmodified lines11511611711811912054 unmodified linesHighlights:- **Beats Llama Guard 7B on ToxicChat** with ~8× fewer parameters: AUPRC **0.668** vs 0.626.- **One forward pass, ~100 ms** per message on a laptop GPU (Apple M4 Pro).- **A real probability**: calibrated after training, so you choose how strict to be.- **Multilingual**: trained on English, French, German, Spanish and Italian messages.- **Easy to retrain**: about 3 h on a MacBook, with no NVIDIA GPU.53 unmodified linesReference numbers are from the [Llama Guard paper](https://arxiv.org/abs/2312.06674) (Table 2).## ⚠️ Limitations- It answers **one** question: the definition above. Content that is offensive but is not an attack or a harmful request (for example a crude joke) may be let through by design.54 unmodified lines5556575859606153 unmodified lines11511611711811912012112212312412512612712812913054 unmodified linesHighlights:- **Beats Llama Guard 7B on ToxicChat** with ~8× fewer parameters: AUPRC **0.668** vs 0.626.- **8× faster than Llama Guard 2-8B, 1.8× faster than Llama Guard 3-1B** on the same laptop, with a higher AUPRC: one forward pass, 71 ms median.- **A real probability**: calibrated after training, so you choose how strict to be.- **Multilingual**: trained on English, French, German, Spanish and Italian messages.- **Easy to retrain**: about 3 h on a MacBook, with no NVIDIA GPU.53 unmodified linesReference numbers are from the [Llama Guard paper](https://arxiv.org/abs/2312.06674) (Table 2).### Faster and better than Llama Guard, on the same laptop| Model (same MacBook Pro M4 Pro) | Parameters | AUPRC* | Latency p50 | ||---|---:|---:|---:|---|| **SnapGuard-0.8B** | 0.88 B | **0.757** | **71 ms** | one forward pass || Llama Guard 3-1B (bf16) | 1 B | 0.370 | 130 ms | **1.8× slower** || Llama Guard 2-8B (8-bit) | 8 B | 0.546 | 565 ms | **7.9× slower** |\* Same 1 000 ToxicChat test prompts for every model (random sample, seed 0); SnapGuard scores 0.668 on the full test set. Batch size 1, warm models, MLX. Latency is the time to a usable verdict: one forward pass for SnapGuard, generating `safe` / `unsafe` for Llama Guard (median over 200 prompts). SnapGuard reads at most 512 tokens. Reproduce with [`compare_guards.py`](https://github.com/Aurelien7877/llm2decider/blob/main/compare_guards.py).## ⚠️ Limitations- It answers **one** question: the definition above. Content that is offensive but is not an attack or a harmful request (for example a crude joke) may be let through by design.
README.md+11-1