Back to Openvino

Runtime

docs/articles_en/physical-ai/explanation/runtime.md

2026.2.12.4 KB
Original Source

Runtime

Preview: PolicyRuntime is a planned API. The content below documents the target design.

PolicyRuntime runs a policy on robot hardware. It owns the control loop, the callback lifecycle, and the interaction between observations, inference requests, and actions.

python
runtime = PolicyRuntime.from_config("runtime.yaml")
runtime.run(duration_s=60)

Responsibilities

ComponentOwnsDoes not own
InferenceModelmodel load, preprocess, inference, postprocessrobot loop timing
Executionwhere inference runsrobot IO
ActionQueueaction chunks and bufferingmodel inference
PolicyRuntimeobserve, request inference, send action, callbacks, timingpolicy math
Robothardware connection, observations, actionspolicy inference

Loop

The runtime loop follows this general pattern:

text
while running:
    observation = get_robot_state() + get_camera_frames()
    maybe_request_inference(observation)
    action = get_next_action_or_hold()
    send_action_to_robot(action)
    sleep_until_next_tick()

The exact observation structure and merging strategy may change as the API stabilizes.

Execution Modes

ModeWhere inference runsUse
SyncExecution(mode="single_action")runtime threadsimple policies
SyncExecution(mode="chunk")runtime threadchunk policies without background worker
AsyncExecution(transport="thread")worker threadavoid blocking control loop
RemoteExecutionremote serverrobot host without policy weights

Product Workflows

HIL, recording, highlight, and DAgger should be composed through callbacks until they justify reusable runtime primitives.

python
class HILCallback:
    def before_send_action(self, action, step):
        if teleop.enabled:
            return teleop.read_action()
        return action