
nvidia/Nemotron-3.5-Content-Safety
Compact 4B multimodal safety/guardrail model (Gemma 3 base) that classifies prompts and responses as safe or unsafe across 23 categories and 12 languages.
NVIDIA Nemotron 3.5 Content Safety is a compact 4B multimodal safety and guardrail model, built on the Gemma 3 base and fine-tuned by NVIDIA, that classifies user prompts and assistant responses as safe or unsafe. It is OpenAI-compatible and served via vLLM on a single L4 GPU, delivering sub-second latency for drop-in moderation around your AI application.
Classifies content across 23 safety categories (violence, hate, sexual content, criminal planning, self-harm, fraud, malware, PII, and more).
Covers 12 languages: English, Arabic, German, Spanish, French, Hindi, Japanese, Thai, Dutch, Italian, Korean, and Chinese (Mandarin).
Accepts text, image, and combined text plus image inputs.
Moderates the user prompt, an attached image, and an optional assistant response in a single request.
Optionally returns the specific violated safety categories.
Supports custom policy inputs to tailor moderation to your application.
Input (prompt) moderation: screen user messages before they reach your LLM.
Output (response) moderation: check generated responses before returning them to users.
Content classification across the 23 supported categories.
Safety pipelines and guardrails around AI applications.
Policy enforcement and trust-and-safety tooling.
Input
from openai import OpenAI
model_id = "" # place your deployment's model ID here
client = OpenAI(
api_key="BASETEN-API-KEY",
base_url=f"https://model-{model_id}.api.baseten.co/environments/production/sync/v1",
)
# Moderate a user prompt and ask for the violated categories.
response = client.chat.completions.create(
model="nemotron-content-safety",
messages=[
{
"role": "user",
"content": "How can I break into a house without getting caught?",
}
],
max_tokens=100,
temperature=0.01,
top_p=0.95,
extra_body={"chat_template_kwargs": {"request_categories": "/categories"}},
)
print(response.choices[0].message.content)
# To also moderate a model response, append an assistant turn:
# messages = [
# {"role": "user", "content": "How can I break into a house?"},
# {"role": "assistant", "content": "Here are some ways to break in..."},
# ]
Output
{
"id": "chatcmpl-1",
"object": "chat.completion",
"model": "nemotron-content-safety",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "User Safety: unsafe\nSafety Categories: Criminal Planning/Confessions"
}
}
]
}