# openpi drop-in — INSTALL These files let you **serve** (and retrain) the `pi05_g1_inspire_piston_lora_abs_st` checkpoint in this repo with the [openpi](https://github.com/Physical-Intelligence/openpi) codebase. ## Our fork state (be honest about this) This checkpoint was produced from a **fork** of openpi: ``` upstream: Physical-Intelligence/openpi @ 15a9616 ("update output objects to support batching", #975) + 5 local commits (HEAD = 9088f209): 99456de scripts: in-process pi0.5 -> GR00T-WBC-Bridge ZMQ adapter (piston) b08d778 g1-inspire: land the G1+Inspire pi0.5 fine-tune baseline (redball + piston v1) 2838d42 training: state-dropout (p=0.8) retrain config for the piston LoRA fine-tune 4297d2c training: absolute-action retrain config for the piston LoRA fine-tune 9088f20 training: closure-observability retrain config (discrete state tokens + omission dropout) ``` `git diff --stat 15a9616 HEAD` touches exactly these files: ``` scripts/zmq_adapter_pi05.py | 376 + (new — GR00T ZMQ serving adapter) src/openpi/policies/g1_inspire_policy.py | 94 + (new — G1Inspire transforms) src/openpi/training/checkpoints.py | 2 +- (checkpoint retention, train-only) src/openpi/training/config.py | 316 + (piston configs + LeRobotG1InspireDataConfig + 2 DataConfig fields) src/openpi/training/data_loader.py | 27 + (state/token dropout injection, train-only) src/openpi/transforms.py | 102 +- (StateDropout, StateTokenDropout, TokenizePrompt state-omission path) ``` ## What SERVING actually needs (from a clean upstream 15a9616 checkout) Good news: the `discrete_state_input=True` behaviour this checkpoint relies on — discretizing the normalized 29-D proprio state into 256 bins and injecting it into the prompt (`"Task: ..., State: ;\nAction: "`) — is **already upstream** in `src/openpi/models/tokenizer.py` and in `TokenizePrompt` (the `discrete_state_input` flag is native pi0.5). So is the `state=None` prompt format. You do **not** need any tokenizer patch to serve. The load-bearing **local** pieces for serving are only: 1. **`src/openpi/policies/g1_inspire_policy.py`** — copy `g1_inspire_policy.py` from this folder. Defines `G1InspireInputs` / `G1InspireOutputs` (key remap, 29-D proprio slice, 30-D action truncation). 2. **`LeRobotG1InspireDataConfig`** — paste the class from `config_entry.py` part (2) into `src/openpi/training/config.py` and add `from openpi.policies import g1_inspire_policy` to its imports. 3. **The two `DataConfig` fields** — paste `state_dropout_prob` and `state_token_dropout_prob` from `config_entry.py` part (3) into the `DataConfig` dataclass. Both are train-only, but the config in (1) passes `state_token_dropout_prob=0.8`, so the field must **exist** or the config won't construct. 4. **The `TrainConfig` entry** — paste `config_entry.py` part (1) into the `_CONFIGS` list. The `StateDropout` / `StateTokenDropout` transforms and the `data_loader.transform_dataset` dropout injection are **train-only** — not needed to serve, but you'll want them (from our fork) if you retrain. The simplest path is to `git clone` our fork state (upstream @ `15a9616` + cherry-pick `99456de..9088f20`) rather than hand-splice. ## Serving See the repo `README.md` "Serving" section. In short, from an openpi checkout with its `.venv`: ```bash # ckpt_dir = the directory you downloaded this HF repo into (contains params/, assets/, _CHECKPOINT_METADATA) XLA_PYTHON_CLIENT_PREALLOCATE=false .venv/bin/python scripts/zmq_adapter_pi05.py \ --config pi05_g1_inspire_piston_lora_abs_st \ --ckpt_dir \ --port 5555 ```