Skip to main content

levain-cli

The open toolchain for authoring Levain agent recipes: a validator, model checker, and code generator for the PlusCal recipe format that Levain agents are defined in.

A recipe package is a graph.tla PlusCal spec (the agent's node graph and state) plus a Python package with one function per node. This tool checks both halves and keeps them coherent:

  • validate — parse the spec, enforce the recipe grammar profile, check graph topology, translate PlusCal to TLA+, and model-check the result with TLC (deadlock and termination).
  • validate-package — all of the above, plus Python source cross-checks (every @node function exists and is importable) and pyproject.toml checks.
  • generate-state — regenerate _state.py, the typed GraphState TypedDict node functions program against.

Install

uv tool install levain-cli

TLC model checking (stages 4-5) needs a Java runtime; tla2tools.jar is fetched automatically on first use. Without Java the tool degrades to the pure-Python stages and says so — the Levain platform re-runs full validation on every push, so nothing is lost, only local feedback latency.

Use

levain validate graph.tla
levain validate-package .
levain generate-state .
levain --version

The import package is levain_recipe — use it to lint recipes from your own CI or scripts:

from levain_recipe.validate import validate_fast

Validation errors are prescriptive ([stage] line N: message, with TLC counterexample traces) — they are the recipe format's primary teaching interface, for humans and agents alike.

For MCP clients that cannot run shell commands (e.g. Claude Desktop), levain mcp serves the same operations over stdio; install with the [mcp] extra.

What this is not

Recipe execution — compiling a validated spec into a running agent, sandboxing, integrations — happens on the Levain platform. Passing local validation is necessary, not sufficient: the platform validates again server-side before a version can be published.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

levain_cli-0.1.0.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

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

levain_cli-0.1.0-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file levain_cli-0.1.0.tar.gz.

File metadata

  • Download URL: levain_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for levain_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 baa641a274d095bd465dfdbfe94d8219c2e7c04f3277f3681d60e2634731eb0f
MD5 65a90ecc83b0817f38581c4285808476
BLAKE2b-256 6f0198f16d815d7f4e0a289191bd1c1d083d354dd420e48c14642ccf0f98d1ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for levain_cli-0.1.0.tar.gz:

Publisher: pypi-publish.yaml on levainlabs/levain

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

File details

Details for the file levain_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: levain_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for levain_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0187b77f4473397bf168a52a2af5c11b627dde3e999bfa8833be0cb73529fc45
MD5 5c541c00178944a5b13e7d88e6dde306
BLAKE2b-256 c83769ba948a933f02d6a223c5e05c35264f3a269d3b0cc487b5dd6abc351e4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for levain_cli-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yaml on levainlabs/levain

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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