Skip to content

Getting Started

Prerequisites

  • Python 3.11+
  • uv package manager
  • OpenAI or Anthropic API key

Installation

git clone https://github.com/skelf-research/l0l1-api.git
cd l0l1-api
uv sync

Using pip

git clone https://github.com/skelf-research/l0l1-api.git
cd l0l1-api
pip install -e .

Optional Dependencies

# Development tools
uv sync --extra dev

# Jupyter integration
uv sync --extra jupyter

# All extras
uv sync --all-extras

Configuration

Set your AI provider API key:

# OpenAI (default)
export OPENAI_API_KEY="sk-..."

# Or Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
export L0L1_AI_PROVIDER="anthropic"

See Configuration for all options.

First Steps

1. Validate a Query

uv run l0l1 validate "SELECT * FROM users WHERE id = 1"

2. Explain a Query

uv run l0l1 explain "SELECT u.name, COUNT(o.id) FROM users u JOIN orders o ON u.id = o.user_id GROUP BY u.id"

3. Check for PII

uv run l0l1 check-pii "SELECT * FROM users WHERE email = 'john@example.com'"

4. Start the API Server

uv run l0l1-serve
# Server runs at http://localhost:8000
# API docs at http://localhost:8000/docs

5. Try the Demo

# Create demo environment with sample data
uv run l0l1-demo ecommerce

# Validate against demo schema
uv run l0l1 validate --workspace demo_ecommerce "SELECT * FROM products"

Using the Makefile

The project includes a Makefile for common tasks:

make help           # Show all commands
make install        # Install dependencies
make setup          # Full development setup
make serve          # Start API server
make test           # Run tests
make demo-ecommerce # Create demo environment

Next Steps