Skip to main content

AI-powered dataset augmentation tool using Braintrust proxy

Project description

AUGR - AI Dataset Augmentation Tool

AI-powered dataset augmentation tool using Braintrust proxy with structured outputs.

Features

  • 🤖 Structured AI Outputs: Uses OpenAI's beta.chat.completions.parse with Pydantic schemas
  • 🧠 Braintrust Integration: Works with Braintrust proxy for multiple AI providers
  • 🔄 Interactive Workflows: Guided dataset augmentation with iterative refinement
  • 📊 Schema-aware Generation: Automatically infers and respects dataset schemas
  • Modern Tooling: Built with uv for fast dependency management

Installation

Option 1: Install from PyPI

# Install globally
pip install augr

# Or with pipx (recommended for CLI tools)
pipx install augr

# Or with uv
uv tool install augr

# Then use anywhere
augr

Option 2: Install from GitHub

# Install latest version
pip install git+https://github.com/Marviel/augr.git

# Or with uv
uv tool install git+https://github.com/Marviel/augr.git

# Then use anywhere
augr

Option 3: Development Setup

For development or local installation:

git clone https://github.com/Marviel/augr.git
cd augr
uv sync --all-extras --dev

# Test the installation
uv run python test_installation.py

# Use anywhere
uv run augr

Usage

Environment Variables

Create a .env file with:

BRAINTRUST_API_KEY=your_braintrust_api_key_here
# Optional: BRAINTRUST_BASE_URL=https://api.braintrust.dev/v1/proxy

Running

The tool provides an interactive CLI with two main modes:

  1. Guided Dataset Augmentation: Interactive workflow with iterative refinement
  2. Direct JSON Upload: Upload pre-generated samples directly
uv run python run_augr.py

Development

Install with development dependencies:

uv pip install -e ".[dev]"

Run linting and formatting:

uv run black .
uv run ruff check .

Architecture

  • ai_client.py: Core AI interface with structured outputs
  • augmentation_service.py: Main service for dataset augmentation
  • cli.py: Interactive command-line interface
  • models.py: Pydantic models for data structures
  • braintrust_client.py: Braintrust API integration

API Example

from augr.ai_client import create_ai
from pydantic import BaseModel

class Response(BaseModel):
    message: str
    confidence: float

# Create AI client (reads BRAINTRUST_API_KEY from env)
ai = create_ai(model="gpt-4o", temperature=0.0)

# Generate structured output
result = await ai.gen_obj(
    schema=Response,
    messages=[{"role": "user", "content": "Hello!"}],
    thinking_enabled=True  # For reasoning models
)

print(result.message)  # Structured output

Contributing

Making a Release

This project uses automated releases via GitHub Actions:

  1. Update version in pyproject.toml
  2. Create and push a git tag: git tag -a v0.2.0 -m "Release v0.2.0" && git push origin v0.2.0
  3. GitHub Actions will automatically:
    • Run tests
    • Build the package
    • Upload to PyPI
    • Create GitHub release

See RELEASE.md for detailed instructions.

Development

# Clone and setup
git clone https://github.com/Marviel/augr.git
cd augr
uv sync --all-extras --dev

# Run tests
uv run python test_installation.py

# Format code
uv run black .
uv run ruff check --fix .

# Build package
uv run python -m build

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

augr-0.1.2.tar.gz (108.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

augr-0.1.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file augr-0.1.2.tar.gz.

File metadata

  • Download URL: augr-0.1.2.tar.gz
  • Upload date:
  • Size: 108.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for augr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ba2116e8d5a731f717ac3b8bf6f50a5d312431332ff3368303b369a9d2b2302c
MD5 49a91682ce9a34582652515f8afc855f
BLAKE2b-256 aeaaf7cd26f90897605f3d827e031e480feaaffb01154eeff79b5b9c4a18e52d

See more details on using hashes here.

File details

Details for the file augr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: augr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for augr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d74c36dd186a7a98ce8c525460f6b1fbeffece94a3f89bc9afc5ba750792b75e
MD5 522953516e04d369585e898326c08d2e
BLAKE2b-256 baf44b35345687bf9f9e9bca213072cd48b086ae4610142885418f3ffe00b34b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page