Best Small Models for Text Classification on a Laptop (2026)
Small models for text classification you can run on a laptop: spam, intent, routing and moderation with no API bill, picked from independent tests by Red Hat's AI safety team, Oliver Borchers and the BTZSC benchmark.
What we track: Size · Memory · Labels needed
- Size:
- Parameter count. Smaller models run faster and on cheaper hardware.
- Memory:
- The download size or memory it needed when someone ran it, with the setup named.
- Labels needed:
- How many labeled examples you need before it works on your own categories.
These numbers inform the order but don’t set it: an editor ranks the picks, weighing them against what people who use them say, since stars and downloads also reflect hype and marketing.
Turn each text into an embedding and train a logistic regression on a few dozen labeled examples per class: in Borchers' test that recipe, with a larger embedder, matched Jev. EmbeddingGemma is the small embedder to use, scoring 87.6 on MTEB's English classification tasks, about nine points above bge-large. The catch is Google's Gemma license, which gates the download. Pricing: free, under Google's Gemma terms.
- Size 308M parameters
- Memory Under 200 MB RAM when quantized
- Labels needed A few dozen per class (shown with a bigger embedder)
The model behind the Made with Jev build, and fine-tuned it still edges out newer encoders on accuracy. In Red Hat's prompt-injection test a fine-tuned 200M DeBERTa scored 89.0% in 54 ms on an M1, ahead of Jev's 86.4%. It reads only 512 tokens, works in English only, and needs a few hundred labeled examples before it's useful. Pricing: free (MIT).
- Size Backbone 86M (base) or 304M (large)
- Memory Large: 0.8 GB RAM, 1.1 GB GPU on an M1 Pro
- Labels needed A few hundred: 500 matched classic ML on 5,000
- Type
- Encoder you fine-tune on your labels
- Runs on
- MacBook Pro M1, CPU only
- Tested on
- MacBook Pro M1 CPU: 54-80 ms a prompt (base)
- License
- MIT
- Context
- 512 tokens
Reads up to 8,192 tokens, so it handles long support tickets, emails, logs and agent traces that would overflow DeBERTa. Fine-tuned in Borchers' test, the large version sorted fresh arXiv papers at 87.0%, a hair above Jev. Its famous speed depends on an Nvidia GPU with Flash Attention, and on a laptop it runs about as fast as DeBERTa-v3. Pricing: free (Apache 2.0).
- Size 149M (base) or 395M (large)
- Memory 599 MB download (base)
- Labels needed Hundreds; thousands for the best results
Needs no labels, speaks Jev's API, and came closest to Jev of the open models that fit a 16 GB laptop. On a base M4 MacBook, Marco Mornati found it matched Jev on routing (90% vs 89%) and beat it on risk flags. Each decision took about 3.9 seconds there, so anything interactive wants a Pro or Max chip. Pricing: free (Apache 2.0).
- Size 9B parameters
- Memory 6.2 GB download, 7 to 8.6 GB peak (4-bit MLX)
- Labels needed None; new categories need no retraining
- Type
- Decision model, same API as Jev
- Runs on
- Apple silicon Mac, 16 GB+ (4-bit MLX)
- Tested on
- 16 GB base M4 MacBook: 3.9 s a decision
- License
- Apache 2.0
- Context
- 64K tokens
If you'd rather fine-tune a small LLM than an encoder, start here. In distil labs' study of 15 small models, a LoRA-tuned Qwen3-4B-Instruct-2507 matched or beat its 120B-plus teacher on two of three classification tasks, and Apache 2.0 lets you ship it. Untuned, results swing with the prompt: one test got 53% or 78% from the newer Qwen3.5 4B depending on how the answer was read. Pricing: free (Apache 2.0).
- Size 4.0B (3.6B non-embedding)
- Memory 3.3 GB peak (4-bit MLX)
- Labels needed Few-shot prompt; tuned on 10,000 synthetic examples
Hugging Face's few-shot trainer builds a classifier from 8 to 64 examples per class by fine-tuning a small sentence-transformer, and it trains on a laptop CPU in minutes. On a customer-review dataset in its paper, 8 examples per class rivaled RoBERTa-large trained on all 3,000. A plain embedding plus logistic regression scored about the same in the Model2Vec team's benchmark, so try that first. Pricing: free (Apache 2.0).
- Size 110M (MPNet body) or 355M (RoBERTa-large)
- Memory 70 MB (MiniLM body) or 420 MB (MPNet body)
- Labels needed As few as 8 per class
Zero-shot labels on a plain CPU: GLiClass scores every label in one pass, so a long label list barely slows it down, and the 32.7M edge model answers in about 9 ms on an M4 Max. Use it when labels change too often to train anything. Accuracy is the price: on Borchers' fresh papers the large version scored 64.3% to Jev's 86.3%. Pricing: free (Apache 2.0).
- Size 32.7M (edge) to 439M (large)
- Memory 131 MB (edge) to 1.75 GB (large) download
- Labels needed None; you pass labels at run time
Built into macOS on Apple silicon Macs with Apple Intelligence, so there's no model to download and no per-token cost. Constrain the answer to an enum and it stays on your label list: in one developer's test it kept to the list in 15 of 15 runs, where free text invented categories. The context window is just 4,096 tokens, and the model changes with each OS update. Pricing: free, built into macOS.
- Size About 3B parameters
- Memory Apple Intelligence: up to 8 to 14 GB of storage
- Labels needed None; give it your labels as an enum
The smallest modern encoders, from Johns Hopkins, for classifiers that must run on a CPU or in a browser tab. A community fine-tune of the 17M model scored 94.2 F1 on PII extraction against GPT-4o-mini's 78.7, and credential-line-32m below is built on the 32M. The tiny sizes give up accuracy on general tasks: the 17M averages 79.2 on GLUE. Pricing: free (MIT).
- Size 17M, 32M or 68M parameters
- Memory 17M: 67 MB ONNX file, 17 MB in int8
- Labels needed Many: credential-line-32m used 87,707
Finds names, contact details, account numbers, private dates and secrets so you can redact text before it reaches a cloud model or a training set. It scored 0.96 F1 on the PII-Masking-300k benchmark and handled about one document a second on a 16 GB M2 MacBook Pro. One independent test caught it missing AWS keys and database connection strings, so keep a regex scanner in front. Pricing: free (Apache 2.0).
- Size 1.5B total, 50M active
- Memory 2.8 GB weights, under 6 GB RAM
- Labels needed None (8 fixed labels)
- Type
- PII detector (token classifier)
- Runs on
- A laptop or a web browser, per OpenAI
- Tested on
- 16 GB M2 MacBook Pro: about 1 s a document
- License
- Apache 2.0
- Context
- 128,000 tokens
Meta's small classifier for jailbreaks and "ignore previous instructions" attacks hidden in prompts, documents and tool output, run before an agent acts. Out of the box it's close to useless: against 629 realistic agent attacks, the default threshold caught 6. Lowered to 0.003, the 86M caught 97 to 100% at about 5% false alarms, so tune it on your own traffic. Pricing: free under the Llama 4 Community License.
Reads one line of code, config or logs and scores whether it holds a literal credential, in about 4 ms on a desktop CPU. On its author's holdout of human-written lines it scored 0.86 F1, where detect-secrets managed 0.51. It's a one-author project that misses about one credential in five, so run it beside gitleaks rather than instead of it. Pricing: free (MIT).
- Size 32M parameters
- Memory 128 MB ONNX file (fp32)
- Labels needed None (fixed: credential or not)
How to choose
It started with a build on Made with Jev: a developer swapped Jev, TypeSafe's hosted decision model, for a DeBERTa large classifier on a base M1 Mac to decide, inside a Claude Code hook, whether a message was just a question, and found it just as fast and just as good for that job. Jev is the yardstick here. In Borchers' field test on 400 fresh arXiv papers it scored 86.3% with no training, for about $0.04 per million input tokens.
How to choose comes down to labels. With none, try Clef-flash on a 16 GB Mac with a Pro or Max chip, or GLiClass on anything else. With a few dozen examples per label, embed the text and train a logistic regression on top. With a few hundred, fine-tune DeBERTa-v3 or ModernBERT. No labels yet? Have Jev or a large LLM label a few hundred of your own examples, then train the small model on those.
Skip facebook/bart-large-mnli, still the default in Hugging Face's zero-shot pipeline: it dates from 2019, runs a full pass for every label, and trails newer models in both the 28-task zero-shot benchmark and BTZSC. The list is ordered by how well each model did in those tests for the work it takes to set up, with the specialists for PII, prompt injection and secrets after the general-purpose models.
Numbers checked October 5, 2026.
More lists like this
Best Local LLMs for Coding (2026)
The best local LLM for coding depends on how much memory your machine has. This list ranks open-weight models you can run yourself, by independent…
OpenRouter Alternatives (2026): Cheaper or Self-Hosted
The best OpenRouter alternatives, hosted routers and gateways you run yourself, picked from developers who switched and reviewers who measured them.