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.0rc4

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.0rc4
File Size Uploaded Provenance Actions
aind_clabe-0.18.0rc4.tar.gz 3.4 MB Without provenance Details for aind_clabe-0.18.0rc4.tar.gz

Built distribution (wheel)

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

Total release size: 7.0 MB

Release files / aind_clabe-0.18.0rc4.tar.gz

Download URL aind_clabe-0.18.0rc4.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5f098a4b6ad34e16b01901c67dd579909b3afe0bcdc668aef5e8742719352e2f
BLAKE2b-256 checksum
How to use checksums
024164cdc56880ebd85166d7536ac9f47c32c2c04f741cce4197617970841d14
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.0rc4-py3-none-any.whl

Download URL aind_clabe-0.18.0rc4-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a1116b85c426f6e996d521aeef40c3acfec9be5dad9d909f4359d8e24bc3ec1e
BLAKE2b-256 checksum
How to use checksums
38c4ba89c2c14ecfe4e09fb0146b96a3c0ba62fb1eb725b1de7e01cb92827b29
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.0rc4

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