vllm_omni.engine.duplex.session.history_calibration ¶
Bounded output-audio retention and asynchronous heard-text calibration.
The runner owns this object on its event loop. A model callback receives an immutable snapshot and returns an original-text offset; only the engine session may apply that offset to the authoritative conversation history.
HeardTextSnapshot dataclass ¶
Original reply and confirmed playback cutoff in milliseconds.
Audio is mono float32 PCM from the reply's start. A policy that does not require audio receives empty bytes and a zero sample rate instead. The complete duration is supplied only after the final audio stage finishes; an interrupted generation's partial duration cannot calibrate its full text.
HistoryCalibration ¶
Own per-session output recordings, calibration tasks and writeback fences.
retained_bytes property ¶
retained_bytes: int
Return retained PCM bytes, excluding temporary callback copies.
before_prompt async ¶
Wait within one deadline for eligible work, including replacements.
discard ¶
discard(response_id: str) -> None
Release a reply's recording and revoke any pending calibration.
record ¶
Record projected output without restarting a discarded live reply.
release_confirmed ¶
Free fully acknowledged replies without running ASR on frequent ACKs.
request_ready ¶
Start only ended replies with a partial, client-confirmed playback cursor.
HistoryCalibrationPolicy dataclass ¶
Model callback and its audio-retention requirement.
The callback returns an exclusive original-text character offset (zero means an empty prefix), or None to retain the existing history policy. It must not mutate session history; the framework validates its result.