Metadata-Version: 2.1
Name: dataformer
Version: 0.0.2
Summary: Dataformer is a library to create data for LLMs.
Author-email: Dataformer AI <contact@dataformer.ai>
License: Apache-2.0
Project-URL: Documentation, https://dataformer.ai/
Project-URL: Issues, https://github.com/DataformerAI/dataformer/issues
Project-URL: Source, https://github.com/DataformerAI/dataformer
Keywords: llm,synthetic,data
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Requires-Dist: tiktoken
Requires-Dist: aiohttp
Requires-Dist: python-dotenv
Requires-Dist: pytest
Provides-Extra: dev
Requires-Dist: ruff==0.4.5; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: black==24.4.2; extra == "dev"
Provides-Extra: tests
Requires-Dist: pytest>=7.4.0; extra == "tests"
Requires-Dist: pytest-asyncio; extra == "tests"
Requires-Dist: nest-asyncio; extra == "tests"
Requires-Dist: pytest-timeout; extra == "tests"
Requires-Dist: pytest-codspeed; extra == "tests"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"

<div align="center">
  <img src="https://github.com/DataformerAI/dataformer/assets/39311993/b2515523-19a9-4a54-8f12-1f8de24b7a9f"/>
</div>

<h3 align="center">Solving data for LLMs - Create quality synthetic datasets!</h3>

<p align="center">
  <a href="https://x.com/dataformer_ai">
    <img src="https://img.shields.io/badge/twitter-black?logo=x"/>
  </a>
  <a href="https://www.linkedin.com/company/dataformer">
    <img src="https://img.shields.io/badge/linkedin-blue?logo=linkedin"/>
  </a>
  <a href="https://dataformer.ai/discord">
    <img src="https://img.shields.io/badge/Discord-7289DA?&logo=discord&logoColor=white"/>
  </a>
  <a href="https://dataformer.ai/call">
    <img src="https://img.shields.io/badge/book_a_call-00897B?&logo=googlemeet&logoColor=white"/>
  </a>
</p>

## Why Dataformer?

Dataformer empowers engineers with a robust framework for creating high-quality synthetic datasets for AI, offering speed, reliability, and scalability. Our mission is to supercharge your AI development process by enabling rapid generation of diverse, premium datasets grounded in proven research methodologies. 
In the world of AI, compute costs are high, and output quality is paramount. Dataformer allows you to **prioritize data excellence**, addressing both these challenges head-on. By crafting top-tier synthetic data, you can invest your precious time in achieving and sustaining **superior standards** for your AI models.

### One API, Multiple Providers

We integrate with **multiple LLM providers** using one unified API and allow you to make parallel async API calls while respecting rate-limits. We offer the option to cache responses from LLM providers, minimizing redundant API calls and directly reducing operational expenses.

### Research-Backed Iteration at Scale
 
Leverage state-of-the-art research papers to generate synthetic data while ensuring **adaptability, scalability, and resilience**. Shift your focus from infrastructure concerns to refining your data and enhancing your models.

## Installation

Github Source:
```
pip install dataformer@git+https://github.com/DataformerAI/dataformer.git 
```

Using Git:
```
git clone https://github.com/DataformerAI/dataformer.git
cd dataformer
pip install .
```
## Quick Start

AsyncLLM supports various API providers, including:
- OpenAI
- Groq
- Together
- DeepInfra
- OpenRouter

Choose the provider that best suits your needs!

Here's a quick example of how to use Dataformer's AsyncLLM for efficient asynchronous generation:
```python
from dataformer.llms import AsyncLLM
from dataformer.utils import get_request_list, get_messages
from datasets import load_dataset

# Load a sample dataset
dataset = load_dataset("dataformer/self-knowledge", split="train").select(range(3))
instructions = [example["question"] for example in dataset]

# Prepare the request list
sampling_params = {"temperature": 0.7}
request_list = get_request_list(instructions, sampling_params)

# Initialize AsyncLLM with your preferred API provider
llm = AsyncLLM(api_provider="groq", model="llama-3.1-8b-instant")

# Generate responses asynchronously
response_list = get_messages(llm.generate(request_list))
```
## Contribute

We welcome contributions! Check our issues or open a new one to get started.

## Join Community

[Join Dataformer on Discord](https://dataformer.ai/discord)
