Run this model with HF Jobs
Run akhilvarsh/NitiGuard-35B-A3B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/akhilvarsh/NitiGuard-35B-A3B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/akhilvarsh/NitiGuard-35B-A3B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/akhilvarsh/NitiGuard-35B-A3B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/akhilvarsh/NitiGuard-35B-A3B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use akhilvarsh/NitiGuard-35B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use akhilvarsh/NitiGuard-35B-A3B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("togethercomputer/Qwen3.6-35B-A3B_bnb_4bit_t") model = PeftModel.from_pretrained(base_model, "akhilvarsh/NitiGuard-35B-A3B") - Notebooks
- Google Colab
- Kaggle
NitiGuard-35B-A3B
NitiGuard-35B-A3B is a sparse Mixture-of-Experts safeguard model (35B total parameters, 3B active per token) fine-tuned from Qwen/Qwen3.6-35B-A3B via SFT and 90-step Dual-Adapter Failure-Harvested DPO on NVIDIA L40S (Qwen/Qwen3.6-35B-A3B-FP8, 35.7 GB VRAM, beta=0.1, lr=5e-6). Delivers the highest Binary Macro-F1 (97.10%), 3-Class Verdict F1 (89.77%), 100.00% financial-scam recall, 0.00% benign FPR on NitiBench-50, and 92.05% on external XSTest.
Key Verified Results
NitiBench-50 (n = 2,380, 50 Locales, L40S FP8, enable_thinking=False)
| Metric | Base 35B-A3B (FP8)* | NitiGuard-35B-A3B (SFT) | NitiGuard-35B-A3B (SFT + DPO) |
|---|---|---|---|
| Binary Macro-F1 | 95.22% | 96.63% | 97.10% (#1 Overall) |
| 3-Class Verdict F1 | 70.10% | 87.70% | 89.77% (#1 Overall) |
| 8-Class Category Macro-F1 | N/A* | 33.56% | 34.11% |
| Financial-Scam Recall | 97.39% | 100.00% | 100.00% (#1 Overall) |
Jailbreak Detection (n=60) |
68.33% | 81.67% | 90.00% |
| Benign FPR (↓) | 0.48% | 0.00% | 0.00% (0/1,243) |
| Cross-Lingual Disparity Δ_XL | +0.33 pts | +1.95 pts | +2.99 pts |
| JSON Validity | 97.77% | 99.62% | 99.54% |
| Legal Hallucination Rate (↓) | N/A* | 16.43% | 18.40% |
| Mean / P95 Latency (L40S) | 870 / 982 ms | 698 / 1081 ms | 1161 / 1536 ms |
*Base 35B-A3B was evaluated with verdict enums only; 8-class category and allowlist hallucination are marked N/A* to avoid an unenumerated zero-shot penalty. Residual 18.40% hallucination reflects Stage 1 SFT pre-dating Category-Balanced allowlist cleanup; for strict 0.00%–0.04% legal hallucination, use NitiGuard-4B or NitiGuard-9B.
Zero-Shot External OOD Generalization (L40S FP8, enable_thinking=False)
| External Benchmark | Strict Unsafe-F1 | Loose Unsafe-F1 | Strict Macro-F1 | Loose Safe-FPR (↓) | Invalid JSON |
|---|---|---|---|---|---|
XSTest (n=450) |
92.05% (+4.15 pts over Llama Guard 3) | 88.24% | 92.62% | 3.60% | 0.00% |
OpenAIMod (n=1,680) |
77.31% | 71.03% | 83.97% | 4.32% | 0.00% |
AEGIS-2.0 Test (n=1,964) |
77.56% (beats Llama Guard 3 76.4%) |
69.14% | 76.75% | 9.50% | 0.00% |
Quickstart (Qwen3.6-35B-A3B-FP8 on 48 GB L40S / A100)
# Requires: pip install "kernels==0.18.2" flash-linear-attention peft transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_id = "Qwen/Qwen3.6-35B-A3B-FP8"
adapter_id = "akhilvarsh/NitiGuard-35B-A3B"
tok = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(base_id, device_map={"": 0}, dtype="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, adapter_id).eval()
Supported Languages & Locales (50 Locales Across 40+ Countries)
| Country | Languages & Canonical BCP-47 Locales |
|---|---|
Bangla (bn-Beng-IN), Gujarati (gu-Gujr-IN), Hindi (hi-Deva-IN), Kannada (kn-Knda-IN), Malayalam (ml-Mlym-IN), Marathi (mr-Deva-IN), Punjabi (pa-Guru-IN), Tamil (ta-Taml-IN), Telugu (te-Telu-IN), Code-Mixed Hinglish & English (original) |
|
Spanish (es-Latn-AR, es-Latn-CO, es-Latn-MX, es-Latn-ES) |
|
Arabic (ar-Arab-EG, ar-Arab-SA, ar-Arab-AE) |
|
Portuguese (pt-Latn-BR, pt-Latn-PT) |
|
French (fr-Latn-CA, fr-Latn-FR) |
|
English (en-Latn-NG, en-Latn-SG) |
|
Bulgarian (bg-Cyrl-BG), Czech (cs-Latn-CZ), Danish (da-Latn-DK), Finnish (fi-Latn-FI) |
|
German (de-Latn-DE), Greek (el-Grek-GR), Hungarian (hu-Latn-HU), Italian (it-Latn-IT) |
|
Dutch (nl-Latn-NL), Norwegian (no-Latn-NO), Polish (pl-Latn-PL), Romanian (ro-Latn-RO) |
|
Russian (ru-Cyrl-RU), Slovak (sk-Latn-SK), Swedish (sv-Latn-SE), Turkish (tr-Latn-TR), Ukrainian (uk-Cyrl-UA) |
|
Chinese Simplified (zh-Hans-CN), Japanese (ja-Jpan-JP), Korean (ko-Kore-KR) |
|
Indonesian (id-Latn-ID), Malay (ms-Latn-MY), Filipino (fil-Latn-PH), Thai (th-Thai-TH), Vietnamese (vi-Latn-VN) |
|
Swahili (sw-Latn-KE), Sinhala (si-Sinh-LK) |
Statutory Allowlist (Language != Jurisdiction)
Universal threat classification (safe / caution / unsafe), 8-class categorization, and native-language rationales operate across all 50 locales, while policy_reference is strictly gated by jurisdiction_scope:
india_rbi_dpdp: India DPDP Act 2023, RBI 2017 Limited Liability Circular, RBI 2025 Fraud Risk Guidelines, RBI 2026 Digital Payment Security Master Directions, and RBI BE(A)WARE Booklet.eu_gdpr_ai_act: EU GDPR and EU AI Act.global/none: Mandatory"none"abstention for benign queries or threats outside India/EU statutory scope.
Auditable 7-Field JSON Schema
{
"verdict": "safe | caution | unsafe",
"category": "benign | financial_scam_upi_otp | fake_kyc_phishing | coercion_extortion | prompt_injection_jailbreak | pii_dpdp_gdpr_violation | prohibited_ai_practice | other_harm",
"jurisdiction_scope": "india_rbi_dpdp | eu_gdpr_ai_act | global | none",
"policy_reference": "<Verified Allowlist Citation> | none",
"language_detected": "<Canonical BCP-47 Locale, e.g. hi-Deva-IN>",
"risk_score": 0.0,
"rationale": "<Concise explanation in the user's detected language>"
}
Production Integration Note: Always enforce a fail-closed compound gate (
verdict == "safe"ANDcategory == "benign"ANDrisk_score < 0.25AND all 7 keys valid) paired with grammar-constrained decoding (guided_json) in adversarial environments.
Author
Akhilvarsh Pettem (akhilvarshpettem@gmail.com) — VNRVJIET, Hyderabad, India.
- Downloads last month
- -
Model tree for akhilvarsh/NitiGuard-35B-A3B
Base model
Qwen/Qwen3.6-35B-A3B