Instructions to use borodutchlabs/laya-telegram-spam with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use borodutchlabs/laya-telegram-spam with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
laya-telegram-spam
A spam classifier for Telegram group messages. It is
laya-multilingual fine-tuned on the verdicts of
Jev, TypeSafe's moderation model. Since October 2026 it has made every decision of
@jev_antispam_bot (source), a free
anti-spam bot for Telegram groups that deletes only high-confidence spam and exempts admins.
One forward pass returns a probability. The model generates no text. It answers these questions:
spam: should a group moderator delete this message as spam? That covers shilling, phishing, wallet drainers, "DM me" funnels, unsolicited paid-work recruitment, fake crypto-recovery helpers and adult profile bait.context_message_0tocontext_message_9: is each of the author's recent messages part of the same spam pitch? The bot deletes those too, so a pitch split over several messages goes away together.
The exact wording of every question is in questions.json.
Use
import json, os
from huggingface_hub import snapshot_download
from laya import Router # pip install laya
path = snapshot_download("borodutchlabs/laya-telegram-spam")
router = Router(models={"multilingual": path}, default="multilingual", preload=True)
questions = json.load(open(os.path.join(path, "questions.json")))
state = {
"message": {"text": "Lost crypto to a scam? Our recovery expert got my funds back, DM @helper"},
"recentMessages": [],
}
p = router.predict(state, {"spam": questions["spam"]}, model="multilingual")["answers"]["spam"]["noul"]
delete = p >= 0.81 # the gate the bot uses
The bot sends a richer state, built in its src/: the message, the author's recent messages, the message it replies
to (preview), inline buttons, link previews and the sender's profile. The model works best with the same shape.
Everything in the state is treated as untrusted data, never as instructions.
Training
- Data: 5,540 messages from groups that use @jev_antispam_bot, captured over a few days in early October 2026, 13% of them deleted by Jev. Each carries Jev's decision score, plus the campaign links for deleted messages.
- Held out: the newest 15% (978 messages, deduplicated).
- Recipe:
laya-train --base multilingual --epochs 3. - Not published: the training data.
Evaluation
Agreement with Jev's delete decision on the 978 held-out messages (99 deleted by Jev):
| Gate | Agreement | Precision | Recall |
|---|---|---|---|
| 0.70 | 92.4% | 0.58 | 0.91 |
| 0.81 (the bot's gate) | 95.4% | 0.82 | 0.70 |
| 0.90 | 94.8% | 1.00 | 0.49 |
"Precision" here is against Jev, so a "false positive" is a message Jev kept. Median latency is 38 ms on an Apple GPU and about 400 ms on a few CPU threads.
Limits
- It reads text, links and metadata. Media contents and avatars are not looked at.
- It learned Jev's judgement, including Jev's mistakes, from a few days of traffic in a limited set of groups, so new spam styles can get through. Keep admins exempt and give people a way to report mistakes, as the bot does.
License
Apache-2.0, the same as the base model.
- Downloads last month
- 26
Model tree for borodutchlabs/laya-telegram-spam
Base model
convaiinnovations/laya-multilingual