AI Feedback (AIF) framework
Project description
⚗️ distilabel
Synthesize data for AI and add feedback on the fly!
Distilabel is the framework for synthetic data and AI feedback for AI engineers that require high-quality outputs, full data ownership, and overall efficiency.
If you just want to get started, we recommend you check the documentation. Curious, and want to know more? Keep reading!
Why use Distilabel?
Whether you are working on a predictive model that computes semantic similarity or the next generative model that is going to beat the LLM benchmarks. Our framework ensures that the hard data work pays off. Distilabel is the missing piece that helps you synthesize data and provide AI feedback.
Improve your AI output quality through data quality
Compute is expensive and output quality is important. We help you focus on data quality, which tackles the root cause of both of these problems at once. Distilabel helps you to synthesize and judge data to let you spend your valuable time on achieveing and keeping high-quality standards for your data.
Take control of your data and models
Ownership of data for fine-tuning your own LLMs is not easy but Distilabel can help you to get started. We integrate AI feedback from any LLM provider out there using one unified API.
Improve efficiency by quickly iterating on the right research and LLMs
Synthesize and judge data with latest research papers while ensuring flexibility, scalability and fault tolerance. So you can focus on improving your data and training your models.
🏘️ Community
We are an open-source community-driven project and we love to hear from you. Here are some ways to get involved:
-
Community Meetup: listen in or present during one of our bi-weekly events.
-
Slack: get direct support from the community.
-
Roadmap: plans change but we love to discuss those with our community so feel encouraged to participate.
What do people build with Distilabel?
Distilabel is a tool that can be used to synthesize data and provide AI feedback. Our community uses Distilabel to create amazing datasets and models, and we love contributions to open-source ourselves too.
- The 1M OpenHermesPreference is a dataset of ~1 million AI preferences derived from teknium/OpenHermes-2.5. It shows how we can use Distilabel to synthesize data on an immense scale.
- Our distilabeled Intel Orca DPO dataset and the improved OpenHermes model,, show how we improve model performance by filtering out 50% of the original dataset through AI feedback.
- The haiku DPO data outlines how anyone can create a dataset for a specific task and the latest research papers to improve the quality of the dataset.
👨🏽💻 Installation
pip install distilabel --upgrade
Requires Python 3.8+
In addition, the following extras are available:
anthropic
: for using models available in Anthropic API via theAnthropicLLM
integration.cohere
: for using models available in Cohere via theCohereLLM
integration.argilla
: for exporting the generated datasets to Argilla.hf-inference-endpoints
: for using the Hugging Face Inference Endpoints via theInferenceEndpointsLLM
integration.hf-transformers
: for using models available in transformers package via theTransformersLLM
integration.litellm
: for usingLiteLLM
to call any LLM using OpenAI format via theLiteLLM
integration.llama-cpp
: for using llama-cpp-python Python bindings forllama.cpp
via theLlamaCppLLM
integration.mistralai
: for using models available in Mistral AI API via theMistralAILLM
integration.ollama
: for using Ollama and their available models viaOllamaLLM
integration.openai
: for using OpenAI API models via theOpenAILLM
integration, or the rest of the integrations based on OpenAI and relying on its client asAnyscaleLLM
,AzureOpenAILLM
, andTogetherLLM
.vertexai
: for using Google Vertex AI proprietary models via theVertexAILLM
integration.vllm
: for using vllm serving engine via thevLLM
integration.
Example
To run the following example you must install distilabel
with both openai
and argilla
extras:
pip install "distilabel[openai,argilla]" --upgrade
Then run the following example:
from distilabel.llms import OpenAILLM
from distilabel.pipeline import Pipeline
from distilabel.steps import LoadHubDataset, TextGenerationToArgilla
from distilabel.steps.tasks import TextGeneration
with Pipeline(
name="simple-text-generation-pipeline",
description="A simple text generation pipeline",
) as pipeline:
load_dataset = LoadHubDataset(
name="load_dataset",
output_mappings={"prompt": "instruction"},
)
generate_with_openai = TextGeneration(
name="generate_with_gpt3.5", llm=OpenAILLM(model="gpt-3.5-turbo")
)
to_argilla = TextGenerationToArgilla(name="to_argilla")
load_dataset.connect(generate_with_openai)
generate_with_openai.connect(to_argilla)
if __name__ == "__main__":
distiset = pipeline.run(
parameters={
"load_dataset": {
"repo_id": "distilabel-internal-testing/instruction-dataset-mini",
"split": "test",
},
"generate_with_gpt35": {
"llm": {
"generation_kwargs": {
"temperature": 0.7,
"max_new_tokens": 512,
}
}
},
"to_argilla": {
"dataset_name": "text-generations-with-gpt35",
"dataset_workspace": "admin",
},
},
)
distiset.push_to_hub(
"distilabel-internal-testing/instruction-dataset-mini-with-generations"
)
Distilabel integrates smoothly with Argilla and provides all the necessary configurations to make giving a final human touch as easy as possible.
Badges
If you build something cool with distilabel
consider adding one of these badges to your dataset or model card.
[<img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-light.png" alt="Built with Distilabel" width="200" height="32"/>](https://github.com/argilla-io/distilabel)
[<img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-dark.png" alt="Built with Distilabel" width="200" height="32"/>](https://github.com/argilla-io/distilabel)
Contribute
To directly contribute with distilabel
, check our good first issues or open a new one.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for distilabel-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35ed6a52b030fff15a8d517d94f2496107a7560a3295143811061a02f9ce9f94 |
|
MD5 | 45953490417d22fe934cddf1c3e6d847 |
|
BLAKE2b-256 | a68d363a24b65d5b292b4e9eb3fe028cc72fc9e71eaa1c0ca3c2a3b3f8fd6e2f |