Downloads · 30 days
616
15% of all-time downloads
distil-labs/distil-email-classifier
distil-email-classifier is a text generation model from distil-labs. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<div align="center" <img src="https://github.com/distil-labs/badges/blob/main/distillabs-logo.svg?raw=true" width="40%" alt="distil labs" / </div
Downloads · 30 days
616
15% of all-time downloads
All-time downloads
4.2K
Public
Parameters
596M
3.6 GB on disk
Likes
11
Public
Click a slice to open those files.
.gguf2.4 GB · 66%
From the Hugging Face model README
We built a fully local Gmail auto-labeler with n8n + a fine-tuned 0.6B model (no email content sent to cloud LLMs)
Most of our inboxes are a mix of useful and distracting. Labels can help making order from the chaos - but labelling all emails manually takes time too.
We put together a setup that auto-labels Gmail locally, so email content does not go to external LLM APIs.
Billing, Newsletter, Work, Personal, Promotional, Security, Shipping, Travel, Spam, Other
| Model | Accuracy |
|---|---|
| Teacher (GPT-OSS-120B) | 93% |
| Base student (Qwen3-0.6B) | 38% |
| Fine-tuned student (Qwen3-0.6B) | 93% |
| Student model | Qwen3-0.6B (600M parameters) |
|---|---|
| Teacher model | GPT-OSS-120B |
| Training method | Knowledge distillation + supervised fine-tuning (SFT) |
| Seed data | 154 examples |
| Training data | 10,000 synthetic email examples across 10 categories generated using our data synthesis pipeline |
Installation Steps:
# Install Node.js (if not installed)
brew install node
# Install n8n globally
npm install -g n8n
# Start n8n
n8n
Access n8n at: http://localhost:5678
#install huggingface CLI if not instlalled
python3 -m pip install -U huggingface_hub
#download the model
hf download distil-labs/distil-email-classifier --local-dir ./distil-email-classifier
#install Ollama or you can download from https://ollama.com/download
brew install ollama
#start Ollama
ollama serve
#navigate to your model folder
cd ./distil-email-classifier
#create model in ollama
ollama create email-classifier -f Modelfile
#verify the model is created or not
ollama list
#run the model
ollama run email-classifier "test"
#check the model is running or not
ollama ps
Expected output:
NAME ID SIZE PROCESSOR CONTEXT UNTIL
email-classifier:latest 695190b0f07f 3.5 GB 100% GPU 4096 4 minutes from now
#to keep model running forver run the below commands
OLLAMA_KEEP_ALIVE=-1 ollama run email-classifier "test"
Now shows Forever instead of 4 minutes from now.
Once you finish the setup, open n8n in your browser (http://localhost:5678), sign up with your email, and you get an access code from n8n for your email, you can update the access code.
Download the workflow JSON files from our GitHub repository: https://github.com/distil-labs/distil-n8n-gmail-automation
To connect your Gmail you need to setup Gmail OAuth (Google cloud console) you can find detailed steps on this on github readme.
Before running the workflow, create all 10 labels manually in your Gmail account. Use the "AI/" prefix to match the model output (AI/Billing, AI/Work, AI/Travel, and so on).
Once this is running, New messages get labeled automatically.
If you want different labels, you can distill a custom version of this classifier on the distil labs platform. When you sign up, you get two free training credits to train the model.
Full Write up: https://www.distillabs.ai/blog/building-a-local-agent-for-email-classification-using-n8n-distil-labs
workflows: https://github.com/distil-labs/distil-n8n-gmail-automation
Model: https://huggingface.co/distil-labs/distil-email-classifier