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 taxonomy.json from cloud-ru-tech/Guardrail-Censor-8B: direct link, hf CLI and curl.
- Browser
- Download file 20.7 kB
-
https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B/resolve/main/taxonomy.json
- Command line
-
hf download hf://cloud-ru-tech/Guardrail-Censor-8B/taxonomy.json
-
curl -L -o taxonomy.json https://huggingface.co/cloud-ru-tech/Guardrail-Censor-8B/resolve/main/taxonomy.json
20.7 kB
| { | |
| "version": "1.0", | |
| "languages": ["ru", "en"], | |
| "primary_mode": "blocklist", | |
| "apt_mode_weights": { | |
| "blocklist": 0.70, | |
| "whitelist": 0.20, | |
| "combined": 0.10 | |
| }, | |
| "boundary_policy": { | |
| "history_past_centuries": "allow", | |
| "modern_politics_and_sanctions": "block", | |
| "basic_economics": "allow", | |
| "homonyms_and_tech_triggers": "allow", | |
| "safe_assistant_refusals_on_output": "allow" | |
| }, | |
| "default_blocklist": [ | |
| { | |
| "id": "extremism_terrorism", | |
| "group": "hard_safety", | |
| "name_ru": "Экстремизм и терроризм", | |
| "name_en": "Extremism and terrorism", | |
| "description_ru": "Пропаганда, вербовка, оправдание или инструкции по терроризму/экстремизму (нейтральная история и право разрешены).", | |
| "description_en": "Propaganda, recruitment, or instructions for terrorism/extremism (neutral history and law allowed)." | |
| }, | |
| { | |
| "id": "weapons_explosives", | |
| "group": "hard_safety", | |
| "name_ru": "Оружие и взрывчатка", | |
| "name_en": "Weapons and explosives", | |
| "description_ru": "Инструкции по изготовлению, покупке или применению оружия и взрывчатки (учебная наука и история разрешены).", | |
| "description_en": "Instructions for making, buying, or using weapons/explosives (textbook science and history allowed)." | |
| }, | |
| { | |
| "id": "drugs", | |
| "group": "hard_safety", | |
| "name_ru": "Наркотики и ПАВ", | |
| "name_en": "Illegal drugs and controlled substances", | |
| "description_ru": "Синтез, покупка, сбыт или пропаганда наркотиков (медицина, лечение зависимости и закон разрешены).", | |
| "description_en": "Synthesis, purchase, sale, or promotion of illegal drugs (medical facts, recovery, and law allowed)." | |
| }, | |
| { | |
| "id": "violence_selfharm", | |
| "group": "hard_safety", | |
| "name_ru": "Насилие и селфхарм", | |
| "name_en": "Violence and self-harm", | |
| "description_ru": "Призывы, поощрение или инструкции по суициду, селфхарму и насилию (помощь, медицина и профилактика разрешены).", | |
| "description_en": "Incitement or instructions for suicide, self-harm, or violence (help-seeking, medicine, prevention allowed)." | |
| }, | |
| { | |
| "id": "animal_cruelty", | |
| "group": "hard_safety", | |
| "name_ru": "Жестокое обращение с животными", | |
| "name_en": "Animal cruelty", | |
| "description_ru": "Поощрение или инструкции по издевательству и насилию над животными (ветеринария, уход и законы разрешены).", | |
| "description_en": "Encouragement or instructions for abusing animals (veterinary care, pets, and protection laws allowed)." | |
| }, | |
| { | |
| "id": "cyberattacks_fraud", | |
| "group": "hard_safety", | |
| "name_ru": "Кибератаки и мошенничество", | |
| "name_en": "Cyberattacks and fraud", | |
| "description_ru": "Взлом, вредоносное ПО, фишинг, обход защиты, мошенничество и подделка документов.", | |
| "description_en": "Hacking, malware, phishing, bypassing security, financial fraud, or forgery." | |
| }, | |
| { | |
| "id": "hate_speech", | |
| "group": "hard_safety", | |
| "name_ru": "Язык вражды и травля", | |
| "name_en": "Hate speech and harassment", | |
| "description_ru": "Разжигание ненависти по нации, расе, религии или полу; угрозы, травля, доксинг.", | |
| "description_en": "Hate speech by nationality, race, religion, or gender; threats, harassment, doxxing." | |
| }, | |
| { | |
| "id": "csam_exploitation", | |
| "group": "hard_safety", | |
| "name_ru": "Эксплуатация несовершеннолетних", | |
| "name_en": "Child sexual exploitation (CSAM)", | |
| "description_ru": "Любой сексуализированный контент или эксплуатация несовершеннолетних.", | |
| "description_en": "Any sexualized content or exploitation involving minors." | |
| }, | |
| { | |
| "id": "prompt_injection", | |
| "group": "hard_safety", | |
| "name_ru": "Prompt Injection и Jailbreak", | |
| "name_en": "Prompt injection and jailbreak", | |
| "description_ru": "Обход правил («забудь инструкции», DAN, Base64/омоглифы, подделка системных тегов) и извлечение system prompt (учебное описание термина разрешено).", | |
| "description_en": "Rule overrides (ignore instructions, DAN, Base64/homoglyphs, system-tag spoofing) and system prompt extraction (neutral theory allowed)." | |
| }, | |
| { | |
| "id": "indirect_agent_injection", | |
| "group": "hard_safety", | |
| "name_ru": "Косвенные инъекции и захват агента", | |
| "name_en": "Indirect prompt injection and agent hijacking", | |
| "description_ru": "Скрытые команды внутри документов, писем, RAG и ответов инструментов (ROLE=TOOL): перехват тулов и эксфильтрация данных (обычные JSON, письма и логи разрешены).", | |
| "description_en": "Hidden commands inside docs, emails, RAG, or tool outputs (ROLE=TOOL): tool hijacking or data exfiltration (clean JSON, emails, logs allowed)." | |
| }, | |
| { | |
| "id": "domestic_politics", | |
| "group": "politics", | |
| "name_ru": "Внутренняя политика", | |
| "name_en": "Domestic politics", | |
| "description_ru": "Современные политики (Путин и др.), партии, выборы, правительство, протесты (история прошлых веков и омонимы вроде политики возврата разрешены).", | |
| "description_en": "Modern politicians (Putin, etc.), parties, elections, government, protests (pre-modern history and homonyms like return policy allowed)." | |
| }, | |
| { | |
| "id": "geopolitics_conflicts", | |
| "group": "geopolitics", | |
| "name_ru": "Геополитика и военные конфликты", | |
| "name_en": "Geopolitics and armed conflicts", | |
| "description_ru": "Современные войны, территориальные споры и альянсы: Крым, Украина, СВО, Донбасс, НАТО (нейтральная география и погода разрешены).", | |
| "description_en": "Modern wars, territorial disputes, alliances: Crimea, Ukraine, SVO, Donbas, NATO (neutral geography and weather allowed)." | |
| }, | |
| { | |
| "id": "sanctions_political_econ", | |
| "group": "geopolitics", | |
| "name_ru": "Санкции и политизированная экономика", | |
| "name_en": "Sanctions and politicized economics", | |
| "description_ru": "Международные санкции, контрсанкции и торговые войны (базовая учебная экономика разрешена).", | |
| "description_en": "International sanctions and trade wars (basic textbook economics allowed)." | |
| }, | |
| { | |
| "id": "religion_ideology", | |
| "group": "religion", | |
| "name_ru": "Религиозные и идеологические споры", | |
| "name_en": "Religious and ideological disputes", | |
| "description_ru": "Споры об истинности религий, оскорбление конфессий и идеологическая пропаганда.", | |
| "description_en": "Religious truth debates, insulting faiths, and ideological propaganda." | |
| }, | |
| { | |
| "id": "adult_18plus", | |
| "group": "business_risk", | |
| "name_ru": "Контент 18+ и эротика", | |
| "name_en": "Adult 18+ and erotic content", | |
| "description_ru": "Эротика, порнография и откровенные сексуальные описания (медицина и биология разрешены).", | |
| "description_en": "Erotica, pornography, and sexually explicit descriptions (medicine and biology allowed)." | |
| }, | |
| { | |
| "id": "profanity", | |
| "group": "business_risk", | |
| "name_ru": "Мат и грубые оскорбления", | |
| "name_en": "Profanity and verbal abuse", | |
| "description_ru": "Ненормативная лексика, мат, хамство и личные оскорбления.", | |
| "description_en": "Obscene language, profanity, and personal insults." | |
| }, | |
| { | |
| "id": "gambling", | |
| "group": "business_risk", | |
| "name_ru": "Казино, азартные игры и ставки", | |
| "name_en": "Gambling and betting", | |
| "description_ru": "Онлайн-казино, ставки, стратегии выигрыша и их реклама.", | |
| "description_en": "Online casinos, betting, wagering strategies, and promotion." | |
| }, | |
| { | |
| "id": "crypto_investments", | |
| "group": "business_risk", | |
| "name_ru": "Криптовалюты и инвестсоветы", | |
| "name_en": "Crypto and personal investment advice", | |
| "description_ru": "Инвестсоветы, сигналы покупки/продажи криптовалют и акций, схемы быстрого заработка.", | |
| "description_en": "Investment advice, crypto/stock trading signals, and get-rich-quick schemes." | |
| }, | |
| { | |
| "id": "medical_legal_advice", | |
| "group": "business_risk", | |
| "name_ru": "Медицинские и юридические советы", | |
| "name_en": "Medical diagnoses and legal advice", | |
| "description_ru": "Постановка диагнозов, назначение лекарств, юридические схемы обхода закона.", | |
| "description_en": "Medical diagnosis, prescribing drugs, or legal evasion advice." | |
| }, | |
| { | |
| "id": "competitors", | |
| "group": "business_risk", | |
| "name_ru": "Конкуренты и сравнение брендов", | |
| "name_en": "Competitors and brand comparisons", | |
| "description_ru": "Критика или прямое сравнение конкурирующих брендов, продуктов и тарифов.", | |
| "description_en": "Criticizing or comparing competing brands, products, or pricing." | |
| } | |
| ], | |
| "neutral_domains": [ | |
| { | |
| "id": "programming_it", | |
| "name_ru": "Программирование и IT", | |
| "name_en": "Programming and IT", | |
| "description_ru": "Разработка ПО, код, алгоритмы, Linux, базы данных, DevOps и системное администрирование.", | |
| "description_en": "Software development, code, algorithms, Linux, databases, and DevOps." | |
| }, | |
| { | |
| "id": "math_science", | |
| "name_ru": "Математика и наука", | |
| "name_en": "Mathematics and science", | |
| "description_ru": "Математика, физика, химия (учебная), биология, астрономия и научные факты.", | |
| "description_en": "Math, physics, educational science, biology, and astronomy." | |
| }, | |
| { | |
| "id": "basic_economics", | |
| "name_ru": "Базовая экономика и финансы", | |
| "name_en": "Basic economics and finance", | |
| "description_ru": "Учебная экономическая теория, бухгалтерия, расчёт процентов, базовые понятия инфляции и налогов без политики и инвестсоветов.", | |
| "description_en": "Textbook economic concepts, accounting, interest calculation, and inflation basics without politics or investment advice." | |
| }, | |
| { | |
| "id": "history_past", | |
| "name_ru": "История прошлых веков", | |
| "name_en": "Pre-modern history", | |
| "description_ru": "Исторические события древнего мира, Средневековья, XVIII–XIX веков, биографии исторических личностей прошлого.", | |
| "description_en": "Ancient, medieval, and 18th–19th century historical events and figures." | |
| }, | |
| { | |
| "id": "education_languages", | |
| "name_ru": "Образование и языки", | |
| "name_en": "Education and languages", | |
| "description_ru": "Изучение языков, грамматика, переводы нейтральных текстов, помощь с учёбой.", | |
| "description_en": "Language learning, grammar, neutral translations, and study help." | |
| }, | |
| { | |
| "id": "culture_art", | |
| "name_ru": "Культура и искусство", | |
| "name_en": "Culture and arts", | |
| "description_ru": "Литература, кино, музыка, живопись, театр и архитектура.", | |
| "description_en": "Literature, cinema, music, painting, theater, and architecture." | |
| }, | |
| { | |
| "id": "sports", | |
| "name_ru": "Спорт и фитнес", | |
| "name_en": "Sports and fitness", | |
| "description_ru": "Спортивные соревнования, тренировки, правила игр и здоровый образ жизни (без ставок).", | |
| "description_en": "Sports events, workouts, game rules, and fitness without betting." | |
| }, | |
| { | |
| "id": "cooking_lifestyle", | |
| "name_ru": "Кулинария и быт", | |
| "name_en": "Cooking and everyday life", | |
| "description_ru": "Рецепты, домашние дела, советы по быту, уходу за растениями и питомцами.", | |
| "description_en": "Recipes, household tips, gardening, and pet care." | |
| }, | |
| { | |
| "id": "travel", | |
| "name_ru": "Путешествия и география", | |
| "name_en": "Travel and geography", | |
| "description_ru": "Туристические маршруты, достопримечательности, транспорт и физическая география.", | |
| "description_en": "Travel itineraries, landmarks, transportation, and physical geography." | |
| }, | |
| { | |
| "id": "customer_support", | |
| "name_ru": "Клиентская поддержка и сервис", | |
| "name_en": "Customer support and service", | |
| "description_ru": "Вопросы по заказам, доставке, возврату товаров, тарифам и политике конфиденциальности сервиса.", | |
| "description_en": "Orders, delivery, return policies, billing, and privacy policy inquiries." | |
| }, | |
| { | |
| "id": "small_talk", | |
| "name_ru": "Повседневное общение", | |
| "name_en": "Casual small talk", | |
| "description_ru": "Приветствия, благодарности, общие бытовые вопросы и нейтральные диалоги.", | |
| "description_en": "Greetings, thanks, and neutral everyday conversation." | |
| }, | |
| { | |
| "id": "health_wellness", | |
| "name_ru": "Здоровье и здоровый образ жизни", | |
| "name_en": "General health and wellness", | |
| "description_ru": "Общая информация о здоровье, сне, питании и профилактике без постановки диагнозов и назначения лекарств.", | |
| "description_en": "General wellness, sleep, nutrition, and preventive health info without medical diagnosis or prescriptions." | |
| }, | |
| { | |
| "id": "psychology_relationships", | |
| "name_ru": "Психология и отношения", | |
| "name_en": "Psychology and relationships", | |
| "description_ru": "Общение, саморазвитие, мотивация, дружба и семейные отношения без селфхарма.", | |
| "description_en": "Communication, self-improvement, motivation, and interpersonal relationships without self-harm." | |
| }, | |
| { | |
| "id": "career_business", | |
| "name_ru": "Карьера, HR и бизнес", | |
| "name_en": "Career, HR, and business", | |
| "description_ru": "Поиск работы, резюме, управление проектами, менеджмент и маркетинг без упоминания конкурентов.", | |
| "description_en": "Job search, resumes, project management, leadership, and marketing without competitor attacks." | |
| }, | |
| { | |
| "id": "creative_writing", | |
| "name_ru": "Творческое письмо и тексты", | |
| "name_en": "Creative writing and editing", | |
| "description_ru": "Художественные рассказы, сценарии, редактирование и рерайт нейтральных текстов.", | |
| "description_en": "Fiction stories, scripts, copywriting, and editing neutral texts." | |
| }, | |
| { | |
| "id": "law_civics_general", | |
| "name_ru": "Общая правовая грамотность", | |
| "name_en": "General legal literacy", | |
| "description_ru": "Общее объяснение понятий права и гражданских процедур без схем обхода закона.", | |
| "description_en": "General explanation of legal terms and civic procedures without law-evasion advice." | |
| }, | |
| { | |
| "id": "internet_media", | |
| "name_ru": "Интернет, медиа и технологии", | |
| "name_en": "Internet, media, and consumer tech", | |
| "description_ru": "Новости гаджетов, соцсетей, онлайн-сервисов и цифровых продуктов.", | |
| "description_en": "Gadgets, social media trends, digital products, and consumer tech news." | |
| }, | |
| { | |
| "id": "environment_nature", | |
| "name_ru": "Природа и экология", | |
| "name_en": "Nature and environment", | |
| "description_ru": "Погода, животный мир, климат и охрана природы без политического активизма.", | |
| "description_en": "Weather, wildlife, natural sciences, and conservation without political activism." | |
| } | |
| ], | |
| "held_out_unseen_topics": [ | |
| { | |
| "id": "astrology_esoterics", | |
| "name_ru": "Астрология и эзотерика", | |
| "name_en": "Astrology and esoterics", | |
| "description_ru": "Гороскопы, карты таро, нумерология, предсказания судьбы и эзотерические практики.", | |
| "description_en": "Horoscopes, tarot readings, numerology, and esoteric practices." | |
| }, | |
| { | |
| "id": "real_estate_mortgage", | |
| "name_ru": "Недвижимость и ипотека", | |
| "name_en": "Real estate and mortgages", | |
| "description_ru": "Покупка, продажа и аренда жилья, ипотечные программы и рынок недвижимости.", | |
| "description_en": "Buying, selling, and renting property, mortgages, and housing markets." | |
| }, | |
| { | |
| "id": "automotive", | |
| "name_ru": "Автомобили и ремонт авто", | |
| "name_en": "Automotive and car repair", | |
| "description_ru": "Выбор автомобилей, обслуживание, ремонт двигателя и правила дорожного движения.", | |
| "description_en": "Car selection, maintenance, repair, and driving." | |
| }, | |
| { | |
| "id": "video_games", | |
| "name_ru": "Видеоигры и киберспорт", | |
| "name_en": "Video games and esports", | |
| "description_ru": "Компьютерные и консольные игры, прохождения, игровые механики и киберспорт.", | |
| "description_en": "PC and console games, walkthroughs, game mechanics, and esports." | |
| }, | |
| { | |
| "id": "climate_activism", | |
| "name_ru": "Экологический активизм", | |
| "name_en": "Climate activism", | |
| "description_ru": "Климатические протесты, радикальные экодвижения и споры о зелёной повестке.", | |
| "description_en": "Climate protests, environmental activist movements, and green-policy debates." | |
| } | |
| ] | |
| } | |