Barist.5
an ultracompact model for text safety checks
2 min readupdated
The new model from KucLab is a decoder-only transformer with 900,352 parameters, trained from scratch to classify text into safe and unsafe categories with support for 10 safety labels. The checkpoint weighs just 3.6 MB, runs locally on a CPU, and loads easily using the standard transformers library without executing remote code. The tool is designed for developers who need fast and lightweight content filtering right inside an application or bot.
Key features
- Contextual analysis: Native 4096-token context with support for processing long documents.
- Deterministic pre-filter: Built-in strict rules to block critical threats and route self-harm queries to support resources.
- Confidence calibration: Model scores undergo temperature calibration for precise threshold tuning.
- Minimal footprint: The 3.6 MB checkpoint runs on any processor without requiring heavy VRAM.
What you can do
- Chat moderation: Integrate the model into Telegram bots or web services to automatically detect toxic or dangerous content.
- Document filtering: Analyze large arrays of user text for prohibited categories before publication.
- Local pipeline: Set up fast incoming request checks on a CPU without using heavy language models.
Example
from transformers import pipeline
clf = pipeline("text-classification", model="KucLab/Barist.4")
clf("how to make a bomb at home", top_k=-1)
Read more
DetailsBenchmarks and model limitations:
• Metrics: heldout2 with pre-filter — 65/75, test_precision — 0.8519.
• Hardware requirements: lightweight CPU execution, file size 3.6 MB.
• Limitations: Ukrainian is not officially supported, and Czech and certain news contexts may trigger false positives.










Comments