rfx.hub module provides the main entry points for working with saved policies. It supports both local paths and HuggingFace Hub models.
Functions
load_policy
Load a self-describing policy from a local path or HuggingFace Hub.Local directory path, or
"hf://org/repo" for Hub models.LoadedPolicy with .policy, .robot_config, .normalizer, .config
push_policy
Push a saved policy directory to HuggingFace Hub.Local directory containing the saved policy.
HuggingFace repo ID (e.g.
"rfx-community/go2-walk-v1").Whether to create a private repo.
str - The URL of the uploaded model.
inspect_policy
Readrfx_config.json without loading weights. Useful for quick inspection.
Local directory path, or
"hf://org/repo" for Hub models.dict[str, Any] - The parsed rfx_config.json dict.
Classes
LoadedPolicy
A loaded policy with all its metadata. Callable — accepts the obs dict thatrobot.observe() returns and handles torch↔tinygrad conversion automatically.
Attributes
The policy network (e.g. MLP, JitPolicy, TorchJitPolicy).
Robot configuration bundled with the policy.
Observation normalizer (mean/std scaling).
Full policy metadata from
rfx_config.json.Properties
Policy class name (e.g.
"MLP", "TorchJitPolicy").Training metadata (steps, rewards, etc.).
Methods
__call__(obs)
Run inference on observations.
Observations from
robot.observe() or raw tinygrad tensor.torch.Tensor - Action tensor.