1 python -m vllm.entrypoints.openai.api_server \
2 --model tzchen07/rai-n3-nano-4b-safety-m3-fullfix-recall \
3 --served-model-name rai-classifier \
4 --port 8180 \
5 --max-model-len 8192 \
6 --gpu-memory-utilization 0.85 \
7 --trust-remote-code \
8 --dtype bfloat16
1 from openai import OpenAI
2
3 client = OpenAI ( base_url = "http://localhost:8180/v1" , api_key = "unused" )
4
5 resp = client . chat . completions . create (
6 model = "rai-classifier" ,
7 messages = [
8 { "role" : "system" , "content" : "<v3.1 safety policy>" } ,
9 { "role" : "user" , "content" : query } ,
10 ] ,
11 max_tokens = 50 ,
12 temperature = 0.0 ,
13 stop = [ "Reason:" ] ,
14 extra_body = { "chat_template_kwargs" : { "enable_thinking" : False } } ,
15 )
16
17 verdict = resp . choices [ 0 ] . message . content . strip ( )
18 # Returns e.g. "Verdict: none" or "Verdict: Violence/Harassment"
1 # Run inference (enable_thinking=False is critical for N3)
2 python eval_n3_raw_v14_VR.py \
3 --data v14_eval.jsonl \
4 --prompt v3_1_VerdictReason.jinja \
5 --out predictions.jsonl \
6 --api-base http://localhost:8180/v1 \
7 --model rai-classifier \
8 --max-tokens 400 --concurrency 16
9
10 # CRITICAL: Sort by row_id before scoring (concurrent workers write out-of-order)
11 python score_aligned.py predictions.jsonl
12
13 # Score
14 python binary_metrics_v2.py predictions.jsonl.sorted --gt-source-jsonl v14_eval.jsonl
This model was produced during an extensive RAI training campaign (iter10-iter11, ~80+ experiments) exploring:
@misc{rai-n3-safety-m3-2026,
title={RAI Safety Classifier M3: Nemotron 3 Nano 4B},
author={Tony Chen},
year={2026},
publisher={HuggingFace},
url={https://huggingface.co/tzchen07/rai-n3-nano-4b-safety-m3-fullfix-recall}
}