Overview
distilabel is a Python framework for generating synthetic data and AI feedback. You write pipelines in code that call large language models to create new examples, label existing ones, and judge their quality, then export the result as a dataset you can use for fine-tuning or evaluation.
It is aimed at engineers and researchers who need to build training and preference datasets without labeling everything by hand. It works for traditional NLP tasks like classification and extraction, as well as generative tasks like instruction following, dialogue, and LLM-as-a-judge scoring.
As a synthetic-data and labeling tool, distilabel sits between your raw inputs and your model training. It uses one unified API across many LLM providers (OpenAI, Anthropic, Mistral, Hugging Face, Ollama, vLLM, and others), so you can swap models without rewriting your pipeline.
What it does
- Pipeline API that chains steps and tasks such as TextGeneration to produce and process data
- One unified interface to many LLM backends, including OpenAI, Anthropic, Mistral, Cohere, Groq, Ollama, vLLM, and Hugging Face Inference Endpoints
- Built-in tasks for synthetic data generation, labeling, and AI feedback (LLM-as-a-judge)
- Optional extras let you install only the LLM integrations you need (for example, hf-inference-endpoints, openai, vllm)
- Integrates with the Hugging Face datasets ecosystem for loading inputs and pushing results to the Hub
- Designed for scalable pipelines with fault tolerance, based on published research methods
Getting started
Install distilabel with the LLM integration you want, then define a Pipeline and run it over a dataset. The example below uses Hugging Face Inference Endpoints.
Install distilabel
Requires Python 3.9 or newer. Add an extra in brackets to pull in a specific LLM integration, such as hf-inference-endpoints.
pip install "distilabel[hf-inference-endpoints]" --upgradeDefine and run a pipeline
Wrap your steps in a Pipeline context, attach an LLM to a task like TextGeneration, then call pipeline.run on a dataset and push the result to the Hub.
from datasets import load_dataset
from distilabel.models import InferenceEndpointsLLM
from distilabel.pipeline import Pipeline
from distilabel.steps.tasks import TextGeneration
with Pipeline() as pipeline:
TextGeneration(
llm=InferenceEndpointsLLM(
model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
generation_kwargs={"temperature": 0.7, "max_new_tokens": 512},
),
)
if __name__ == "__main__":
dataset = load_dataset("distilabel-internal-testing/instructions", split="test")
distiset = pipeline.run(dataset=dataset)
distiset.push_to_hub(repo_id="distilabel-example")Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Generate synthetic instruction or dialogue datasets to fine-tune your own LLM
- Build preference (DPO) datasets by having an LLM judge and rank candidate responses
- Label or filter existing data at scale using AI feedback instead of manual annotation
- Create task-specific evaluation sets that follow methods from recent research papers
How distilabel compares
distilabel alongside other open-source synthetic data tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Easy Dataset | ★ 15k | An application that parses your documents and converts them into structured question-answer datasets for fine-tuning, RAG, and model evaluation. |
| SDV (Synthetic Data Vault) | ★ 3.6k | A Python library that learns patterns from real tabular data and generates realistic synthetic tables. |
| distilabel | ★ 3.4k | Build synthetic-data and AI-feedback pipelines that run on any LLM |
| NeMo Data Designer | ★ 2.4k | An NVIDIA library for orchestrating LLM-based synthetic-data pipelines with validation and quality scoring. |
| Augmentoolkit | ★ 1.9k | A tool that turns raw documents into synthetic instruction and conversation datasets for fine-tuning models. |
| NeMo Curator | ★ 1.8k | An NVIDIA toolkit for cleaning, deduplicating, and curating large text datasets used to train LLMs. |
| Curator | ★ 1.8k | A Python library for generating and curating large synthetic datasets to train and post-train language models. |
| ydata-synthetic | ★ 1.7k | A collection of generators for creating synthetic tabular and time-series data from real datasets. |

