Skip to main content

levain-runtime

Run a Levain agent on your own machine or in your own container image. The platform keeps the recipe, its versions, the run history and the improvement loop; this runtime executes the agent's nodes where your data, tools and dependencies live.

The runtime never accepts inbound connections. It opens one outbound tunnel to the platform and serves node execution over it. Model calls either go through the platform (metered as usual) or use the Claude login present on the runtime host, as configured per runtime.

Install

uv tool install levain-runtime

Set up

# Run nodes directly on this host:
levain-runtime init --mode direct

# Direct mode serving four sessions at once (Linux with bubblewrap):
levain-runtime init --mode direct --sessions 4

# Or run each session in a container built from your own image:
levain-runtime init --mode docker --image ghcr.io/you/agent-runtime:latest

Direct mode links /workspace, /recipes, /sdk and /sandbox to the runtime's home directory (~/.levain/runtime); the command prints and runs the ln commands, with sudo when / is not writable. On macOS the links come from /etc/synthetic.conf: init writes the entries and asks for one restart.

A docker image needs Python 3.12 or later with levain-sdk[review,models] installed, plus whatever your recipes import.

Register and run

export LEVAIN_API_KEY=...   # a workspace API key
levain-runtime register --name workstation --model-auth local
levain-runtime up

register creates the runtime in your workspace and stores its credentials here. If the runtime was created elsewhere (the Levain app or API), pass the credentials it returned instead: levain-runtime connect --credentials runtime-credentials.json.

up starts the local node server, the tunnel client and a heartbeat so the platform can show whether the runtime is online. It fetches the current tunnel settings from the platform on every start. levain-runtime status prints the configuration and the sessions on this runtime.

How it works

Each agent session gets a workspace directory under the runtime home (sessions/<id>/workspace, or agents/<id>/workspace for agents with a persistent workspace). The platform delivers the recipe and SDK into /recipes and /sdk, then runs each node as a short-lived process with the session's environment. Everything a node prints is streamed back and lands in the run's logs on the platform.

Direct mode serves one session at a time by default: /workspace points at the active session. With --sessions N it serves up to N at once, each node running under bubblewrap with its session's folders mounted at /workspace, /recipes/active and /sdk/active; the real workspace path is in LEVAIN_HOST_WORKSPACE for tools outside the sandbox such as Docker. Docker mode starts one container per session and has no such limit.

Sessions and your Claude login

In direct mode an agent's turns run in the session's workspace directory with this machine's Claude login and config dir (CLAUDE_CONFIG_DIR, or ~/.claude). Claude Code files the agent's sessions where it files yours, under that directory's entry, so from the workspace directory claude --resume lists the agent's sessions next to your own and continues any of them. levain-runtime status prints each session's workspace and the Claude session it continues.

The map from a Levain session to its Claude session lives in <config dir>/levain-sessions/. To have an agent continue a session you started yourself in its workspace directory:

levain-runtime adopt <levain session id> <claude session id>

The agent's next turn resumes that session. Docker mode copies your login into each container instead; its sessions stay in the container.

Metadata

Release files for levain-runtime 0.1.15

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

Source distribution (sdist)

Source distribution for levain-runtime 0.1.15
File Size Uploaded Provenance Actions
levain_runtime-0.1.15.tar.gz 38.3 kB With provenance Details for levain_runtime-0.1.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for levain-runtime 0.1.15
File Interpreter ABI Platform Actions
levain_runtime-0.1.15-py3-none-any.whl Python 3 none any Details for levain_runtime-0.1.15-py3-none-any.whl

Total release size: 83.1 kB

Release files / levain_runtime-0.1.15.tar.gz

Download URL levain_runtime-0.1.15.tar.gz
Size 38.3 kB
Tags Source
SHA-256 checksum
How to use checksums
80bfbc0ce657e15c417f7b2eb171e0b3cc3286d568be48652d9583fbd5b8f4fd
BLAKE2b-256 checksum
How to use checksums
5f8f8c42f4b84e4f57df5c7a201b11fadc7374ec936c34bdaa170fef70481391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / levain_runtime-0.1.15-py3-none-any.whl

Download URL levain_runtime-0.1.15-py3-none-any.whl
Size 44.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75766b5b939751868cf0ba6c415a58fba5fe9817b4024d3d501108f07363e77b
BLAKE2b-256 checksum
How to use checksums
b571e8f6b0ba76f93149a5c7bcb99e985c159f2f18d40b7ce164ce331ba149e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for levain-runtime 0.1.15

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for levain_runtime-0.1.15.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

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.

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