Text Generation
Transformers
Safetensors
Russian
English
qwen3
guardrail
safety
content-moderation
prompt-injection
agent-security
indirect-prompt-injection
multi-turn
tool-calls
dynamic-policy
whitelist
blocklist
simpo
knowledge-distillation
vllm
fp16
conversational
text-generation-inference
Run this model with HF Jobs
Run cloud-ru-tech/Guardrail-Censor-8B 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 and TRL to fine-tune https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B. 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/cloud-ru-tech/Guardrail-Censor-8B with Transformers and bitsandbytes. 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 cloud-ru-tech/Guardrail-Censor-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cloud-ru-tech/Guardrail-Censor-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cloud-ru-tech/Guardrail-Censor-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cloud-ru-tech/Guardrail-Censor-8B") model = AutoModelForCausalLM.from_pretrained("cloud-ru-tech/Guardrail-Censor-8B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cloud-ru-tech/Guardrail-Censor-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cloud-ru-tech/Guardrail-Censor-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cloud-ru-tech/Guardrail-Censor-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cloud-ru-tech/Guardrail-Censor-8B
- SGLang
How to use cloud-ru-tech/Guardrail-Censor-8B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cloud-ru-tech/Guardrail-Censor-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cloud-ru-tech/Guardrail-Censor-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cloud-ru-tech/Guardrail-Censor-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cloud-ru-tech/Guardrail-Censor-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cloud-ru-tech/Guardrail-Censor-8B with Docker Model Runner:
docker model run hf.co/cloud-ru-tech/Guardrail-Censor-8B
File size: 6,334 Bytes
2b94ea1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | {
"threshold": 0.5,
"rmr_ru": {
"animal_cruelty": {
"n": 100,
"acc": 0.85,
"prec": 0.907,
"rec": 0.78,
"f1": 0.8387,
"fpr": 0.08
},
"drug_abuse": {
"n": 100,
"acc": 0.82,
"prec": 0.8478,
"rec": 0.78,
"f1": 0.8125,
"fpr": 0.14
},
"erotic": {
"n": 100,
"acc": 0.89,
"prec": 0.8824,
"rec": 0.9,
"f1": 0.8911,
"fpr": 0.12
},
"extremism": {
"n": 100,
"acc": 0.85,
"prec": 0.8182,
"rec": 0.9,
"f1": 0.8571,
"fpr": 0.2
},
"politics": {
"n": 100,
"acc": 0.9,
"prec": 0.9,
"rec": 0.9,
"f1": 0.9,
"fpr": 0.1
},
"self_harm": {
"n": 100,
"acc": 0.79,
"prec": 0.8222,
"rec": 0.74,
"f1": 0.7789,
"fpr": 0.16
},
"violence": {
"n": 100,
"acc": 0.84,
"prec": 0.84,
"rec": 0.84,
"f1": 0.84,
"fpr": 0.16
},
"OVERALL": {
"n": 700,
"acc": 0.8486,
"prec": 0.8588,
"rec": 0.8343,
"f1": 0.8464,
"fpr": 0.1371
}
},
"rmr_en": {
"animal_cruelty": {
"n": 60,
"acc": 0.7333,
"prec": 0.8182,
"rec": 0.6,
"f1": 0.6923,
"fpr": 0.1333
},
"drug_abuse": {
"n": 60,
"acc": 0.8333,
"prec": 0.9167,
"rec": 0.7333,
"f1": 0.8148,
"fpr": 0.0667
},
"erotic": {
"n": 60,
"acc": 0.9333,
"prec": 1.0,
"rec": 0.8667,
"f1": 0.9286,
"fpr": 0.0
},
"extremism": {
"n": 60,
"acc": 0.7333,
"prec": 0.7188,
"rec": 0.7667,
"f1": 0.7419,
"fpr": 0.3
},
"politics": {
"n": 60,
"acc": 0.8167,
"prec": 0.9524,
"rec": 0.6667,
"f1": 0.7843,
"fpr": 0.0333
},
"self_harm": {
"n": 60,
"acc": 0.8667,
"prec": 0.9231,
"rec": 0.8,
"f1": 0.8571,
"fpr": 0.0667
},
"violence": {
"n": 60,
"acc": 0.8833,
"prec": 0.9259,
"rec": 0.8333,
"f1": 0.8772,
"fpr": 0.0667
},
"OVERALL": {
"n": 420,
"acc": 0.8286,
"prec": 0.8876,
"rec": 0.7524,
"f1": 0.8144,
"fpr": 0.0952
}
},
"test_unseen_f1": 0.9786,
"agent_sec_32": {
"n": 32,
"acc": 1.0,
"prec": 1.0,
"rec": 1.0,
"f1": 1.0,
"fpr": 0.0
},
"injecagent_holdout": {
"n": 400,
"acc": 0.965,
"prec": 0.9346,
"rec": 1.0,
"f1": 0.9662,
"fpr": 0.07
},
"opi_holdout": {
"n": 400,
"acc": 1.0,
"prec": 1.0,
"rec": 1.0,
"f1": 1.0,
"fpr": 0.0
},
"multiturn_300": {
"n": 300,
"pos": 150,
"neg": 150,
"tp": 150,
"fp": 0,
"tn": 150,
"fn": 0,
"f1": 1.0,
"prec": 1.0,
"rec": 1.0,
"fpr": 0.0
},
"toolcall_smuggling": {
"n": 300,
"pos": 150,
"neg": 150,
"tp": 132,
"fp": 21,
"tn": 129,
"fn": 18,
"f1": 0.8713,
"prec": 0.8627,
"rec": 0.88,
"fpr": 0.14
},
"pi_682_overall": {
"n": 682,
"tp": 315,
"fp": 17,
"tn": 343,
"fn": 7,
"prec": 0.9488,
"rec": 0.9783,
"f1": 0.9633,
"fpr": 0.0472
},
"pi_682_by_suite": {
"agentsec_32": {
"n": 32,
"tp": 22,
"fp": 0,
"tn": 10,
"fn": 0,
"prec": 1.0,
"rec": 1.0,
"f1": 1.0,
"fpr": 0.0
},
"injecagent_tool": {
"n": 100,
"tp": 50,
"fp": 4,
"tn": 46,
"fn": 0,
"prec": 0.9259,
"rec": 1.0,
"f1": 0.9615,
"fpr": 0.08
},
"neuralchemy_pi": {
"n": 200,
"tp": 96,
"fp": 2,
"tn": 98,
"fn": 4,
"prec": 0.9796,
"rec": 0.96,
"f1": 0.9697,
"fpr": 0.02
},
"notinject_benign": {
"n": 150,
"tp": 0,
"fp": 11,
"tn": 139,
"fn": 0,
"prec": 0.0,
"rec": 0.0,
"f1": 0.0,
"fpr": 0.0733
},
"opi_doc": {
"n": 100,
"tp": 50,
"fp": 0,
"tn": 50,
"fn": 0,
"prec": 1.0,
"rec": 1.0,
"f1": 1.0,
"fpr": 0.0
},
"tensortrust_pi": {
"n": 100,
"tp": 97,
"fp": 0,
"tn": 0,
"fn": 3,
"prec": 1.0,
"rec": 0.97,
"f1": 0.9848,
"fpr": 0.0
}
},
"external_benchmarks": {
"NotInject_339": {
"pi_policy_fpr": 0.0708,
"pi_policy_specificity": 0.9292,
"full_policy_fpr": 0.0206,
"by_split_pi_fpr": {
"NotInject_one": 0.0177,
"NotInject_two": 0.0354,
"NotInject_three": 0.1593
}
},
"neuralchemy_PI_test_942": {
"n": 942,
"pos": 552,
"neg": 390,
"f1": 0.9669,
"prec": 0.9813,
"rec": 0.9529,
"fpr": 0.0256,
"acc": 0.9618
},
"TensorTrust_776": {
"n": 776,
"recall": 0.9575
},
"ToxicChat_human_2853": {
"n": 2853,
"pos": 362,
"neg": 2491,
"f1": 0.759,
"prec": 0.6559,
"rec": 0.9006,
"fpr": 0.0686,
"acc": 0.9274,
"jailbreak_n": 91,
"jailbreak_recall": 0.956
},
"JailbreakBench_200": {
"n": 200,
"pos": 100,
"neg": 100,
"f1": 0.8448,
"prec": 0.7424,
"rec": 0.98,
"fpr": 0.34,
"acc": 0.82
},
"WildJailbreak_2210": {
"n": 2210,
"pos": 2000,
"neg": 210,
"f1": 0.9553,
"prec": 0.9706,
"rec": 0.9405,
"fpr": 0.2714,
"acc": 0.9204
},
"XSafety_RU_1000": {
"n": 1000,
"overall_recall": 0.528,
"by_category": {
"Crimes_And_Illegal_Activitie": 0.865,
"Goal_Hijacking": 0.95,
"Physical_Harm": 0.075,
"Prompt_Leaking": 0.125,
"Role_Play_Instruction": 0.625
}
},
"BrowseSafe_HTML_400": {
"chunks_total": 2708,
"thr_050": {
"n": 400,
"pos": 200,
"neg": 200,
"f1": 0.7929,
"prec": 0.971,
"rec": 0.67,
"fpr": 0.02,
"acc": 0.825
},
"thr_085": {
"n": 400,
"pos": 200,
"neg": 200,
"f1": 0.7952,
"prec": 1.0,
"rec": 0.66,
"fpr": 0.0,
"acc": 0.83
}
}
}
} |