Skip to main content

XPolicyLab policy adapter for Inspect Robots — evaluate any XPolicyLab-served VLA policy (π0, GR00T, OpenVLA-OFT, RDT, ACT, ...) with Inspect Robots.

Project description

inspect-robots-xpolicylab

Drive any XPolicyLab-served policy from Inspect Robots.

XPolicyLab unifies 40+ VLA and imitation-learning policies (π0 / π0.5, GR00T N1.7, OpenVLA-OFT, RDT-1B, SmolVLA, ACT, Diffusion Policy, …) behind one policy-server contract: each policy runs in its own conda/uv environment and serves inference over a websocket protocol. This plugin is the Inspect Robots side of that wire: a Policy adapter that connects to a running XPolicyLab policy server, so the whole policy zoo becomes evaluable with any Inspect Robots embodiment and task.

The adapter speaks XPolicyLab's msgpack-over-websocket protocol directly — it does not depend on the xpolicylab package (which is not on PyPI). Only the policy server needs an XPolicyLab checkout.

Install

pip install inspect-robots-xpolicylab

The xpolicylab policy then appears in inspect-robots list policies.

Quickstart

Terminal 1 — serve a policy from your XPolicyLab checkout (its own environment, possibly another machine; see the XPolicyLab README for per-policy install/checkpoint details):

cd XPolicyLab/policy/Pi_0
bash setup_eval_policy_server.sh <bench_name> <task_name> <ckpt_name> \
    <env_cfg_type> <action_type> <seed> <policy_gpu_id> <policy_env> 19000 0.0.0.0

Terminal 2 — evaluate it with Inspect Robots:

inspect-robots run --task my-task --policy xpolicylab --embodiment isaacsim \
    -P url=ws://gpu-box:19000 -P cameras=cam_head:base_rgb

or programmatically:

from inspect_robots import eval
from inspect_robots_xpolicylab import XPolicyLabPolicy

with XPolicyLabPolicy(url="ws://gpu-box:19000", cameras="cam_head:base_rgb") as policy:
    log = eval("my-task", policy, "isaacsim")

Constructing the policy and reading .info never touch the network — the websocket connects on first reset()/act(), with retries while the policy server cold-starts (loading VLA weights can take minutes).

Configuration

Arg Default Meaning
url ws://localhost:19000 policy server websocket URL
action_type joint joint*arm_joint_state actions; ee*ee_pose
arms 1 1 or 2 (dual-arm uses left_*/right_* keys)
arm_dim / ee_dim 7 / 1 per-arm joint dims / gripper dims
cameras cam_head:cam_head XPolicyLab camera slot → Inspect Robots camera name
state_map see below XPolicyLab state key → Inspect Robots state key
required_state_keys joint: joint_pos,gripper; ee: none state keys enforced by compatibility checking
action_keys + action_dim derived explicit ordered action-dict keys for exotic setups
camera_height / camera_width unset declare camera resolution for compatibility checks
control_hz unset chunk playback rate; also sent as additional_info.frequency
name xpolicylab policy name in logs (tag runs e.g. xpolicylab:pi0)
connect_timeout_s / request_timeout_s 30 / 120 client timeouts
connect_attempts / connect_retry_delay_s 10 / 5 cold-start retry budget

Mapping-valued args accept a compact string form for the CLI: -P cameras=cam_head:base_rgb,cam_wrist:wrist_rgb.

Default state_map (all XPolicyLab state fields are optional; mapped keys missing from an observation are simply not sent):

XPolicyLab key Inspect Robots key
arm_joint_state joint_pos
ee_joint_state gripper
ee_pose eef_pose

Action mapping

Each infer reply is an action chunk — one dict per future control step. Dicts flatten to vectors in a fixed order: for each arm (left then right), the arm key then the end-effector key. The default single-arm joint profile is concat(arm_joint_state, ee_joint_state) → dim 8, matching the inspect-robots-isaacsim default Franka profile.

Lifecycle notes

  • reset(scene) ends the previous trial server-side (trial_end) and starts a fresh trial_id; close() ends any open trial and says goodbye.
  • eval() closes embodiments it resolves, not policies — use with / close() in programmatic runs. A best-effort atexit hook covers registry-resolved CLI runs.
  • If the socket drops mid-eval, the trial in flight errors and the next reset()/act() reconnects (replaying the hello handshake).

Protocol compatibility

Validated against XPolicyLab commit fe71eb54675cef495fea817a637386a4f4529153. The protocol carries no version field; if upstream changes the wire format, _protocol.py is the single small module to diff and update.

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

inspect_robots_xpolicylab-0.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

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

inspect_robots_xpolicylab-0.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for inspect_robots_xpolicylab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1bdedcc29f76255be376118ce9e119214964b44764414361db953d82cfc0c13
MD5 752e6c721893191daff2847e88f39768
BLAKE2b-256 7f29a891ee46b575d7bde2c6ab38ac537e6b45e8b8d3cd52e50426ce44a527d9

See more details on using hashes here.

Provenance

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

Publisher: release.yml on robocurve/inspect-robots

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

File details

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

File metadata

File hashes

Hashes for inspect_robots_xpolicylab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3371178fec9f81d0654f3bb35c841bba7dd4cbea5fe3141ae40d8ff4c2916179
MD5 b2eac17bb95653be45cff8b96ef440c2
BLAKE2b-256 eb4fdbde8ee8f6a42b092d74d5566820412f7afc1eda1001ed1c74caee173caa

See more details on using hashes here.

Provenance

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

Publisher: release.yml on robocurve/inspect-robots

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