█

AI/TLDR

Me pague um café
Me pague um café

distilabel

Crie pipelines de dados sintéticos e de feedback com IA que rodam em qualquer LLM

Synthetic DataCódigo aberto
Idioma
Python
Licença
Apache-2.0
$pip install "distilabel[hf-inference-endpoints]" --upgrade
EM RESUMO

What is distilabel?

distilabel is Crie pipelines de dados sintéticos e de feedback com IA que rodam em qualquer LLM. It sits in the Synthetic Data category of the Data & Labeling tools and is open-source, written in Python and licensed Apache-2.0. To get started: instalar o distilabel.

Visão geral

distilabel é um framework Python para gerar dados sintéticos e feedback com IA. Você escreve pipelines em código que chamam grandes modelos de linguagem para criar exemplos novos, rotular os existentes e avaliar a qualidade deles, e depois exporta o resultado como um dataset que pode usar em fine-tuning ou avaliação.

Ele é voltado para engenheiros e pesquisadores que precisam criar datasets de treinamento e de preferência sem rotular tudo à mão. Funciona para tarefas tradicionais de NLP, como classificação e extração, e também para tarefas generativas, como seguimento de instruções, diálogo e pontuação com LLM-as-a-judge.

Como ferramenta de dados sintéticos e rotulagem, o distilabel fica entre seus dados brutos e o treinamento do modelo. Ele usa uma API unificada para muitos provedores de LLM (OpenAI, Anthropic, Mistral, Hugging Face, Ollama, vLLM e outros), então você pode trocar de modelo sem reescrever seu pipeline.

O que faz

  • API de pipelines que encadeia etapas e tarefas, como TextGeneration, para produzir e processar dados
  • Interface unificada para vários backends de LLM, incluindo OpenAI, Anthropic, Mistral, Cohere, Groq, Ollama, vLLM e Hugging Face Inference Endpoints
  • Tarefas nativas para geração de dados sintéticos, rotulagem e feedback com IA (LLM-as-a-judge)
  • Extras opcionais permitem instalar só as integrações com LLM de que você precisa (por exemplo, hf-inference-endpoints, openai, vllm)
  • Integra com o ecossistema de datasets do Hugging Face para carregar entradas e enviar resultados ao Hub
  • Feito para pipelines escaláveis, com tolerância a falhas, baseado em métodos de pesquisas publicadas

Primeiros passos

Instale o distilabel com a integração de LLM que você quiser, depois defina um Pipeline e execute-o sobre um dataset. O exemplo abaixo usa Hugging Face Inference Endpoints.

Instalar o distilabel

Requer Python 3.9 ou mais recente. Adicione um extra entre colchetes para incluir uma integração específica de LLM, como hf-inference-endpoints.

bashbash
pip install "distilabel[hf-inference-endpoints]" --upgrade

Definir e executar um pipeline

Coloque suas etapas dentro de um contexto Pipeline, associe um LLM a uma tarefa como TextGeneration, depois chame pipeline.run em um dataset e envie o resultado para o Hub.

pythonpython
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 repositório oficial para as novidades.

Quando usar

  • Gerar datasets sintéticos de instruções ou diálogos para fazer fine-tuning do seu próprio LLM
  • Criar datasets de preferência (DPO) fazendo um LLM avaliar e ranquear respostas candidatas
  • Rotular ou filtrar dados existentes em escala com feedback de IA, em vez de anotação manual
  • Criar conjuntos de avaliação específicos para tarefas, seguindo métodos de artigos de pesquisa recentes

How distilabel compares

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

FerramentaEstrelasO que faz
Easy Dataset★ 15.2kAn 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.5kCrie pipelines de dados sintéticos e de feedback com IA que rodam em qualquer LLM
NeMo Data Designer★ 2.4kAn NVIDIA library for orchestrating LLM-based synthetic-data pipelines with validation and quality scoring.
NeMo Curator★ 1.9kAn NVIDIA toolkit for cleaning, deduplicating, and curating large text datasets used to train LLMs.
Augmentoolkit★ 1.9kA tool that turns raw documents into synthetic instruction and conversation datasets for fine-tuning models.
Curator★ 1.8kA Python library for generating and curating large synthetic datasets to train and post-train language models.
ydata-synthetic★ 1.7kA collection of generators for creating synthetic tabular and time-series data from real datasets.