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
Download eval_metrics.json from cloud-ru-tech/Guardrail-Censor-8B: direct link, hf CLI and curl.
- Browser
- Download file 6.33 kB
-
https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B/resolve/main/eval_metrics.json
- Command line
-
hf download hf://cloud-ru-tech/Guardrail-Censor-8B/eval_metrics.json
-
curl -L -o eval_metrics.json https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B/resolve/main/eval_metrics.json
6.33 kB
| { | |
| "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 | |
| } | |
| } | |
| } | |
| } |