# folding-final-handler Custom HuggingFace Inference Endpoint handler that serves the [`lerobot-data-collection/folding_final`](https://huggingface.co/lerobot-data-collection/folding_final) π₀.₅ policy for bimanual OpenArm cloth-folding. Weights are *not* duplicated into this repo — `handler.py` pulls them from the upstream repo at container cold-start via `huggingface_hub.snapshot_download`. ## Wire format POST JSON to the endpoint URL with header `Authorization: Bearer hf_…`: ```json { "inputs": { "images": { "left_wrist": "", "right_wrist": "", "base": "" }, "state": [16 floats], "prompt": "fold the towel" } } ``` Response: ```json { "actions": [[16 floats] × 30], "chunk_len": 30, "action_dim": 16, "action_feature_names": ["right_joint_1.pos", ..., "left_gripper.pos"] } ``` State + action layout matches `folding_final.config.action_feature_names`: right joints 1–7, right gripper, left joints 1–7, left gripper. ## Why this repo exists To keep the deployed endpoint code under our control without duplicating ~8 GB of safetensors. handler.py is the only thing that ever changes.