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

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.2.tar.gz (284.3 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.2-py3-none-any.whl (115.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leanlab-0.2.2.tar.gz
  • Upload date:
  • Size: 284.3 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.2.tar.gz
Algorithm Hash digest
SHA256 5e72d1d8ff0adb59c405052ad7a8dd418b07038f6a311b5b35123b1cb4415e32
MD5 0d04d983c8dd36fcbf79dbec6cf6be8e
BLAKE2b-256 39fa9271c9da003e3638a18244daa8824def96a7dcbc814c93ef09f1a19dc5e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for leanlab-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: leanlab-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 115.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 585e4c43b8121e97b7037532cdb5589278790d4cbb763d9200e63567e3c8332a
MD5 8cf2f333b6ceefaa36e9cf446469ee37
BLAKE2b-256 aab50851cc11ace91c48c358f651dc0b222ad8e97704c7470075d5c31444ef33

See more details on using hashes here.

Provenance

The following attestation bundles were made for leanlab-0.2.2-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