# lx567/gr00t2 architecture

> Architecture diagram of the GitHub repository lx567/gr00t2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lx567/gr00t2
- Repository: https://github.com/lx567/gr00t2

## Overview

GR00T 2 is a community implementation of a generalist robotics world-action model. Its principal workflow is multimodal episode preparation and curation, three-stage model pretraining and LoRA adaptation, then transfer or RL post-training before inference and robot control. Distinct branches add agentic planning, Unitree whole-body control, and policy evaluation. The README documents these capabilities and the sampled code confirms selected component responsibilities; several cross-module calls are not visible, so uncertain connections are omitted rather than inferred.

Main entry points: [`models/wam.py`](https://github.com/lx567/gr00t2/blob/main/models/wam.py) (World-action model), [`x_adapt`](https://github.com/lx567/gr00t2/tree/main/x_adapt) (Cross-embodiment transfer), [`deployment/serving.py`](https://github.com/lx567/gr00t2/blob/main/deployment/serving.py) (Policy serving), [`rl/grpo_cps.py`](https://github.com/lx567/gr00t2/blob/main/rl/grpo_cps.py) (CPS-GRPO)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_model["Data and WAM"]
  node_ingestion["Data ingestion<br/>[ingestion.py]"]
  node_flora["Flora curation<br/>[flora.py]"]
  node_human_qc["Human-1M QC<br/>[human1m_qc.py]"]
  node_preprocessing["Video preprocessing<br/>[preprocessing.py]"]
  node_dataset[("LanceDS loader<br/>[lanceds_loader.py]")]
  node_trainer["Pretraining trainer<br/>[trainer.py]"]
  node_wam["World-action model<br/>[wam.py]"]
  node_dit["DiT backbone<br/>[dit.py]"]
  node_encoders["Embodiment encoders<br/>[encoders.py]"]
  node_vae["Video VAE<br/>[vae.py]"]
  node_config["Model configuration<br/>[model_config.py]"]
end

subgraph group_adaptation["Adaptation and RL"]
  node_xadapt["Cross-embodiment transfer"]
  node_retarget["Motion retargeting<br/>[retargeting.py]"]
  node_umi["UMI transfer<br/>[umi_transfer.py]"]
  node_dexumi["DexUMI adaptation<br/>[dexumi.py]"]
  node_human_sim["Human-to-sim<br/>[human_to_sim.py]"]
  node_dreamdojo["DreamDojo simulator<br/>[dreamdojo_env.py]"]
  node_grpo["CPS-GRPO<br/>[grpo_cps.py]"]
  node_self_imitation["Self-imitation<br/>[self_imitation.py]"]
  node_residual_rl["Residual SAC<br/>[residual_rl.py]"]
end

subgraph group_agentic["Agentic Robotics"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
  node_cap["CaP primitives<br/>[cap_primitives.py]"]
  node_aspire["ASPIRE orchestration<br/>[aspire.py]"]
  node_visual_steering["Visual steering"]
  node_loco["Loco-manipulation"]
  node_sonic["SONIC controller"]
end

subgraph group_deployment_eval["Deployment and Evaluation"]
  node_rtc["RTC controller<br/>[rtc_controller.py]"]
  node_retiming["Phase retiming<br/>[phase_retiming.py]"]
  node_serving["Policy serving<br/>[serving.py]"]
  node_arena["GearArena evaluation<br/>[gear_arena.py]"]
end

node_user(("Researcher"))
node_robot(("Robot operator"))

node_user -.->|"provides episodes"| node_ingestion
node_ingestion -->|"curates episodes"| node_flora
node_ingestion -->|"stores episodes"| node_dataset
node_dataset -.->|"supplies training data"| node_trainer
node_trainer -.->|"trains"| node_wam
node_wam -->|"uses backbone"| node_dit
node_wam -->|"uses encoders"| node_encoders
node_wam -->|"uses VAE"| node_vae
node_config -.->|"configures"| node_wam
node_wam -.->|"supports adaptation"| node_xadapt
node_xadapt -->|"includes retargeting"| node_retarget
node_xadapt -->|"includes transfer"| node_umi
node_xadapt -->|"includes adaptation"| node_dexumi
node_xadapt -->|"includes simulation transfer"| node_human_sim
node_wam -.->|"policy post-training"| node_grpo
node_dreamdojo -.->|"simulates experience"| node_grpo
node_grpo -.->|"supports post-training"| node_self_imitation
node_grpo -.->|"supports post-training"| node_residual_rl
node_wam -.->|"provides actions"| node_mcp
node_mcp -.->|"exposes primitives"| node_cap
node_aspire -.->|"uses primitives"| node_cap
node_aspire -.->|"coordinates steering"| node_visual_steering
node_loco -.->|"dispatches control"| node_sonic
node_wam -.->|"serves inference"| node_serving
node_serving -.->|"uses chunk control"| node_rtc
node_serving -.->|"supports retiming"| node_retiming
node_robot -.->|"requests inference"| node_serving
node_serving -.->|"evaluates policies"| node_arena

click node_ingestion "https://github.com/lx567/gr00t2/blob/main/infrastructure/ingestion.py"
click node_flora "https://github.com/lx567/gr00t2/blob/main/data/flora.py"
click node_human_qc "https://github.com/lx567/gr00t2/blob/main/data/human1m_qc.py"
click node_preprocessing "https://github.com/lx567/gr00t2/blob/main/data/preprocessing.py"
click node_dataset "https://github.com/lx567/gr00t2/blob/main/infrastructure/lanceds_loader.py"
click node_trainer "https://github.com/lx567/gr00t2/blob/main/infrastructure/trainer.py"
click node_wam "https://github.com/lx567/gr00t2/blob/main/models/wam.py"
click node_dit "https://github.com/lx567/gr00t2/blob/main/models/dit.py"
click node_encoders "https://github.com/lx567/gr00t2/blob/main/models/encoders.py"
click node_vae "https://github.com/lx567/gr00t2/blob/main/models/vae.py"
click node_config "https://github.com/lx567/gr00t2/blob/main/configs/model_config.py"
click node_xadapt "https://github.com/lx567/gr00t2/tree/main/x_adapt"
click node_retarget "https://github.com/lx567/gr00t2/blob/main/x_adapt/retargeting.py"
click node_umi "https://github.com/lx567/gr00t2/blob/main/x_adapt/umi_transfer.py"
click node_dexumi "https://github.com/lx567/gr00t2/blob/main/x_adapt/dexumi.py"
click node_human_sim "https://github.com/lx567/gr00t2/blob/main/x_adapt/human_to_sim.py"
click node_dreamdojo "https://github.com/lx567/gr00t2/blob/main/rl/dreamdojo_env.py"
click node_grpo "https://github.com/lx567/gr00t2/blob/main/rl/grpo_cps.py"
click node_self_imitation "https://github.com/lx567/gr00t2/blob/main/rl/self_imitation.py"
click node_residual_rl "https://github.com/lx567/gr00t2/blob/main/rl/residual_rl.py"
click node_mcp "https://github.com/lx567/gr00t2/blob/main/agentic/mcp_server.py"
click node_cap "https://github.com/lx567/gr00t2/blob/main/agentic/cap_primitives.py"
click node_aspire "https://github.com/lx567/gr00t2/blob/main/agentic/aspire.py"
click node_visual_steering "https://github.com/lx567/gr00t2/blob/main/agentic/visual_steering_agent.py"
click node_loco "https://github.com/lx567/gr00t2/blob/main/humanoid/loco_manipulation.py"
click node_sonic "https://github.com/lx567/gr00t2/blob/main/humanoid/sonic_controller.py"
click node_rtc "https://github.com/lx567/gr00t2/blob/main/deployment/rtc_controller.py"
click node_retiming "https://github.com/lx567/gr00t2/blob/main/deployment/phase_retiming.py"
click node_serving "https://github.com/lx567/gr00t2/blob/main/deployment/serving.py"
click node_arena "https://github.com/lx567/gr00t2/blob/main/evaluation/gear_arena.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_ingestion,node_flora,node_human_qc,node_preprocessing,node_dataset,node_trainer,node_wam,node_dit,node_encoders,node_vae,node_config toneBlue
class node_xadapt,node_retarget,node_umi,node_dexumi,node_human_sim,node_dreamdojo,node_grpo,node_self_imitation,node_residual_rl toneAmber
class node_mcp,node_cap,node_aspire,node_visual_steering,node_loco,node_sonic toneMint
class node_rtc,node_retiming,node_serving,node_arena toneRose
class node_user,node_robot toneIndigo
```

## Components

### Data and WAM

- [Data ingestion](https://github.com/lx567/gr00t2/blob/main/infrastructure/ingestion.py): `infrastructure/ingestion.py`
- [Flora curation](https://github.com/lx567/gr00t2/blob/main/data/flora.py): `data/flora.py`
- [Human-1M QC](https://github.com/lx567/gr00t2/blob/main/data/human1m_qc.py): `data/human1m_qc.py`
- [Video preprocessing](https://github.com/lx567/gr00t2/blob/main/data/preprocessing.py): `data/preprocessing.py`
- [LanceDS loader](https://github.com/lx567/gr00t2/blob/main/infrastructure/lanceds_loader.py): `infrastructure/lanceds_loader.py`
- [Pretraining trainer](https://github.com/lx567/gr00t2/blob/main/infrastructure/trainer.py): `infrastructure/trainer.py`
- [World-action model](https://github.com/lx567/gr00t2/blob/main/models/wam.py): `models/wam.py`
- [DiT backbone](https://github.com/lx567/gr00t2/blob/main/models/dit.py): `models/dit.py`
- [Embodiment encoders](https://github.com/lx567/gr00t2/blob/main/models/encoders.py): `models/encoders.py`
- [Video VAE](https://github.com/lx567/gr00t2/blob/main/models/vae.py): `models/vae.py`
- [Model configuration](https://github.com/lx567/gr00t2/blob/main/configs/model_config.py): `configs/model_config.py`

### Adaptation and RL

- [Cross-embodiment transfer](https://github.com/lx567/gr00t2/tree/main/x_adapt): `x_adapt`
- [Motion retargeting](https://github.com/lx567/gr00t2/blob/main/x_adapt/retargeting.py): `x_adapt/retargeting.py`
- [UMI transfer](https://github.com/lx567/gr00t2/blob/main/x_adapt/umi_transfer.py): `x_adapt/umi_transfer.py`
- [DexUMI adaptation](https://github.com/lx567/gr00t2/blob/main/x_adapt/dexumi.py): `x_adapt/dexumi.py`
- [Human-to-sim](https://github.com/lx567/gr00t2/blob/main/x_adapt/human_to_sim.py): `x_adapt/human_to_sim.py`
- [DreamDojo simulator](https://github.com/lx567/gr00t2/blob/main/rl/dreamdojo_env.py): `rl/dreamdojo_env.py`
- [CPS-GRPO](https://github.com/lx567/gr00t2/blob/main/rl/grpo_cps.py): `rl/grpo_cps.py`
- [Self-imitation](https://github.com/lx567/gr00t2/blob/main/rl/self_imitation.py): `rl/self_imitation.py`
- [Residual SAC](https://github.com/lx567/gr00t2/blob/main/rl/residual_rl.py): `rl/residual_rl.py`

### Agentic Robotics

- [MCP server](https://github.com/lx567/gr00t2/blob/main/agentic/mcp_server.py): `agentic/mcp_server.py`
- [CaP primitives](https://github.com/lx567/gr00t2/blob/main/agentic/cap_primitives.py): `agentic/cap_primitives.py`
- [ASPIRE orchestration](https://github.com/lx567/gr00t2/blob/main/agentic/aspire.py): `agentic/aspire.py`
- [Visual steering](https://github.com/lx567/gr00t2/blob/main/agentic/visual_steering_agent.py): `agentic/visual_steering_agent.py`
- [Loco-manipulation](https://github.com/lx567/gr00t2/blob/main/humanoid/loco_manipulation.py): `humanoid/loco_manipulation.py`
- [SONIC controller](https://github.com/lx567/gr00t2/blob/main/humanoid/sonic_controller.py): `humanoid/sonic_controller.py`

### Deployment and Evaluation

- [RTC controller](https://github.com/lx567/gr00t2/blob/main/deployment/rtc_controller.py): `deployment/rtc_controller.py`
- [Phase retiming](https://github.com/lx567/gr00t2/blob/main/deployment/phase_retiming.py): `deployment/phase_retiming.py`
- [Policy serving](https://github.com/lx567/gr00t2/blob/main/deployment/serving.py): `deployment/serving.py`
- [GearArena evaluation](https://github.com/lx567/gr00t2/blob/main/evaluation/gear_arena.py): `evaluation/gear_arena.py`

### Other components

- **Researcher**
- **Robot operator**

## Connections

- Researcher → Data ingestion: provides episodes
- Data ingestion → Flora curation: curates episodes (evidence: `infrastructure/ingestion.py`)
- Data ingestion → LanceDS loader: stores episodes (evidence: `infrastructure/ingestion.py`)
- LanceDS loader → Pretraining trainer: supplies training data
- Pretraining trainer → World-action model: trains
- World-action model → DiT backbone: uses backbone (evidence: `models/wam.py`)
- World-action model → Embodiment encoders: uses encoders (evidence: `models/wam.py`)
- World-action model → Video VAE: uses VAE (evidence: `models/wam.py`)
- Model configuration → World-action model: configures
- World-action model → Cross-embodiment transfer: supports adaptation
- Cross-embodiment transfer → Motion retargeting: includes retargeting (evidence: `README.md`)
- Cross-embodiment transfer → UMI transfer: includes transfer (evidence: `README.md`)
- Cross-embodiment transfer → DexUMI adaptation: includes adaptation (evidence: `README.md`)
- Cross-embodiment transfer → Human-to-sim: includes simulation transfer (evidence: `README.md`)
- World-action model → CPS-GRPO: policy post-training
- DreamDojo simulator → CPS-GRPO: simulates experience
- CPS-GRPO → Self-imitation: supports post-training
- CPS-GRPO → Residual SAC: supports post-training
- World-action model → MCP server: provides actions
- MCP server → CaP primitives: exposes primitives
- ASPIRE orchestration → CaP primitives: uses primitives
- ASPIRE orchestration → Visual steering: coordinates steering
- Loco-manipulation → SONIC controller: dispatches control
- World-action model → Policy serving: serves inference
- Policy serving → RTC controller: uses chunk control
- Policy serving → Phase retiming: supports retiming
- Robot operator → Policy serving: requests inference
- Policy serving → GearArena evaluation: evaluates policies
