Skip to main content
rfx.deploy() is the main entry point. It handles everything: load policy, resolve robot config, create robot, run the control loop.

Signature

stats = rfx.deploy(
    "runs/my-policy",       # path, hf:// URL, or .py file
    robot="so101",           # robot type or YAML path
    port="/dev/ttyACM0",     # optional hardware override
    rate_hz=50,              # control frequency
    duration=30,             # seconds (None = infinite)
    mock=False,              # use MockRobot instead
    device="cpu",            # torch device
)

Parameters

ParameterTypeDefaultDescription
policystr | PathrequiredPath to policy dir, hf://org/repo, or .py file.
robotstr | PathautoRobot type (so101, go2, g1) or YAML config path.
portstrautoSerial port or IP override.
rate_hzfloatconfigControl loop frequency. Defaults to robot config.
durationfloat | NoneNoneRun time in seconds. None runs until Ctrl+C.
mockboolFalseUse MockRobot instead of real hardware.
devicestr"cpu"Torch device for inference.
warmupfloat0.5Seconds to sleep after reset before starting.

Return value

Returns a stats object with timing information:
stats.iterations      # total control loop steps
stats.overruns        # steps that missed their deadline
stats.p50_jitter_s    # median per-step jitter
stats.p95_jitter_s    # 95th percentile per-step jitter

Auto-detection

If the policy artifact stored a robot config (via policy.save(..., robot_config=config)), robot is inferred automatically. Explicit robot or config overrides the stored value.

Examples

rfx.deploy("runs/my-policy", robot="so101")