Skip to content

lucastononro/trainable

Repository files navigation

Trainable

Trainable

AI-powered ML experimentation platform. Upload a dataset, and AI agents autonomously perform EDA, data preparation, and model training — with real-time streaming visualization.

How It Works

  1. Gallery — Create experiments by uploading CSV/Parquet datasets
  2. Studio — Split-pane workspace: chat with the AI agent (left) + canvas with reports, files, and live metrics (right)
  3. EDA — Agent explores data quality, distributions, correlations, and generates a statistical report
  4. Prep — Agent cleans, encodes, and splits data into train/val/test sets
  5. Train — Agent trains and tunes models with live metrics streaming to a dashboard

Tech Stack

  • Agent: Claude Agent SDK with custom MCP tools
  • Backend: FastAPI + SQLAlchemy + SSE streaming
  • Frontend: Next.js 14 + Tailwind + Recharts
  • Execution: Modal sandboxes (isolated Python, optional GPU)
  • Storage: S3/MinIO (artifacts) + Modal Volumes (workspace)
  • Database: SQLite (dev) / PostgreSQL (prod)

Prerequisites

Quick Start

1. Clone and configure

git clone https://github.com/lucastononro/trainable-monorepo.git
cd trainable-monorepo
cp .env.example .env

Edit .env and add your ANTHROPIC_API_KEY.

2. Modal authentication

pip install modal
modal token set

3. Backend

cd backend
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

4. Frontend

cd frontend
npm install
npm run dev

Open http://localhost:3000.

Docker Compose (full stack)

Runs PostgreSQL, MinIO, backend, and frontend together:

cp .env.example .env   # Add your ANTHROPIC_API_KEY
docker compose up

This starts:

Running Tests

cd backend
source .venv/bin/activate
pytest tests/ -v

Environment Variables

Variable Required Default Description
ANTHROPIC_API_KEY Yes Claude API key for the AI agent
MODAL_TOKEN_ID Yes* Modal auth (*or run modal token set)
MODAL_TOKEN_SECRET Yes* Modal auth
DATABASE_URL No SQLite (local file) PostgreSQL connection string
S3_ENDPOINT No AWS S3 S3-compatible endpoint (MinIO, etc.)
AWS_ACCESS_KEY_ID No S3 credentials
AWS_SECRET_ACCESS_KEY No S3 credentials
CLAUDE_MODEL No claude-opus-4-6 Model for the AI agent

Project Structure

backend/           FastAPI application
  routers/         API endpoints (experiments, sessions, stream, files)
  services/        Agent orchestration, sandbox, broadcaster, validators
  tests/           pytest test suite
frontend/          Next.js application
  src/app/         Pages (gallery, studio)
  src/components/  React components (chat, canvas, metrics, modals)
  src/lib/         API client, SSE connector, types
docs/              Architecture and agent documentation

See docs/ARCHITECTURE.md for detailed system design and docs/agents.md for agent documentation.

CI

GitHub Actions runs on every push to main and on pull requests:

  • Backend: Ruff lint + format check, pytest, Bandit security scan
  • Frontend: ESLint, TypeScript typecheck, Next.js build

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors