# huggingface/setfit

Efficient few-shot learning with Sentence Transformers

Repository: https://github.com/huggingface/setfit
Canonical: https://ross.abutalabs.com/products/setfit
Homepage: https://hf.co/docs/setfit
Language: Jupyter Notebook
License: Apache-2.0
License Family: permissive
Topics: few-shot-learning, nlp, sentence-transformers
Last push: 2026-05-26T10:31:59+00:00

## Health v2 (maintenance only)
Score: 64/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 84, release rhythm 17, longevity 100
- inputs: {"age_days": 1525, "days_push": 99, "days_rel": 393, "gap_med": 116, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2784, forks 264 (observed 2026-08-28T04:07:21.835459+00:00)

## What it is
SetFit is a Python library for efficient, prompt-free few-shot fine-tuning of Sentence Transformers for text classification. It achieves high accuracy with as few as 8 labeled examples per class while training and inferring much faster than large language model approaches.

## Use cases
- train a text classifier with only a handful of labeled examples
- classify customer reviews as positive or negative sentiment
- do zero-shot text classification without labeled training data
- fine-tune multilingual sentence transformers for classification
- compress and speed up classification models with ONNX for production
- perform knowledge distillation and hyperparameter optimization for classifiers

## When to choose
- you have very little labeled data but need an accurate text classifier
- you want fast, cheap training and inference without large LLMs or prompt engineering
- you need multilingual classification using any Sentence Transformer checkpoint
- you want a lightweight model deployable on CPU or optimized via ONNX

## When to avoid
- you need generative tasks like summarization or question answering
- you have abundant labeled data and can fine-tune a full transformer for maximum accuracy
- you need state-of-the-art performance on complex reasoning tasks that require large language models

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, nlp, llm-training
- domain: machine-learning, deep-learning
- platform: python, cross-platform
- tags: few-shot-learning, sentence-transformers, text-classification, zero-shot-classification, embeddings, hugging-face, onnx, natural-language-processing, gpu

## Member repositories
- huggingface/setfit (main) score 64

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:21.835459+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:49:18.819907+00:00, confidence not recorded.
  - readme: https://github.com/huggingface/setfit (fetched 2026-08-28T04:07:21.835459+00:00, sha 5a9d18e49f92)
  - homepage: https://hf.co/docs/setfit (fetched 2026-08-29T09:55:28.021107+00:00, sha 77d523a9a7ef)
  - site_page: https://huggingface.co/docs (fetched 2026-08-29T09:55:28.023990+00:00, sha bdec26667b98)
  - site_page: https://huggingface.co/docs/setfit/quickstart (fetched 2026-08-29T09:55:28.029279+00:00, sha ed01fe48fcdf)
  - site_page: https://huggingface.co/docs/setfit/installation (fetched 2026-08-29T09:55:28.031381+00:00, sha 5b8224d205af)
  - site_page: https://huggingface.co/docs/setfit/tutorials/overview (fetched 2026-08-29T09:55:28.033443+00:00, sha b894041df304)
  - site_page: https://huggingface.co/docs/setfit/tutorials/zero_shot (fetched 2026-08-29T09:55:28.035199+00:00, sha ecb1eb4bce9f)
  - site_page: https://huggingface.co/docs/setfit/tutorials/onnx (fetched 2026-08-29T09:55:28.037113+00:00, sha 962d319980f1)
  - site_page: https://huggingface.co/docs/setfit/how_to/overview (fetched 2026-08-29T09:55:28.039094+00:00, sha c79f8b699a3a)
  - registry_pypi: https://pypi.org/pypi/setfit/json (fetched 2026-08-29T09:55:28.040635+00:00, sha 77335cc238e8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
