SetFit

SetFit

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

SetFit is an efficient framework for few-shot text classification developed by Hugging Face, published on GitHub with about 2,800 stars. It fine-tunes Sentence Transformers with only a handful of labeled examples per class and still rivals models trained on thousands of examples.

Overview

SetFit works in two steps: it fine-tunes a Sentence Transformer on a small number of text pairs, then trains a lightweight classification head on the resulting embeddings. Because it needs no prompts or verbalizers, it avoids the brittleness of prompt-based few-shot methods while training an order of magnitude faster than approaches built on very large language models. It supports multilingual models, works well in low-data regimes common in real projects, and integrates with the Hugging Face Hub for sharing trained models. The project is Apache-2.0 licensed and still actively maintained in 2026. Trained SetFit models can be pushed to the Hugging Face Hub in one call, and the repo includes notebooks reproducing the paper’s benchmark results across classification datasets.

Key Features

  • Few-shot classification with as few as 8 examples per class
  • No prompts or verbalizers required
  • Fast training on modest hardware compared with LLM-based methods
  • Multilingual support through Sentence Transformers models
  • One-line training API with Hugging Face Hub integration
  • Strong accuracy on standard few-shot benchmarks

๐Ÿ’ณ Pricing

SetFit is completely free and open source under the Apache-2.0 license. There are no paid tiers or hosted versions; you train and run models entirely on your own infrastructure.

Who Is It For

SetFit is for NLP practitioners and data teams who need accurate text classifiers but only have a small labeled dataset and limited compute budget.

๐Ÿš€ Visit SetFit Official Site

๐Ÿšฉ Report an issue