Skip to content

vllm_omni.model_executor.common.duplex.payload

Validation of one duplex audio append payload.

The runner hands a plugin the append as a mapping {format, sample_rate_hz, audio} (audio base64 pcm_f32le). Models with a fixed input rate and frame size validate it here; the PCM itself is decoded by vllm_omni.model_executor.common.audio.pcm.

decode_pcm_f32le_payload

decode_pcm_f32le_payload(
    payload: object,
    *,
    sample_rate_hz: int,
    exact_samples: int | None = None,
    model: str = "duplex",
) -> bytes

Raw PCM of one append that must be pcm_f32le at sample_rate_hz.

exact_samples pins the unit length (a lockstep model takes exactly one frame per append); None accepts any whole number of samples.

payload_audio

payload_audio(payload: object) -> object | None

The encoded audio field of an append payload (audio, or the older data).

payload_sample_count

payload_sample_count(payload: object) -> int | None

Sample count of a pcm_f32le append, or None when it is not one (lenient, for budgeting).