Skip to main content

Design goals

  • One simple Python API for AI robotics workloads.
  • Three methods per robot: observe(), act(), reset().
  • Simulation and collection are first-class SDK surfaces.
  • Every saved model is self-describing — load and deploy with zero context.
  • HuggingFace Hub native — push and pull policies like datasets.

Install

uv pip install rfx-sdk
Or add to a project:
uv add rfx-sdk

Quick start

import rfx

robot = rfx.MockRobot(state_dim=12, action_dim=6)
obs = robot.observe()

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

Robot interface

Every robot implements three methods:
obs = robot.observe()   # {"state": Tensor(1, N), "images": ...}
robot.act(action)       # Tensor(1, N)
robot.reset()
Built-in robots:
robot = rfx.SimRobot.from_config("so101.yaml", backend="genesis", viewer=True)
robot = rfx.MockRobot(state_dim=12, action_dim=6)
robot = rfx.RealRobot(rfx.SO101_CONFIG)
See the robot interface page for the full contract.

Collection

dataset = rfx.collection.collect(
    "so101",
    "my-org/demos",
    episodes=2,
    duration_s=10,
)

Package layout

rfx/python/rfx/
├── robot/          # Robot protocol, config, URDF
├── collection/     # Collection and dataset contracts
├── real/           # Real hardware backends (SO-101, Go2, G1)
├── sim/            # Simulation backends (MuJoCo, Genesis, mock)
├── runtime/        # Lifecycle, CLI, health, runtime helpers
├── hub.py          # Model save/load/push (HuggingFace Hub)
├── session.py      # Rate-controlled control loop
├── deploy.py       # rfx.deploy() implementation
├── decorators.py   # @policy, MotorCommands
├── node.py         # Zenoh transport factory & discovery
└── observation.py  # Observation spec & padding

Reference

Deploy API

rfx.deploy() signature and return value.

Policies

@rfx.policy and the policy callable contract.

MotorCommands

Named joint control without hardcoded indices.

Model management

Save, load, inspect, and push policies.

Hardware configs

Built-in robot configs: SO-101, Go2, G1.