Skip to main content
Pre-release

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

unienv-lerobot

LeRobot for UniEnv: LeRobot policies (ACT, Diffusion Policy, SmolVLA, pi0, pi0.5, GR00T, ...) as UniEnv policies, synchronous or asynchronous with Real-Time Chunking.

pip install unienv_lerobot                 # LeRobot >= 0.7, < 0.8 (Python >= 3.12)
pip install "lerobot[smolvla]"             # the extras of the policies you run

Usage

from unienv_lerobot import LeRobotPolicy

policy = LeRobotPolicy.from_pretrained("lerobot/smolvla_libero", env, device="cuda",
                                       observation_fn=libero_inputs)   # see below
context, obs, info = env.reset()
policy.reset(context, obs)                 # the context is the instruction
while True:
    action = policy.get_action()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        break
    policy.observe_transition(action, obs, dt)   # dt: the step's duration in seconds

LeRobotPolicy is a UniEnv Policy: it runs the steps of LeRobot's own evaluation loop (the policy's preprocessor, which normalizes and tokenizes the task, then the policy, then the postprocessor) and converts between UniEnv data and LeRobot batches. from_pretrained takes a Hub repo id or a local checkpoint and the env (for its spaces and batch size); LeRobotPolicy(policy, preprocessor, postprocessor, observation_space=..., action_space=...) wraps policies you built yourself.

Observations

The policy declares its inputs (policy.config.input_features, e.g. observation.state, observation.images.<camera>). Each input comes from:

  1. observation_keys={"observation.images.front": "cameras/front"}: a key path into the observation;
  2. a top-level key with the input's name (data read with UniEnv's LeRobotAsUniEnvDataset has LeRobot's keys);
  3. a leaf whose space metadata "source" is the input's name;
  4. observation_fn(observation) -> {input name: array} for inputs that must be computed.

A missing input is an error that lists the observation's leaves. VLA policies can run without some cameras: list those in optional_features. Images may be channel-last or channel-first, uint8 (scaled to [0, 1]) or float, and of another size than the checkpoint's (policies resize them); the channel count must match.

For LIBERO (with unienv-libero), LeRobot's checkpoints expect both cameras rotated by 180 degrees and an 8-D state:

def libero_inputs(obs):
    return {"observation.images.camera1": obs["agentview_rgb"][::-1, ::-1],
            "observation.images.camera2": obs["eye_in_hand_rgb"][::-1, ::-1],
            "observation.state": np.concatenate([obs["ee_pos"], obs["ee_ori"], obs["gripper_states"]])}

Task, actions, batches

  • Task: VLA policies need the episode's instruction. By default it is the context (a string, or a dict's "task", "language_instruction" or "instruction"); pass task= as a string or a function of the context otherwise.
  • Actions: for a BoxSpace action space of the policy's action size, actions come in the space's backend, device and dtype. Other action spaces need action_fn(actions), which gets the (B, A) tensor.
  • Batched envs: LeRobot policies keep one action queue for the whole batch. A masked reset updates the tasks of the reset envs and, by default (masked_reset="drop_queued"), makes every env predict afresh at the next step, keeping other state; policies with observation history (n_obs_steps > 1) keep the old episode's frames for the reset envs until it refills. masked_reset="full" resets the policy for all envs.
  • get_action computes at most one action per step and returns it until the next observe_transition.

Asynchronous inference and Real-Time Chunking

With mode="async", the policy predicts whole action chunks ahead of time while the current chunk plays, so a robot keeps moving while the model runs:

  • The next chunk is requested when the queued actions last about as long as a prediction. Its first actions (those of the steps that passed while it was computed) are dropped, so it starts at the action due when it arrives. If the queue runs out, get_action waits for the chunk.
  • With RTC (rtc=None: whenever the policy supports it, e.g. SmolVLA, pi0, pi0.5, GR00T), each request carries the queued actions of the current chunk and the expected delay, and the policy generates a chunk that continues them (Real-Time Chunking, guided). rtc_execution_horizon sets the guided prefix (LeRobot's default: 10). rtc=False switches chunks without guidance (any chunking policy, e.g. ACT).
  • Time is the env's: the dt passed to observe_transition. latency=None runs inference on a worker thread and measures it (robots, whose env time is wall time); latency=0.15 simulates 0.15 s of inference in env time, deterministically (simulation, tests).

Policies with relative actions and observation history are not supported in async mode yet.

Serving a policy remotely

LeRobot's Python and torch requirements often differ from the robot's or simulator's environment. Host the policy with UniEnv's remote execution on the machine that has LeRobot, built on demand:

server.register_factory("pi", lambda: LeRobotPolicy.from_pretrained(..., mode="async"), release_after=60)

and use client.policy("pi") on the robot side (examples/serve_policy.py).

Validation

lerobot/smolvla_libero on LIBERO-Spatial (10 tasks x initial states 0-2, 360x360 renders, as lerobot-eval), LeRobot 0.7.0:

run success
lerobot-eval (LeRobot's own loop and LIBERO env) 18 / 30
LeRobotPolicy, sync, on unienv-libero 18 / 30
LeRobotPolicy, async + RTC, 0.15 s simulated latency 17 / 30
LeRobotPolicy, async without RTC, 0.15 s 17 / 30

The sync run and lerobot-eval agree on 25 of the 30 episodes; the rest is the policy's sampling noise.

Examples

  • examples/libero_smolvla.py: lerobot/smolvla_libero on LIBERO suites, sync or async (--mode async --latency 0.15), with success rates.
  • examples/serve_policy.py: the same policy served from another machine.

Tests

pytest tests runs on CPU without downloads (a random-weight ACT and a scripted chunk policy). pytest tests --run-gpu also runs SmolVLA on a LIBERO task (CUDA, unienv_libero[env], model downloads).

License

Apache-2.0. LeRobot (Apache-2.0) and the policies' weights keep their own licenses.

Metadata

Release files for unienv-lerobot 0.0.1a1

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

Source distribution (sdist)

Source distribution for unienv-lerobot 0.0.1a1
File Size Uploaded Provenance Actions
unienv_lerobot-0.0.1a1.tar.gz 27.9 kB With provenance Details for unienv_lerobot-0.0.1a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unienv-lerobot 0.0.1a1
File Interpreter ABI Platform Actions
unienv_lerobot-0.0.1a1-py3-none-any.whl Python 3 none any Details for unienv_lerobot-0.0.1a1-py3-none-any.whl

Total release size: 49.9 kB

Release files / unienv_lerobot-0.0.1a1.tar.gz

Download URL unienv_lerobot-0.0.1a1.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a1360b41148876c957f48dc2dd7308fa2f13d2ddcff68fa0823b127fa5ba9b12
BLAKE2b-256 checksum
How to use checksums
1ea614e044ba8e8288341aa1998f4d1aa6da8b47d77bb391431e47517d95ccf2
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 Nov 23, 2026.

Transparency log

Release files / unienv_lerobot-0.0.1a1-py3-none-any.whl

Download URL unienv_lerobot-0.0.1a1-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdc162fa5a1b931ec5bf053a523eeea5b03b33ec5305f5db02af49b5c0a6b087
BLAKE2b-256 checksum
How to use checksums
7001e06f85d81cfac61295bc0ee7891ab0282f3e20dcdacc722c5f27ec792dbd
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 Nov 23, 2026.

Transparency log

Security for unienv-lerobot 0.0.1a1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for unienv_lerobot-0.0.1a1.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 Nov 23, 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.

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