File size: 1,378 Bytes
bdca518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Real-Time Chunking (RTC) for action-chunking flow policies.

    Black, Galliker, Levine. "Real-Time Execution of Action Chunking Flow
    Policies." NeurIPS 2025. arXiv:2506.07339.

This package is the *backend-agnostic* RTC core plus an adapter for openpi's
PyTorch pi0.5. You bring your own pi0.5 base checkpoint (loaded through openpi);
RTC only replaces the inference path so consecutive action chunks stay
consistent while executing in real time.

Layout
------
    masking      soft prefix masks + the PiGDM guidance weight (backend-agnostic)
    controller   Algorithm 1: async execution / background inference thread
    sampler      guided-inpainting denoising loop, PyTorch (torch.autograd.grad)
    pi0          adapter: openpi ``PI0Pytorch`` pi0.5  (torch + openpi imported lazily)

Importing this package pulls in neither torch nor openpi: the adapter and
sampler are imported lazily, so ``from rtc import RealTimeChunkingController``
works in a plain-numpy process.

See ``examples/pi05_realtime.py`` for an end-to-end, no-robot demo.
"""

__all__ = [
    "PrefixAttentionSchedule",
    "RealTimeChunkingController",
    "execution_horizon_for",
    "get_prefix_weights_np",
    "guidance_weight",
]

from .controller import RealTimeChunkingController, execution_horizon_for
from .masking import PrefixAttentionSchedule, get_prefix_weights_np, guidance_weight