Skip to main content

A package for training vision-action models

Project description

PhysicalAI Library

A library for training and deploying Vision-Language-Action policies for robotic imitation learning


Key FeaturesInstallationTrainingBenchmarkExportInferenceDocs


Introduction

PhysicalAI Library is a Python SDK for training, evaluating, and deploying Vision-Language-Action (VLA) policies. It provides implementations of imitation learning algorithms built on PyTorch Lightning, with a focus on robotic manipulation tasks. The library supports the full ML lifecycle: from training on demonstration data to deploying optimized models for real-time inference.

Key Features

  • Simple and modular API and CLI for training, inference, and benchmarking.
  • Built on Lightning for reduced boilerplate and distributed training support.
  • Export models to OpenVINO, ONNX, or Torch formats for accelerated inference.
  • Benchmark policies on standardized environments like LIBERO and PushT.
  • Unified inference API across all export backends.

Supported Policies

Policy Description Paper
ACT Action Chunking with Transformers Zhao et al. 2023
SmolVLA Lightweight vision-language-action model Cadene et al. 2024
Pi0 Physical Intelligence foundation model Black et al. 2024
GR00T N1 Vision-language grounded policy Bjork et al. 2025
Pi0.5 Vision-Language-Action Model with Open-World Generalization Black et al. 2025

Installation

pip install physicalai-train
Prerequisites

PhysicalAI Library requires Python 3.12+.

FFMPEG is required as a dependency of LeRobot:

# Ubuntu
sudo apt-get install -y ffmpeg

# macOS
brew install ffmpeg
Install from Source (for development)
git clone https://github.com/open-edge-platform/physical-ai-studio.git
cd physical-ai-studio/library

# Create virtual environment and install
uv venv
source .venv/bin/activate
uv sync --all-extras

Training

PhysicalAI supports both API and CLI-based training. Checkpoints are saved to experiments/lightning_logs/ by default.

API

from physicalai.data import LeRobotDataModule
from physicalai.policies import ACT
from physicalai.train import Trainer

# Initialize components
datamodule = LeRobotDataModule(repo_id="lerobot/aloha_sim_transfer_cube_human")
model = ACT()
trainer = Trainer(max_epochs=100)

# Train
trainer.fit(model=model, datamodule=datamodule)

CLI

# Train with config file
physicalai fit --config configs/physicalai/act.yaml

# Train with CLI arguments
physicalai fit \
    --model physicalai.policies.ACT \
    --data physicalai.data.LeRobotDataModule \
    --data.repo_id lerobot/aloha_sim_transfer_cube_human

# Override config values
physicalai fit \
    --config configs/physicalai/act.yaml \
    --trainer.max_epochs 200 \
    --data.train_batch_size 64

Benchmark

Evaluate trained policies on standardized simulation environments.

API

from physicalai.benchmark.gyms import LiberoBenchmark
from physicalai.policies import ACT

# Load trained policy (path from training output)
policy = ACT.load_from_checkpoint("experiments/lightning_logs/version_0/checkpoints/last.ckpt")
policy.eval()

# Run benchmark
benchmark = LiberoBenchmark(task_suite="libero_10", num_episodes=20)
results = benchmark.evaluate(policy)

# View results
print(results.summary())
results.to_json("results.json")

CLI

# Basic benchmark
physicalai benchmark \
    --benchmark physicalai.benchmark.gyms.LiberoBenchmark \
    --benchmark.task_suite libero_10 \
    --policy physicalai.policies.ACT \
    --ckpt_path ./checkpoints/model.ckpt

# With video recording
physicalai benchmark \
    --benchmark physicalai.benchmark.gyms.LiberoBenchmark \
    --benchmark.task_suite libero_10 \
    --benchmark.video_dir ./videos \
    --benchmark.record_mode failures \
    --policy physicalai.policies.ACT \
    --ckpt_path ./checkpoints/model.ckpt

Export

Export trained policies to optimized formats for deployment.

API

from physicalai.policies import ACT

# Load and export
policy = ACT.load_from_checkpoint("checkpoints/model.ckpt")
policy.export("./exports", backend="openvino")

CLI

physicalai export \
    --policy physicalai.policies.ACT \
    --ckpt_path checkpoints/model.ckpt \
    --backend openvino \
    --output_dir ./exports

Supported Backends

Backend Best For Install
OpenVINO Intel hardware (CPU/GPU/NPU) pip install openvino
ONNX NVIDIA GPUs, cross-platform pip install onnx
Torch Export Edge/mobile devices Built-in

Inference

Deploy exported models with a unified inference API.

API

from physicalai.inference import InferenceModel

# Load exported model (auto-detects backend)
policy = InferenceModel.load("./exports")

# Run inference loop
obs, info = env.reset()
policy.reset()
done = False

while not done:
    action = policy.select_action(obs)
    obs, reward, terminated, truncated, info = env.step(action)
    done = terminated or truncated

The inference API is consistent across all export backends, making it easy to switch between OpenVINO, ONNX, and Torch depending on your deployment target.

Documentation

See Also

Development Type Checking

# From library/
uv run pyrefly check -c pyproject.toml

Project details


Download files

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

Source Distribution

physicalai_train-0.1.0.tar.gz (752.4 kB view details)

Uploaded Source

Built Distribution

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

physicalai_train-0.1.0-py3-none-any.whl (324.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: physicalai_train-0.1.0.tar.gz
  • Upload date:
  • Size: 752.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for physicalai_train-0.1.0.tar.gz
Algorithm Hash digest
SHA256 33e86cda80870a0e8e40dcd2d939cfc9464f208d7b2c88e7d81093e7c4956867
MD5 da79671bc3fe61ede493f7c2f83abebd
BLAKE2b-256 225daea8e0eeb67978637b92647004e37338d0ff8f7bdca588f65c0fb51b4831

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on open-edge-platform/physical-ai-studio

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

File details

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

File metadata

File hashes

Hashes for physicalai_train-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cc4e26dab5e8e42b6b7a7768591a750c1baeb90356609d80b455c93e103f4f7
MD5 acfe173edce2f7cced6557e5f9a4e742
BLAKE2b-256 63470b72032797d951ada22941b3398029c0d71e3da0d8895630e542ffc9bfab

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on open-edge-platform/physical-ai-studio

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page