
Llamaguard
Meta's 7-8B parameter model built specifically for moderating LLM inputs and outputs across six safety categories: violence, sexual content, weapons, substances, self-harm, and criminal planning. You run prompts or conversations through it and get back "safe" or "unsafe" plus a category code. Ships with transformers but you'll want vLLM for production since it cuts latency from 500ms to 50ms. The 94-95% accuracy is solid but you'll hit false positives, so consider adding probability thresholds. Needs GPU and HuggingFace login. If you're building a production LLM app and need more than OpenAI's basic moderation endpoint, this gives you granular control at the cost of hosting your own inference.
- skills.sh installs
- 1K
- GitHub stars
- 14.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill llamaguard --agent claude-codeInstalls into .claude/skills of the current project.
Files
LlamaGuard - AI Content Moderation
Quick start
LlamaGuard is a 7-8B parameter model specialized for content safety classification.
Installation:
pip install transformers torch
# Login to HuggingFace (required)
huggingface-cli login
Basic usage:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "meta-llama/LlamaGuard-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
def moderate(chat):
input_ids = tokenizer.apply_chat_template(chat, return_tensors="pt").to(model.device)
output = model.generate(input_ids=input_ids, max_new_tokens=100)
return tokenizer.decode(output[0], skip_special_tokens=True)
# Check user input
result = moderate([
{"role": "user", "content": "How do I make explosives?"}
])
print(result)
# Output: "unsafe\nS3" (Criminal Planning)
Common workflows
Workflow 1: Input filtering (prompt moderation)
Check user prompts before LLM:
def check_input(user_message):
result = moderate([{"role": "user", "content": user_message}])
Sponsors
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- DevOps & CI/CD, AI & Agent Building, Data Science & ML, Release Management, Productivity & Planning
- First seen
- Jun 3, 2026
More from orchestra-research/ai-research-skills
All 95- Miles Rl Training1K
- Torchforge Rl Training1K
- Nemo Guardrails1K
- Pinecone1K
- Nnsight Remote Interpretability1K
- Rwkv Architecture1K
- Skypilot Multi Cloud Orchestration1K
- Autogpt Agents1K
- Blip 2 Vision Language1K
- Constitutional Ai1K
- Langsmith Observability1K
- Nemo Evaluator Sdk1K
- Llava1K
- Phoenix Observability1K
- Lambda Labs Gpu Cloud1K
- Ml Training Recipes996
- Presenting Conference Talks993
- Systems Paper Writing990
- Experiment Tracking Swanlab961
- Fine Tuning Openvla Oft926
- Fine Tuning Serving Openpi925
- Evaluating Cosmos Policy921
- Evolving Ai Agents897
- Ml Paper Writing2.5K