> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryreflex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install rfx, record a demo, and deploy a policy.

## 1. Install

<CodeGroup>
  ```bash uv theme={null}
  uv pip install rfx-sdk
  ```

  ```bash pip theme={null}
  pip install rfx-sdk
  ```

  ```bash from source theme={null}
  git clone https://github.com/quantbagel/rfx.git && cd rfx
  bash scripts/setup-from-source.sh
  ```
</CodeGroup>

Check the environment:

```bash theme={null}
rfx doctor
```

## 2. Record a demo

Collection is a first-class primitive. Record episodes into a LeRobot dataset:

```bash theme={null}
rfx record \
  --robot so101 \
  --repo-id my-org/demos \
  --episodes 10 \
  --duration 30
```

No hardware? Use `--mock`:

```bash theme={null}
rfx record --robot so101 --repo-id my-org/demos --mock --duration 5
```

## 3. Deploy a policy

Deploy from a saved checkpoint, HuggingFace Hub, or a Python file:

<CodeGroup>
  ```bash checkpoint theme={null}
  rfx deploy runs/my-policy --robot so101
  ```

  ```bash hub theme={null}
  rfx deploy hf://rfx-community/go2-walk-v1 --robot go2
  ```

  ```bash python file theme={null}
  rfx deploy my_policy.py --robot so101
  ```

  ```bash dry-run theme={null}
  rfx deploy runs/my-policy --robot so101 --mock
  ```
</CodeGroup>

`rfx deploy` loads weights, resolves the robot config, connects hardware, and
runs the control loop with rate control, jitter tracking, and clean shutdown
on Ctrl+C.

## 4. Write a policy

A policy is any callable `Dict[str, Tensor] -> Tensor`. Use `@rfx.policy` to
make it deployable from the CLI:

```python my_policy.py theme={null}
import torch
import rfx

@rfx.policy
def hold_position(obs):
    return torch.zeros(1, 6)  # hold still (SO-101 has 6 joints)
```

```bash theme={null}
rfx deploy my_policy.py --robot so101
```

## Next steps

<CardGroup cols={2}>
  <Card title="SO-101 quickstart" icon="arm-flex" href="/guides/so101">
    End-to-end setup for the 6-DOF arm.
  </Card>

  <Card title="Simulation guide" icon="cube" href="/guides/simulation">
    Run without hardware using Genesis or a mock robot.
  </Card>

  <Card title="Python SDK" icon="python" href="/sdk/overview">
    Full reference for `observe()`, `act()`, `deploy()`, and artifacts.
  </Card>

  <Card title="Operator checklist" icon="clipboard-check" href="/guides/operator-checklist">
    Preflight gates before a production deploy.
  </Card>
</CardGroup>
