Skip to content

Orchestra-Research/AI-Research-SKILLs / 18-multimodal/openpi

fine-tuning-serving-openpi

Verified

Fine-tune and serve Physical Intelligence OpenPI models (pi0, pi0-fast, pi0.5) using JAX or PyTorch backends for robot policy inference across ALOHA, DROID, and LIBERO environments. Use when adapting pi0 models to custom datasets, converting JAX checkpoints to PyTorch, running policy inference servers, or debugging norm stats and GPU memory issues.

references/remote-client-pattern.md

View on GitHub
# Remote Client Pattern

Use this pattern when the policy server runs on a GPU machine and control code runs elsewhere.

## Server side

```bash
uv run scripts/serve_policy.py --env DROID
# or
uv run scripts/serve_policy.py policy:checkpoint \
  --policy.config=pi05_droid \
  --policy.dir=gs://openpi-assets/checkpoints/pi05_droid
```

Default port is `8000`.

## Robot or eval client side

Install client package:

```bash
uv pip install -e packages/openpi-client
```

Call server from Python:

```python
from openpi_client import websocket_client_policy

client = websocket_client_policy.WebsocketClientPolicy(host="server-ip", port=8000)
result = client.infer(observation)
actions = result["actions"]
```

## Observation contract checks

- Pass observation keys expected by your policy transforms.
- Pass prompt as `observation["prompt"]` or use server `--default_prompt`.
- Resize image tensors to the expected model input shape before call (typically `224`).
- Keep state values in the policy's expected coordinate and ordering conventions.

## Read before integration

- `docs/remote_inference.md`
- `examples/simple_client/README.md`
- `examples/droid/README.md`
- `examples/aloha_real/README.md`
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall