LeRobot Async (gRPC inference)¶
create_policy("lerobot_async", ...) returns a LerobotAsyncPolicy - a drop-in
Policy that offloads inference to a remote LeRobot
PolicyServer over LeRobot's native async-inference gRPC transport
(lerobot.async_inference.policy_server). Every get_actions call forwards the
current observation to the server, which runs the configured LeRobot policy
(ACT, SmolVLA, diffusion, pi0/pi0.5, VQBeT, ...) on its own GPU and streams back
an action chunk.
Use it when the robot host is light (e.g. a Jetson) and a separate GPU box holds
the weights. Unlike lerobot_local (which loads the
checkpoint in-process), the async client keeps the control loop off the GPU that
runs the model - the same split as LeRobot's own robot_client / policy_server.
For a WebSocket-based alternative served by this library's own
strands_robots.inference server, see remote. lerobot_async
differs in that it speaks LeRobot's gRPC protocol directly, so it interoperates
with a stock lerobot.async_inference.policy_server.
Install¶
Start the server (GPU host)¶
pip install 'lerobot[async]'
python -m lerobot.async_inference.policy_server --host=0.0.0.0 --port=8080
The server is generic: the client selects which checkpoint it loads (via the
SendPolicyInstructions handshake), so policy_type and
pretrained_name_or_path are required on the client.
Use it (robot host)¶
from strands_robots import create_policy
policy = create_policy(
"lerobot_async",
server_address="gpu-box:8080",
policy_type="act",
pretrained_name_or_path="lerobot/act_so101",
)
# smart string is equivalent (server_address parsed from the URL):
policy = create_policy(
"grpc://gpu-box:8080",
policy_type="act",
pretrained_name_or_path="lerobot/act_so101",
)
In simulation or a control loop it is a normal provider:
from strands_robots import Robot
sim = Robot("so101") # sim by default
sim.run_policy(
robot_name="so101",
policy_provider="lerobot_async",
policy_config={
"server_address": "gpu-box:8080",
"policy_type": "act",
"pretrained_name_or_path": "lerobot/act_so101",
},
instruction="pick up the cube",
duration=10.0,
)
Config keys¶
| Config key | Default | Meaning |
|---|---|---|
server_address |
127.0.0.1:8080 |
Server host:port (gRPC); wins over host/port. grpc:// scheme stripped |
host |
127.0.0.1 |
Server host (when server_address is omitted) |
port |
8080 |
Server port (when server_address is omitted) |
policy_type |
- | Required. LeRobot policy type the server loads (act, smolvla, diffusion, tdmpc, vqbet, pi0, pi05, groot) |
pretrained_name_or_path |
- | Required. HuggingFace id or path the server loads |
device |
cuda |
Device for server-side inference; set cpu for a CPU server |
actions_per_chunk |
50 |
Max actions the server returns per chunk |
actions_per_step |
actions_per_chunk |
Actions executed from one chunk before re-querying (the re-query interval) |
connect_timeout |
10.0 |
Seconds to wait for the gRPC Ready handshake |
request_timeout |
60.0 |
Seconds to wait for each observation/action RPC |
Notes¶
- The connection is established lazily on the first
get_actions, so constructing the policy does not require the server to be up yet. - If the server returns no actions for an observation (filtered out, or a
server-side inference error), the client raises rather than fabricating a
zero action - check the
PolicyServerlogs. set_robot_state_keys([...])must be called with the robot's joint/motor names before inference; those scalars are concatenated intoobservation.stateand any RGB/depth camera arrays are declared as image features in the handshake.