Skip to main content

Claude Code for ML developers. Build and deploy ML models from your terminal. Accelerate your ML pipeline with Exponent.

Reason this release was yanked:

broken

Project description

Exponent-ML

Prompt + Dataset โ†’ Trained + Deployed ML Models in One Line

Exponent-ML is a CLI tool that lets anyone create, train, and deploy machine learning models by describing their task and uploading a dataset. The tool uses LLMs to generate runnable training pipelines based on both user intent and real dataset structure, with optional deployment to GitHub or cloud platforms.

๐Ÿš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/yourusername/exponent-ml.git
cd exponent-ml

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

Environment Setup

Create a .env file with your API keys:

# Required
ANTHROPIC_API_KEY=your_anthropic_api_key

# Authentication (OAuth)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

# Optional (for cloud features)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
S3_BUCKET=your_s3_bucket_name
MODAL_TOKEN_ID=your_modal_token_id
MODAL_TOKEN_SECRET=your_modal_token_secret
GITHUB_TOKEN=your_github_token

Note: Only ANTHROPIC_API_KEY is required. OAuth credentials are needed for authentication.

Authentication Setup

Before using Exponent-ML, you need to set up OAuth authentication:

Option 1: Use the setup script

# Set up Google OAuth
python scripts/setup_oauth.py google

# Set up GitHub OAuth  
python scripts/setup_oauth.py github

# Check your configuration
python scripts/setup_oauth.py check

Option 2: Manual setup

  1. Google OAuth: Go to Google Cloud Console

    • Create a new project
    • Enable Google+ API
    • Create OAuth 2.0 credentials
    • Set redirect URI to http://localhost:8080
  2. GitHub OAuth: Go to GitHub OAuth Apps

    • Create a new OAuth App
    • Set callback URL to http://localhost:8080
  3. Add credentials to your .env file:

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

Basic Usage

# Login with OAuth
exponent login --provider google
exponent login --provider github

# Check authentication status
exponent status

# Interactive wizard
exponent init

# Quick start with task and dataset
exponent init quick "Predict email spam" --dataset spam.csv

# Train a model
exponent train

# Deploy to GitHub
exponent deploy

๐Ÿ“‹ Commands

exponent init

Initialize a new ML project with interactive wizard:

exponent init

Options:

  • --task, -t: ML task description
  • --dataset, -d: Path to dataset file
  • --interactive, -i: Run in interactive mode (default: True)

Subcommands:

  • exponent init quick <task>: Quick initialization without prompts

exponent upload-dataset

Analyze datasets and optionally upload to S3 for cloud training:

exponent upload-dataset spam.csv

Options:

  • --project-id, -p: Project ID for organization
  • --upload, -u: Upload to S3 for cloud training

Subcommands:

  • exponent upload-dataset analyze <file>: Analyze dataset without uploading

exponent train

Train ML models locally or in the cloud:

exponent train

Options:

  • --project-id, -p: Project ID to train
  • --dataset, -d: Path to dataset file
  • --task, -t: Task description
  • --cloud, -c: Use cloud training (Modal)
  • --s3: Upload dataset to S3 for cloud training

Subcommands:

  • exponent train status <job_id>: Check training job status
  • exponent train list: List all training jobs

exponent deploy

Deploy projects to GitHub:

exponent deploy

Options:

  • --project-id, -p: Project ID to deploy
  • --name, -n: GitHub repository name
  • --path: Path to project directory

Subcommands:

  • exponent deploy list: List GitHub repositories

๐Ÿง  How It Works

  1. Task Description: You describe your ML task in natural language
  2. Dataset Analysis: The tool analyzes your dataset structure (columns, types, etc.)
  3. Code Generation: An LLM generates production-ready Python code based on your task and dataset
  4. Dynamic Training: The generated code is executed in Modal's cloud infrastructure
  5. Deployment: Projects can be deployed to GitHub with automated workflows

No hard-coded templates - every model is generated specifically for your task and dataset!

๐Ÿ“ Generated Project Structure

~/.exponent/<project-id>/
โ”œโ”€โ”€ model.py          # Model definition and training pipeline
โ”œโ”€โ”€ train.py          # Training script with data loading
โ”œโ”€โ”€ predict.py        # Prediction script for making predictions
โ”œโ”€โ”€ requirements.txt  # Python dependencies
โ””โ”€โ”€ README.md        # Project documentation

๐Ÿ”ง Configuration

Required Environment Variables

  • ANTHROPIC_API_KEY: Your Anthropic API key for code generation

Optional Environment Variables

  • AWS_ACCESS_KEY_ID: AWS access key for S3 uploads
  • AWS_SECRET_ACCESS_KEY: AWS secret key for S3 uploads
  • AWS_REGION: AWS region (default: us-east-1)
  • S3_BUCKET: S3 bucket name for dataset storage
  • MODAL_TOKEN_ID: Modal token for cloud training
  • MODAL_TOKEN_SECRET: Modal token secret for cloud training
  • GITHUB_TOKEN: GitHub token for repository creation

๐Ÿ› ๏ธ Development

Project Structure

exponent-ml/
โ”œโ”€โ”€ exponent/
โ”‚   โ”œโ”€โ”€ cli/              # CLI interface (Typer)
โ”‚   โ”‚   โ””โ”€โ”€ commands/     # CLI commands
โ”‚   โ”œโ”€โ”€ core/             # Core logic
โ”‚   โ”‚   โ”œโ”€โ”€ code_gen.py   # LLM code generation
โ”‚   โ”‚   โ”œโ”€โ”€ config.py     # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ s3_utils.py   # S3 dataset handling
โ”‚   โ”‚   โ”œโ”€โ”€ modal_runner.py # Modal cloud training
โ”‚   โ”‚   โ””โ”€โ”€ github_utils.py # GitHub deployment
โ”‚   โ””โ”€โ”€ main.py           # CLI entry point
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”œโ”€โ”€ pyproject.toml        # Project configuration
โ””โ”€โ”€ README.md            # This file

Local Development

# Install in development mode
pip install -e .

# Run tests
pytest

# Format code
black exponent/
isort exponent/

# Lint code
flake8 exponent/

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

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

exponent_ml-0.1.1.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

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

exponent_ml-0.1.1-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file exponent_ml-0.1.1.tar.gz.

File metadata

  • Download URL: exponent_ml-0.1.1.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for exponent_ml-0.1.1.tar.gz
Algorithm Hash digest
SHA256 92f240fd44c12d05a5c0432100227119b4a8aa500efe07b80f4baddcccd93575
MD5 c8a8f593a594759eccc00a6a918e4ae2
BLAKE2b-256 b383857df681e4d7ac97b9947cd0e0cd9ae1140137bd9efb31bc34ef6c642d8e

See more details on using hashes here.

File details

Details for the file exponent_ml-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: exponent_ml-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for exponent_ml-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87b8eff9db32208fef1dd7fcd9232b9bc21923e7e178d350e5a95e2706f3c5b7
MD5 f81a9565430ac9d93f78025cfd94b397
BLAKE2b-256 f17e8af90057ad6eb833f2c71980d0282e0a5f0fc9ea50926f74f80372d439f0

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