Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

clabe

Documentation CI PyPI version License

clabe runs behavior experiments. You write a session as a list of Python steps: choose the animal, load its training stage and the rig's configuration, check the hardware, start Bonsai and Open Ephys, hand the data off. clabe runs those steps on the rig and asks the experimenter for what it needs, in the terminal or in a browser.

Each step is a function, and its parameters name the earlier steps it uses. That wiring is what makes going back cheap: if the experimenter changes the rig configuration halfway through, only the steps that depend on it run again. A step that fails can be retried, and steps that must never run twice, such as registering the session, lock everything before them.

Prompts are declared once and answered anywhere. The same question appears in the terminal on the rig, in a browser on a phone in the corridor, and to an AI agent through MCP; the first valid answer is kept. Forms are built from your Pydantic models and validated wherever they are filled in.

Every session leaves a record next to its data: each prompt and answer, each step's inputs and outputs, every command it ran, the configuration it used, the repository's commit and lockfile, and the machine. clabe replay runs a session again from that record.

When you have more than one rig, a small daemon on each PC lets you start experiments from a browser, and an optional hub shows every rig, every session in progress and every run waiting for an answer on one page.

Example

# main.py
from clabe import checks, steps, ui
from clabe.launcher import Launcher
from clabe.workflow import Workflow, concurrently

wf = Workflow("vr-foraging")
wf.step(steps.session())  # the experimenter and the animal


@wf.step
def trials() -> float:
    return ui.number("Trials", minimum=1, maximum=500)


wf.step(steps.review("session", "trials", back_to="session"))
wf.step(steps.preflight(checks.free_space(200e9)))  # reports every failed check at once
wf.step(steps.register())  # creates the session folder; the steps above are locked from here on


@wf.step(title="Acquire", cancellable=True)
async def acquire(launcher: Launcher, trials: float) -> dict:
    async with open_ephys_recording():  # records while the apps run
        return await concurrently(behavior=run_bonsai, fip=run_fip)
uv run clabe run        # runs main.py in this terminal and serves it in the browser
uv run clabe shortcut   # puts a desktop icon on the rig that does the same

Try it

From a checkout of this repository, with uv installed:

powershell -ExecutionPolicy ByPass -File scripts/demo-local.ps1

This runs examples/demo/main.py, a one-minute session that you can answer in the terminal or in the browser tab it opens. scripts/demo.ps1 runs the same session with a daemon and a hub, and needs Docker.

Install

uv add "aind-clabe[frontend]"         # in an experiment repository
uv add "aind-clabe[aind-services]"    # AIND data schema, data transfer and watchdog
uv add "aind-clabe[otel]"             # sending logs to OpenTelemetry
uv add "aind-clabe[agents]"           # the MCP server (clabe mcp)

The frontend extra adds the terminal UI and the browser page (and the web server the daemon and the hub run on). Without it, clabe asks its questions as plain console prompts and the rest works the same.

To install the daemon on a rig PC, see Deploy a rig.

Documentation

The documentation starts with a tutorial that builds a first workflow, then covers reusable steps, running on two PCs, deploying rigs, migrating an existing experiment, and the API. examples/behavior_launcher.py is a complete workflow to start from.

Development

git clone https://github.com/AllenNeuralDynamics/clabe.git && cd clabe
uv sync
uv run pytest
uv run ruff check
uv run docs/build.py && uv run zensical serve   # the documentation, from the docs dependency group

The web UI in ui-web/ is a Blazor app. uv run python scripts/build_web.py builds it into src/clabe/server/static, and uv run python scripts/openapi.py regenerates its models from the APIs (a test fails when they are out of date).

Metadata

Release files for aind-clabe 0.18.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aind-clabe 0.18.0rc1
File Size Uploaded Provenance Actions
aind_clabe-0.18.0rc1.tar.gz 3.4 MB Without provenance Details for aind_clabe-0.18.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aind-clabe 0.18.0rc1
File Interpreter ABI Platform Actions
aind_clabe-0.18.0rc1-py3-none-any.whl Python 3 none any Details for aind_clabe-0.18.0rc1-py3-none-any.whl

Total release size: 7.0 MB

Release files / aind_clabe-0.18.0rc1.tar.gz

Download URL aind_clabe-0.18.0rc1.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9869dcb328ec859a4cb9d8176195e54caae39fd540aef9c6034f4f31fd7ac594
BLAKE2b-256 checksum
How to use checksums
1f33878b2cd182b8404636b9e6842c56e4b003158954838a8f0f54b0f252b261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / aind_clabe-0.18.0rc1-py3-none-any.whl

Download URL aind_clabe-0.18.0rc1-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a40fe96a387d6b935b7bf4464116f789d4cd59af016fe1a65bd22b7c95aedfe4
BLAKE2b-256 checksum
How to use checksums
e9637b2695dd358d19acb9461df9bd7f17a01a56640179c778efd852e3a89c18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for aind-clabe 0.18.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page