█

AI/TLDR

Buy me a coffee
Buy me a coffee

Curator

Build synthetic data pipelines for training and post-training language models

Synthetic DataOpen source
Language
Python
License
Apache-2.0
$pip install bespokelabs-curator

Overview

Bespoke Curator is a Python library for building synthetic data pipelines. You describe how to prompt a model and how to parse its reply, then run that over a dataset to produce clean, structured training data. It works whether you are generating fresh examples or extracting structured fields from existing text.

It is aimed at people who train or post-train language models and need data at scale: building reasoning datasets, distillation sets, or fine-tuning corpora. The library handles the repetitive parts of large generation jobs, including asynchronous requests, caching, and fault recovery, so a run can stop and resume without redoing finished work.

In the synthetic data and labeling space, Curator sits between your prompts and many inference backends. It supports a range of providers through LiteLLM, vLLM, and batch APIs from OpenAI, Anthropic, Gemini, and others, and ships a viewer to watch data as it is generated.

What it does

  • Define generation as a curator.LLM subclass with prompt() and parse() methods over a dataset
  • First-class structured outputs using Pydantic response models
  • Built-in caching, async requests, and fault recovery for large-scale runs
  • Wide backend support via LiteLLM, vLLM, and batch APIs (OpenAI, Anthropic, Gemini)
  • Batch mode to cut token costs on supported providers
  • Viewer to monitor data while it is being generated, plus code execution and fine-tuning integrations (Tinker, Fireworks AI)

Getting started

Install the package, then define an LLM class that says how to prompt the model and how to parse each response into rows of data.

Install Curator

Install the library from PyPI. You will also need the datasets and pydantic packages used in the example.

bashbash
pip install bespokelabs-curator

Define and run a curator.LLM

Subclass curator.LLM, implement prompt() and parse(), use a Pydantic model for structured output, then call the analyzer on your dataset. Set the API key for your chosen model provider (here OpenAI) in your environment first.

pythonpython
from typing import Dict, Literal
from bespokelabs import curator
from pydantic import BaseModel, Field

class Sentiment(BaseModel):
  sentiment: Literal["positive", "negative", "neutral"] = Field(
    description="Sentiment of the review")

class SentimentAnalyzer(curator.LLM):

  def prompt(self, product: Dict):
    return f"Determine the sentiment of the product from the review: {product['review']}"

  def parse(self, product: Dict, response: Sentiment):
    return [{"name": product["name"], "sentiment": response.sentiment}]

dataset = [{"name": "Curator", "review": "Already saved hours in one day of use."},
           {"name": "Bespoke MiniCheck", "review": "Hallucination rates dropped by 90%."}]

analyzer = SentimentAnalyzer(
    model_name="gpt-4o-mini", response_format=Sentiment, batch=False)
reviews = analyzer(dataset)
print(reviews.to_pandas())

Read the docs

See the full documentation for tutorials, how-to guides, and the LLM API reference at docs.bespokelabs.ai.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Generate reasoning or instruction datasets to post-train or distill a smaller model
  • Extract structured fields (sentiment, features, labels) from unstructured text at scale
  • Run large batch generation jobs cheaply using provider batch APIs with caching and resume
  • Curate data and feed it into a fine-tuning step, such as a LoRA via Tinker or Fireworks AI

How Curator compares

Curator alongside other open-source synthetic data tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Easy Dataset★ 15kAn 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.6kA Python library that learns patterns from real tabular data and generates realistic synthetic tables.
distilabel★ 3.4kA framework for building synthetic-data and AI-feedback pipelines that call any LLM to generate and judge datasets.
NeMo Data Designer★ 2.4kAn NVIDIA library for orchestrating LLM-based synthetic-data pipelines with validation and quality scoring.
Augmentoolkit★ 1.9kA tool that turns raw documents into synthetic instruction and conversation datasets for fine-tuning models.
NeMo Curator★ 1.8kAn NVIDIA toolkit for cleaning, deduplicating, and curating large text datasets used to train LLMs.
Curator★ 1.8kBuild synthetic data pipelines for training and post-training language models
ydata-synthetic★ 1.7kA collection of generators for creating synthetic tabular and time-series data from real datasets.