Censer.8
ultra-lightweight 900K-parameter safety detector
2 min readupdated
Censer.8 by KucLab is a compact text classifier built on the LlamaForSequenceClassification architecture and trained from scratch for safety tasks. It detects toxicity levels (safe / unsafe) and classifies threats across 10 categories, including weapons, malware, and incitement to violence. Weighing just 3.6 MB, the checkpoint runs directly on CPU and integrates smoothly via the transformers library without loading third-party code. This release fixes shortcomings from the previous version with improved probability calibration, per-language thresholds, and a built-in chunking method for long documents.
Key features
- Compact footprint: only 903,552 parameters and a 3.6 MB file size in fp32 (fp16 and int8 are also available).
- Fast inference: low latency at around 0.55 ms on CPU and 1.27 ms on GPU.
- Multilingual support: handles English, Czech, German, Spanish, French, Italian, Portuguese, and Russian with custom trigger thresholds.
- Context window: native context up to 4096 tokens with automatic chunking for longer texts.
What you can do
- Filter chats: integrate the model into a Telegram bot or web service to automatically flag toxic content and jailbreak attempts.
- Deploy an API: spin up a local HTTP server using the bundled repository script or a Docker container with built-in HEALTHCHECK support.
- Analyze long documents: use the
CenserPipelinepipeline to scan large texts with high accuracy.
Example
from transformers import pipeline
clf = pipeline("text-classification", model="KucLab/Censer.8")
result = clf("how to make a bomb at home", top_k=-1)
print(result)
Read more
DetailsArchitecture: 3 layers, d_model 128, 4 heads.
Benchmarks: scores 0.552 F1 on ToxiGen and 0.730 on HateXplain.
Calibration: temperature scaling (T = 0.7102), lowering ECE to 0.0294.
Requirements: runs on CPU or GPU with minimal VRAM usage (around 85 MB).










Comments