Skip to main content

A self-improving lab for AI agents — evolve ML experiments against a frozen metric, or ship coding tasks through a spec → gate → review → merge loop with locked acceptance tests.

Project description

leanlab

PyPI CI Python License: MIT

Self-improving labs for AI agents. Point leanlab at a task and a team of Claude agents iterates toward a goal — evolving ML / optimization experiments against a frozen metric, or shipping coding tasks through a spec → gate → review → merge loop with locked acceptance tests.

Install

pipx install leanlab        # or:  pip install leanlab   ·   uvx leanlab

📦 On PyPI: pypi.org/project/leanlab

Requires Python 3.11+ and the claude CLI (the agents run on Claude Code).

Quick start

leanlab runs inside your own project — each lab lives in a .leanlab/<name>/ folder; the engine stays in the installed tool.

Metric lab — evolve a number (ML, optimization, anything that prints a score):

cd ~/my-project
leanlab init iris          # describe the task; Claude drafts the lab + scorer
leanlab check iris         # verify it's wired correctly (free)
leanlab lock iris          # freeze the scorer
leanlab run iris --n 5     # the agents evolve experiments (uses Claude)
leanlab serve iris         # watch the live dashboard

Coding lab — ship a coding task with locked acceptance tests:

cd ~/my-repo                              # a git repository
leanlab spec "add a /health endpoint"    # spec-writer drafts + locks the tests
leanlab build add-health                 # engineer → gate → reviewer → merge
leanlab board                            # live board: tasks, timeline, playbook

Let Claude Code drive it

cd ~/my-project && leanlab init --for-agent   # installs a Claude Code skill

Then just ask Claude Code — "use leanlab to add a /health endpoint" — and it specs, builds, and merges through the honest test gate for you.

Docs

  • docs/USAGE.md — every command, in order, with examples.
  • docs/OVERVIEW.md — how it works: the loop, the two lab types, the coding-lab flow, and the project structure.
  • CONTRIBUTING.md — local development (uv, tests, the React board).

MIT licensed — see LICENSE.

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

leanlab-0.2.4.tar.gz (308.5 kB view details)

Uploaded Source

Built Distribution

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

leanlab-0.2.4-py3-none-any.whl (119.9 kB view details)

Uploaded Python 3

File details

Details for the file leanlab-0.2.4.tar.gz.

File metadata

  • Download URL: leanlab-0.2.4.tar.gz
  • Upload date:
  • Size: 308.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for leanlab-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d320f845ebd90c63d8cc2d254467f86d4d654fe6464c3def21af19f7364e62d5
MD5 b2783f320b674f3fb08c3689635d70c7
BLAKE2b-256 8f0233e58685d48a9265238cffc92c191e39188ba20ddc1c50afc3241592900b

See more details on using hashes here.

Provenance

The following attestation bundles were made for leanlab-0.2.4.tar.gz:

Publisher: publish.yml on bacharSalleh/leanlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leanlab-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: leanlab-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 119.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for leanlab-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2f3eb9d7b6dd05ea364310d32b66f86c0a181737bb5ae5cee9f8c32e72576e95
MD5 6a56002553cafa413ba511bd1e596fc6
BLAKE2b-256 da10293fb2fce5167139f337af4c3f44e6db6019f8142271616d8336eef3f92a

See more details on using hashes here.

Provenance

The following attestation bundles were made for leanlab-0.2.4-py3-none-any.whl:

Publisher: publish.yml on bacharSalleh/leanlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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