Skip to content

vllm_omni.engine.duplex.session.control

Control of one duplex session: server VAD, and the events that reconfigure it.

Server turn detection and session.update are the same concern seen from two sides. The detector is per-session mutable state, and session.update is the event that replaces it mid-flight -- along with the session config, the runtime config and the sampling policy, each of which has to be validated against a candidate before the live session adopts it. The rest of turn.signal (conversation items, local turn markers) travels the same path and is small, so it lives here rather than in a module of its own.

The one thing this does not own is ordering against the data plane: a session.update must not overtake an append still in flight, so the runner supplies wait_for_append_tail.

logger module-attribute

logger = init_logger(__name__)

SessionControl

Server VAD and the control events that reconfigure one session.

init_turn_detection

init_turn_detection() -> None

on_session_update async

on_session_update(
    payload: dict[str, object],
    *,
    realtime_event_id: str | None,
) -> None

on_turn_signal async

on_turn_signal(event: dict[str, object]) -> None

reset_vad

reset_vad() -> None

Drop the detector's speech state (a barge-in or a clear starts a new turn).

run_turn_detection async

run_turn_detection(
    event: dict[str, object],
) -> TurnDetectionResult | None