# pd-perry/expo-ft architecture

> Architecture diagram of the GitHub repository pd-perry/expo-ft, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pd-perry/expo-ft
- Repository: https://github.com/pd-perry/expo-ft

## Overview

EXPO-FT is a VLA reinforcement-learning fine-tuning system with a learner server and a DROID robot actor. The principal workflow collects robot observations and transitions, sends rollout operations over WebSocket, stores experience, samples training batches, updates a VLA-based learner, and uses the policy for subsequent actions. The README also documents asynchronous training, offline RTC-SFT, standalone evaluation, and demonstration collection. Some subsystem links are documented at the README level because their implementation files were not sampled.

Main entry points: [`train_pi_robo.py`](https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo.py) (Online training), [`expo_ft/agents/alg/realtime_expo_ft.py`](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/realtime_expo_ft.py) (Real-time EXPO-FT), [`train_pi_robo_async.py`](https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo_async.py) (Async training), [`expo_ft/agents/alg/expo_ft.py`](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/expo_ft.py) (EXPO-FT learner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_actor["Robot actor"]
  node_client_runtime["Rollout client<br/>[run_client.py]"]
  node_droid_env["DROID environment<br/>[droid_env.py]"]
  node_camera["Camera recording<br/>[zed_recorder.py]"]
  node_success["Success detection<br/>[detector.py]"]
  node_teleop["Demonstration collection<br/>[collect_data.py]"]
  node_spacemouse["Spacemouse input<br/>[spacemouse.py]"]
end

subgraph group_runtime["Rollout runtime"]
  node_env_client["WebSocket environment client<br/>[env_client.py]"]
  node_task_config["Task configuration<br/>[real_base.py]"]
  node_logs["Training utilities<br/>[train_utils.py]"]
end

subgraph group_learning["Learner and algorithms"]
  node_train["Online training<br/>[train_pi_robo.py]"]
  node_async_train["Async training"]
  node_offline_rtc["RTC-SFT training"]
  node_evaluation["Policy evaluation"]
  node_expo["EXPO-FT learner<br/>[expo_ft.py]"]
  node_realtime["Real-time EXPO-FT"]
  node_bc["Behavior cloning<br/>[bc.py]"]
  node_rtc["RTC learner<br/>[rtc.py]"]
end

subgraph group_data["Experience pipeline"]
  node_batch_processor["Batch processing<br/>[batch_processor.py]"]
  node_replay_buffer[("Replay buffer<br/>[replay_buffer.py]")]
  node_dataset["Dataset<br/>[dataset.py]"]
end

subgraph group_policy["Policy and models"]
  node_pi05["Pi0.5 VLA<br/>[pi05.py]"]
  node_networks["Critic networks"]
  node_augmentation["Image augmentation<br/>[augmentation.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts rollout"| node_client_runtime
node_operator -->|"collects demos"| node_teleop
node_teleop -->|"reads input"| node_spacemouse
node_client_runtime -->|"steps environment"| node_droid_env
node_droid_env -->|"records frames"| node_camera
node_droid_env -->|"checks success"| node_success
node_client_runtime -->|"replies over WebSocket"| node_env_client
node_task_config -->|"configures task"| node_droid_env
node_train -->|"requests rollouts"| node_env_client
node_train -->|"builds batches"| node_batch_processor
node_async_train -->|"requests rollouts"| node_env_client
node_async_train -->|"builds batches"| node_batch_processor
node_batch_processor -->|"samples experience"| node_replay_buffer
node_replay_buffer -->|"extends dataset"| node_dataset
node_train -->|"stores experience"| node_replay_buffer
node_train -->|"selects learner"| node_expo
node_async_train -->|"selects learner"| node_realtime
node_async_train -->|"selects learner"| node_bc
node_train -->|"selects learner"| node_realtime
node_train -->|"selects learner"| node_bc
node_offline_rtc -->|"trains base policy"| node_rtc
node_evaluation -->|"uses rollout interface"| node_env_client
node_expo -->|"uses VLA policy"| node_pi05
node_realtime -->|"uses VLA policy"| node_pi05
node_bc -->|"trains VLA policy"| node_pi05
node_rtc -->|"conditions VLA policy"| node_pi05
node_expo -->|"uses critics"| node_networks
node_realtime -->|"uses critics"| node_networks
node_expo -->|"augments batches"| node_augmentation
node_realtime -->|"augments batches"| node_augmentation
node_train -->|"initializes training"| node_logs

click node_train "https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo.py"
click node_async_train "https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo_async.py"
click node_offline_rtc "https://github.com/pd-perry/expo-ft/blob/main/train_offline_rtc.py"
click node_evaluation "https://github.com/pd-perry/expo-ft/blob/main/eval_droid_policy.py"
click node_client_runtime "https://github.com/pd-perry/expo-ft/blob/main/client/run_client.py"
click node_droid_env "https://github.com/pd-perry/expo-ft/blob/main/client/envs/droid_env.py"
click node_camera "https://github.com/pd-perry/expo-ft/blob/main/client/envs/zed_recorder.py"
click node_success "https://github.com/pd-perry/expo-ft/blob/main/client/real_utils/detector.py"
click node_teleop "https://github.com/pd-perry/expo-ft/blob/main/client/collect_data.py"
click node_spacemouse "https://github.com/pd-perry/expo-ft/blob/main/client/real_utils/spacemouse.py"
click node_env_client "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/env/env_client.py"
click node_task_config "https://github.com/pd-perry/expo-ft/blob/main/configs/task/real_base.py"
click node_batch_processor "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/batch_processor.py"
click node_replay_buffer "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/replay_buffer.py"
click node_dataset "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/dataset.py"
click node_expo "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/expo_ft.py"
click node_realtime "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/realtime_expo_ft.py"
click node_bc "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/bc.py"
click node_rtc "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/rtc.py"
click node_pi05 "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/vla/pi05.py"
click node_networks "https://github.com/pd-perry/expo-ft/tree/main/expo_ft/networks"
click node_augmentation "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/utils/augmentation.py"
click node_logs "https://github.com/pd-perry/expo-ft/blob/main/expo_ft/utils/train_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_runtime,node_droid_env,node_camera,node_success,node_teleop,node_spacemouse toneBlue
class node_env_client,node_task_config,node_logs toneAmber
class node_train,node_async_train,node_offline_rtc,node_evaluation,node_expo,node_realtime,node_bc,node_rtc toneMint
class node_batch_processor,node_replay_buffer,node_dataset toneRose
class node_pi05,node_networks,node_augmentation,node_operator toneIndigo
```

## Components

### Robot actor

- [Rollout client](https://github.com/pd-perry/expo-ft/blob/main/client/run_client.py): `client/run_client.py`
- [DROID environment](https://github.com/pd-perry/expo-ft/blob/main/client/envs/droid_env.py): `client/envs/droid_env.py`
- [Camera recording](https://github.com/pd-perry/expo-ft/blob/main/client/envs/zed_recorder.py): `client/envs/zed_recorder.py`
- [Success detection](https://github.com/pd-perry/expo-ft/blob/main/client/real_utils/detector.py): `client/real_utils/detector.py`
- [Demonstration collection](https://github.com/pd-perry/expo-ft/blob/main/client/collect_data.py): `client/collect_data.py`
- [Spacemouse input](https://github.com/pd-perry/expo-ft/blob/main/client/real_utils/spacemouse.py): `client/real_utils/spacemouse.py`

### Rollout runtime

- [WebSocket environment client](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/env/env_client.py): `expo_ft/env/env_client.py`
- [Task configuration](https://github.com/pd-perry/expo-ft/blob/main/configs/task/real_base.py): `configs/task/real_base.py`
- [Training utilities](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/utils/train_utils.py): `expo_ft/utils/train_utils.py`

### Learner and algorithms

- [Online training](https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo.py): `train_pi_robo.py`
- [Async training](https://github.com/pd-perry/expo-ft/blob/main/train_pi_robo_async.py): `train_pi_robo_async.py`
- [RTC-SFT training](https://github.com/pd-perry/expo-ft/blob/main/train_offline_rtc.py): `train_offline_rtc.py`
- [Policy evaluation](https://github.com/pd-perry/expo-ft/blob/main/eval_droid_policy.py): `eval_droid_policy.py`
- [EXPO-FT learner](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/expo_ft.py): `expo_ft/agents/alg/expo_ft.py`
- [Real-time EXPO-FT](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/realtime_expo_ft.py): `expo_ft/agents/alg/realtime_expo_ft.py`
- [Behavior cloning](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/bc.py): `expo_ft/agents/alg/bc.py`
- [RTC learner](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/alg/rtc.py): `expo_ft/agents/alg/rtc.py`

### Experience pipeline

- [Batch processing](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/batch_processor.py): `expo_ft/data/batch_processor.py`
- [Replay buffer](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/replay_buffer.py): `expo_ft/data/replay_buffer.py`
- [Dataset](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/data/dataset.py): `expo_ft/data/dataset.py`

### Policy and models

- [Pi0.5 VLA](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/agents/vla/pi05.py): `expo_ft/agents/vla/pi05.py`
- [Critic networks](https://github.com/pd-perry/expo-ft/tree/main/expo_ft/networks): `expo_ft/networks`
- [Image augmentation](https://github.com/pd-perry/expo-ft/blob/main/expo_ft/utils/augmentation.py): `expo_ft/utils/augmentation.py`

### Other components

- **Operator**

## Connections

- Operator → Rollout client: starts rollout
- Operator → Demonstration collection: collects demos
- Demonstration collection → Spacemouse input: reads input (evidence: `client/collect_data.py`)
- Rollout client → DROID environment: steps environment
- DROID environment → Camera recording: records frames (evidence: `client/envs/droid_env.py`)
- DROID environment → Success detection: checks success (evidence: `client/envs/droid_env.py`)
- Rollout client → WebSocket environment client: replies over WebSocket
- Task configuration → DROID environment: configures task (evidence: `configs/task/light2.py`)
- Online training → WebSocket environment client: requests rollouts (evidence: `train_pi_robo.py`)
- Online training → Batch processing: builds batches (evidence: `train_pi_robo.py`)
- Async training → WebSocket environment client: requests rollouts (evidence: `train_pi_robo_async.py`)
- Async training → Batch processing: builds batches (evidence: `train_pi_robo_async.py`)
- Batch processing → Replay buffer: samples experience (evidence: `expo_ft/data/batch_processor.py`)
- Replay buffer → Dataset: extends dataset (evidence: `expo_ft/data/replay_buffer.py`)
- Online training → Replay buffer: stores experience (evidence: `train_pi_robo.py`)
- Online training → EXPO-FT learner: selects learner (evidence: `train_pi_robo.py`)
- Async training → Real-time EXPO-FT: selects learner (evidence: `train_pi_robo_async.py`)
- Async training → Behavior cloning: selects learner (evidence: `train_pi_robo_async.py`)
- Online training → Real-time EXPO-FT: selects learner (evidence: `train_pi_robo.py`)
- Online training → Behavior cloning: selects learner (evidence: `train_pi_robo.py`)
- RTC-SFT training → RTC learner: trains base policy
- Policy evaluation → WebSocket environment client: uses rollout interface
- EXPO-FT learner → Pi0.5 VLA: uses VLA policy
- Real-time EXPO-FT → Pi0.5 VLA: uses VLA policy
- Behavior cloning → Pi0.5 VLA: trains VLA policy
- RTC learner → Pi0.5 VLA: conditions VLA policy
- EXPO-FT learner → Critic networks: uses critics (evidence: `expo_ft/agents/alg/expo_ft.py`)
- Real-time EXPO-FT → Critic networks: uses critics (evidence: `expo_ft/agents/alg/realtime_expo_ft.py`)
- EXPO-FT learner → Image augmentation: augments batches (evidence: `expo_ft/agents/alg/expo_ft.py`)
- Real-time EXPO-FT → Image augmentation: augments batches (evidence: `expo_ft/agents/alg/realtime_expo_ft.py`)
- Online training → Training utilities: initializes training (evidence: `train_pi_robo.py`)
