Skip to content

Moderation model with six safety categories for filtering LLM prompts and responses.

CCM score
57 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers input and output filtering with a moderate() helper that returns safe or unsafe plus a category code
  • Includes six categories: violence and hate (S1), sexual content (S2), guns and weapons (S3), regulated substances (S4), self-harm (S5), and criminal planning (S6)
  • Provides vLLM batch serving, a FastAPI /moderate endpoint, and 8-bit quantization to cut GPU memory use
  • Designed for production LLM apps that need a pre-trained classifier, with optional integration into NeMo Guardrails

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill llamaguard -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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}])

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI Agents & LLM Apps, Security
First seen
Jun 3, 2026

Questions

What does the llamaguard skill do?

The llamaguard skill lets an agent use Meta's 7-8B LlamaGuard moderation model to filter LLM inputs and outputs. It classifies content across six safety categories, including violence and hate, sexual content, weapons, substances, self-harm, and criminal planning.

How do I install the llamaguard skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill llamaguard -y in your project. After that, the agent can build moderation checks around the LlamaGuard model for prompts and responses.

What do I need to use LlamaGuard with this skill?

You need transformers, torch and vLLM, plus a HuggingFace login with huggingface-cli login. You also have to accept Meta's license on the model page before the model can be downloaded.

Where does llamaguard stand in the AI Agents and LLM Apps category?

Among the AI Agents and LLM Apps skills, llamaguard is listed alongside microsoft-foundry, azure-ai and several Google agents CLI skills. Its focus is dedicated content moderation rather than agent building itself.

More from orchestra-research/ai-research-skills

All 92

Similar to Llamaguard

More AI Agents & LLM Apps