# Synthetic Data Generator

> Build training datasets from natural-language descriptions

- Category: Data & Labeling / Synthetic Data
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/argilla-io/synthetic-data-generator
- Canonical page: https://ai-tldr.dev/tools/synthetic-data-generator/

## In short

Synthetic Data Generator is a tool from Argilla for creating datasets used to train and fine-tune language models. You describe the kind of data you want in plain language, and it uses distilabel and an LLM to generate matching examples. It sits in the Synthetic Data category of the Data & Labeling tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

Synthetic Data Generator is a tool from Argilla for creating datasets used to train and fine-tune language models. You describe the kind of data you want in plain language, and it uses distilabel and an LLM to generate matching examples. It runs as a Gradio app you can launch locally or on Hugging Face Spaces.

It targets ML engineers and researchers who need custom datasets but do not want to label everything by hand. You can iterate on a small sample first, then scale up to a full dataset, and push the result to the Hugging Face Hub or to Argilla for review and curation.

Within the synthetic data and labeling space, it focuses on three task types: text classification, chat data for supervised fine-tuning, and retrieval-augmented generation. Because each pipeline is built on distilabel, you can swap the LLM or adjust the pipeline steps. Note that the original authors have moved on and now point users to a successor project, aisheets.

## What it does

- Describe the dataset you want in natural language and generate samples to iterate on before producing the full-scale dataset
- Supports text classification, chat data for supervised fine-tuning, and retrieval-augmented generation tasks
- Built on distilabel, so you can change the LLM or customize the pipeline steps
- Works with multiple providers via environment variables: Hugging Face Inference, OpenAI-compatible APIs, Ollama, and vLLM
- Push generated datasets to the Hugging Face Hub or to Argilla for curation, or save them to a local directory
- Tunable generation through env vars like MAX_NUM_ROWS, MAX_NUM_TOKENS, and DEFAULT_BATCH_SIZE

## Getting started

Install the package, set a Hugging Face token, and launch the Gradio app to start generating datasets.

1. Install the package

   Install from PyPI with pip.

```bash
pip install synthetic-dataset-generator
```

2. Set your Hugging Face token

   Set HF_TOKEN to push datasets to the Hub and use free completions from Hugging Face Inference Endpoints.

```bash
export HF_TOKEN=hf_...
```

3. Launch the app

   Call launch() to start the Gradio interface, then describe the dataset you want.

```python
from synthetic_dataset_generator import launch

launch()
```

4. Choose a different model or provider (optional)

   Override the model and base URL with env vars to use OpenAI-compatible APIs, Ollama, or vLLM instead of the default.

```bash
export MODEL=meta-llama/Meta-Llama-3.1-8B-Instruct
```

## When to use it

- Bootstrap a text-classification dataset for a new domain when you have no labeled data yet
- Generate chat conversations for supervised fine-tuning of an instruction-following model
- Create question-answer pairs to build or evaluate a retrieval-augmented generation system
- Prototype a sample dataset quickly, then scale it up and push it to the Hugging Face Hub or Argilla for review
