Skip to main content

Examples

Runnable LiveKit Portal examples, from synthetic video to physical SO-101 arms and cloud inference.

Overview

LiveKit Portal ships several examples, most in the Portal repository under examples/python/ . Each uses the API described in the LiveKit Portal API reference.

The SO-101 and human-in-the-loop examples require robot hardware. The others run locally against LiveKit Cloud  or a local livekit-server --dev.

Repository examples

ExampleHardwareDescription
basic/ NoneDemonstrates the complete API end to end with synthetic video, including a YAML-configuration variant. The recommended starting point.
inference/ NoneA VLA-style inference loop that uses action chunks and reports true end-to-end latency metrics.
modal-mock-inference/ NoneRuns the policy on Modal  and measures glass-to-glass latency using a QR clock.
so101/ 2x SO-101A physical SO-101 follower arm driven by a remote SO-101 leader arm, visualized in rerun .
portal-hitl 2x reBot armsA human operator and a trained ACT policy driving the same robot, with mid-session control handoff.

Each example directory includes its own README.md with the exact setup steps. The general workflow is the same:

cd examples/python/basic
cp .env.example .env # fill in LIVEKIT_URL / API_KEY / API_SECRET
uv sync
uv run robot.py # terminal 1
uv run teleoperator.py # terminal 2

The basic example

The basic/ example is the one to run first. It publishes a synthetic test pattern instead of a camera, so no hardware is required. It runs an entire Portal session from end to end, declaring the schema, receiving synchronized observations, sending actions back through the control gate, making an RPC call, and printing live metrics. It also includes a variant that loads the schema from a shared portal.yaml file instead of declaring it in code, which is the recommended way to keep both sides consistent in a production deployment.

The modal-mock-inference/ example runs the policy as a Modal  function instead of a local process, which reflects a common deployment: the robot runs at the edge and the policy runs on cloud compute. The robot publishes synthetic frames that carry a QR clock, and the mock policy reads the code rather than running a model, so the measurement is round-trip glass-to-glass latency, from a pixel leaving the robot to the matching action returning. A production policy uses the same structure.

The results are a demonstration rather than a benchmark. The QR code travels over lossy H.264, so some frames fail to decode, and most of the latency is network distance, because the loop crosses the network twice. The example shows whether your control rate can tolerate the round trip before you commit to a deployment topology.

Physical hardware with SO-101

The so101/ example is the only one in the repository that requires hardware: two SO-101 arms with Feetech STS3215 motors and one camera on the robot side. The robot.py script runs next to the follower arm, and teleoperator.py runs on the operator's computer with the leader arm attached. Synchronized joint state and the camera feed stream back for visualization in rerun , so you can observe how observations and commands align. It is built on the LeRobot plugins, which makes it the reference for integrating Portal into a physical control loop.

Human in the loop

portal-hitl  is a standalone example in which a human operator and a trained ACT policy drive the same robot in a single session. The human teleoperates with a leader arm by default, control hands off to the policy mid-session, and every executed action is recorded alongside the observation it answered, regardless of which operator produced it. This closes the loop from teleoperation data collection through training and inference and back, following the DAgger approach.

It runs on a Seeed reBot Arm B601-DM follower with dual cameras, driven by a reBot 102 leader arm.

For the mechanics behind the handoff, see Set the active operator and the multi-operator patterns table.

Other robotics examples

For a complete list of robotics examples, see the Recipes page.

Next steps

The following resources build on these examples: