Skip to content

vllm_omni.entrypoints.openpi.connection

WebSocket connection for robot policy inference (OpenPI protocol).

Protocol (compatible with OpenPI policy clients): Connect -> server sends msgpack(PolicyServerConfig fields) Infer -> client sends msgpack(obs), server sends msgpack(ndarray) Reset -> client sends msgpack({endpoint:reset}), server sends msgpack(status)

NumPy values use msgpack-numpy marker mappings. Outbound payloads follow the openpi-client format so official OpenPI clients can decode action responses: ndarray -> {ndarray: true, dtype, shape, data} scalar -> {npgeneric: true, dtype, data}

Inbound payloads accept both the openpi-client markers above and the legacy vLLM-native markers: ndarray -> {nd: true, type, kind, shape, data} scalar -> {nd: false, type, kind, data}

kind is required on the nd markers because it is what separates them from a plain user mapping, but its value is dialect-specific: the vLLM-native markers carry the dtype kind character while the msgpack-numpy package leaves it empty for plain dtypes and sets "V" for structured ones. Both spellings are accepted. Scalars packed by msgpack-numpy omit kind entirely and are therefore left as mappings.

MAX_OPENPI_PAYLOAD_BYTES module-attribute

MAX_OPENPI_PAYLOAD_BYTES = 64 * 1024 * 1024

MAX_TRACKED_SESSIONS module-attribute

MAX_TRACKED_SESSIONS = 1024

logger module-attribute

logger = init_logger(__name__)

RobotRealtimeConnection

WebSocket connection for robot policy inference.

serving instance-attribute

serving = serving

websocket instance-attribute

websocket = websocket

handle_connection async

handle_connection() -> None

Main loop for OpenPI-compatible policy serving.

reset

reset() -> None