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-code

Installs 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
1orchestra-research avatartorchforge-rl-trainingorchestra-research/ai-research-skillsProvides guidance for PyTorch-native agentic RL using torchforge, Meta's library separating infra from algorithms. Use when you want clean RL abstractions, easy1Kskills.sh installs
2orchestra-research avatarnemo-evaluator-sdkorchestra-research/ai-research-skillsEvaluates LLMs across 100+ benchmarks from 18+ harnesses (MMLU, HumanEval, GSM8K, safety, VLM) with multi-backend execution. Use when needing scalable evaluatio1Kskills.sh installs
3databricks avatardatabricks-jobsdatabricks/databricks-agent-skillsDevelop and deploy Lakeflow Jobs on Databricks via DABs, Python SDK, or the CLI. Use when creating data engineering jobs with notebooks, Python wheels, SQL, dbt1Kskills.sh installs
4cursor avatarcreate-learning-pathcursor/pluginsBuild a personalized learning roadmap with milestones and practice checkpoints1Kskills.sh installs
5secondsky avatarsap-btp-connectivitysecondsky/sap-skillsSAP BTP Connectivity skill covering Destination Service, Connectivity Service, Cloud Connector, Connectivity Proxy, and Transparent Proxy for Kubernetes. Use wh1Kskills.sh installs
6datadrivenconstruction avatarwarranty-trackerdatadrivenconstruction/ddc_skills_for_ai_agents_in_constructionTrack and manage construction warranties. Monitor expiration dates, claims, and manufacturer documentation.1Kskills.sh installs