Email sorter
a fast local model for filtering incoming emails on CPU
2 min readupdated
Email sorter is a compact 157 MB model built on intfloat/multilingual-e5-small, designed to filter out unwanted emails and cold outreach directly on your device. You define a filter in plain language (such as "sales outreach from agencies" or "travel confirmations"), and the model scores the probability that an incoming email belongs to that category. It runs locally on any laptop CPU in a tenth of a second, keeping your correspondence completely private. Since the model acts strictly as a classifier and doesn't generate text, it's immune to prompt injection attempts hidden inside an email.
Key features
- High speed: processes a single email in roughly 0.1–0.2 seconds on a standard CPU.
- Tiny footprint: the model weighs in at just 157 MB and uses no more than 0.5 GB of memory during inference.
- Complete privacy: all processing happens locally on your machine—no data ever leaves your device.
- High accuracy: outperformed 4 GB language models on a blind benchmark of 200 emails.
What you can do
- Integrate into your email client: set up automatic inbox filtering using custom plain-text descriptions.
- Run via Python: use the
EmailSorterclass from the repository to classify emails in your own scripts. - Integrate in Rust: use the native runtime powered by the candle library without needing heavy dependencies or a GPU.
Example
from sorter import EmailSorter
sorter = EmailSorter.from_pretrained("YCorpLabs/email-sorter")
filters = [
"Unsolicited sales pitches: a stranger offering their own service or product. "
"Agencies, dev shops, SEO, lead generation, recruiters offering candidates.",
"Newsletters, digests and blog posts I subscribed to.",
]
email = """From: Ravi Menon
Subject: Quick question about your roadmap
Hi Alex, we're a 40-person studio that has shipped desktop apps and could take
a mobile client off your plate. Open to a 15-minute call next week?"""
print(sorter.score(filters, email)) # about [0.96, 0.02]Read more
Details• Architecture:
intfloat/multilingual-e5-small (118M parameters, 12 layers), fine-tuned as a cross-encoder.• Benchmarks: 186/200 correct predictions on a blind test, compared to 154/200 for Qwen3 4B.
• Hardware requirements: runs on CPU, using around 0.5 GB of VRAM/RAM.
• Training: roughly 2,900 synthetic emails in English, Norwegian, German, Spanish, and other languages.
• License: MIT.










Comments