Skip to content

vllm_omni.diffusion.models.pi05.config

Config surface for the π0.5 VLA model in vllm-omni.

Deliberately shaped exactly like pi0/config.py: a small dataclass that consumes the raw LeRobot config.json (the field surface of lerobot.policies.pi05.PI05Config) and keeps only the runtime-relevant fields. Transformer dimensions are derived from paligemma_variant / action_expert_variant inside the model via get_gemma_config.

What π0.5 adds on top of the π0 config surface:

  • tokenizer_max_length = 200 (π0 uses 48).
  • state_num_bins — state is discretized into language tokens instead of going through a state_proj layer.
  • use_relative_actions / relative_exclude_joints / action_feature_names — the relative-action contract. See processor_pi05.Pi05RelativeActions.
  • Quantile normalization stats. LeRobot's π0.5 defaults STATE and ACTION to NormalizationMode.QUANTILES where π0 uses MEAN_STD.

Checkpoint boundary rule. A capability that the checkpoint declares but this implementation does not consume must raise, not be silently dropped. π0.5 checkpoints can declare MEM (short-horizon observation memory) and RTC (real-time chunking); neither is supported here, and serving such a checkpoint anyway would produce plausible-looking wrong actions. See _reject_unsupported_capabilities.

ACTION module-attribute

ACTION = 'action'

OBS_IMAGES module-attribute

OBS_IMAGES = OBS_STR + '.images'

OBS_STATE module-attribute

OBS_STATE = OBS_STR + '.state'

OBS_STR module-attribute

OBS_STR = 'observation'

SUPPORTED_DTYPE_NAMES module-attribute

SUPPORTED_DTYPE_NAMES = frozenset({'float32', 'bfloat16'})

logger module-attribute

logger = logging.getLogger(__name__)

Pi05Config dataclass

π0.5 VLA config (dataclass, not an HF PretrainedConfig).

action_dim class-attribute instance-attribute

action_dim: int = field(init=False)

action_expert_variant class-attribute instance-attribute

action_expert_variant: str = 'gemma_300m'

action_feature_names class-attribute instance-attribute

action_feature_names: list[str] | None = None

chunk_size class-attribute instance-attribute

chunk_size: int = 50

dtype class-attribute instance-attribute

dtype: str = 'float32'

image_feature_keys class-attribute instance-attribute

image_feature_keys: list[str] | None = None

image_key_map class-attribute instance-attribute

image_key_map: dict[str, str] = field(default_factory=dict)

image_resolution class-attribute instance-attribute

image_resolution: tuple[int, int] = (224, 224)

input_features class-attribute instance-attribute

input_features: dict[str, Any] = field(default_factory=dict)

max_action_dim class-attribute instance-attribute

max_action_dim: int = 32

max_cameras class-attribute instance-attribute

max_cameras: int = 3

max_period class-attribute instance-attribute

max_period: float = 4.0

max_state_dim class-attribute instance-attribute

max_state_dim: int = 32

min_period class-attribute instance-attribute

min_period: float = 0.004

n_action_steps class-attribute instance-attribute

n_action_steps: int = 50

norm_stats class-attribute instance-attribute

norm_stats: dict | None = None

num_inference_steps class-attribute instance-attribute

num_inference_steps: int = 10

output_features class-attribute instance-attribute

output_features: dict[str, Any] = field(
    default_factory=dict
)

paligemma_variant class-attribute instance-attribute

paligemma_variant: str = 'gemma_2b'

policy_server_config class-attribute instance-attribute

policy_server_config: dict[str, Any] = field(
    default_factory=dict
)

relative_exclude_joints class-attribute instance-attribute

relative_exclude_joints: list[str] = field(
    default_factory=lambda: ["gripper"]
)

state_dim class-attribute instance-attribute

state_dim: int = field(init=False)

state_num_bins class-attribute instance-attribute

state_num_bins: int = 256

tokenizer_max_length class-attribute instance-attribute

tokenizer_max_length: int = 200

use_relative_actions class-attribute instance-attribute

use_relative_actions: bool = False

from_model_config classmethod

from_model_config(
    model_config: dict[str, Any] | None,
) -> Pi05Config

Build from a config dict (LeRobot config.json or deploy yaml).

from_pretrained classmethod

from_pretrained(checkpoint_dir: str | Path) -> Pi05Config

Build from a checkpoint directory's config.json.

Normalization stats are not in config.json. LeRobot keeps them in the processor sidecar, so they are loaded separately and backfilled here — see :func:load_lerobot_norm_stats.

UnsupportedCheckpointCapabilityError

Bases: ValueError

A checkpoint declares a capability this implementation does not consume.

Raised at load time rather than silently ignored: every one of these capabilities changes what a correct action chunk looks like, and none of them is visible in the weights alone.

load_lerobot_norm_stats

load_lerobot_norm_stats(
    checkpoint_dir: str | Path,
) -> dict[str, dict[str, Any]] | None

Load normalization stats from a LeRobot checkpoint's processor sidecar.

Returns a norm_stats-shaped dict ({"state": {...}, "action": {...}}) carrying an explicit mode, or None when the checkpoint ships no stats. lerobot/pi05_base is the latter case: its normalizer step has no state_file, i.e. normalization is identity and the client is expected to send an already-normalized state.

Raises on a mode we cannot reproduce rather than serving the checkpoint with the wrong transform, which fails silently — a wrongly normalized state still yields a plausible-looking action chunk.

resolve_excluded_action_indices

resolve_excluded_action_indices(
    exclude_joints: list[str] | None,
    action_names: list[str] | None,
) -> list[int]

Map relative_exclude_joints names onto action-vector indices.

Matching is exact name first, then substring (a checkpoint may name the gripper dimension gripper_position while the config just says gripper). Single source of truth for both the config-time validation and the runtime mask in processor_pi05.Pi05RelativeActions.

Returns an empty list when there is nothing to exclude. Raises when a name cannot be resolved — an unresolvable exclusion would otherwise silently become "make this dimension relative too".