Skip to content

vllm_omni.clients.inline_duplex

In-process duplex client: the :class:DuplexClient usage over a DuplexOmni.

Example::

from vllm_omni.clients.inline_duplex import InlineDuplexClient
from vllm_omni.clients.minicpmo_4_5 import create_duplex_session_config
from vllm_omni.entrypoints.duplex_omni import DuplexOmni

omni = DuplexOmni(model="openbmb/MiniCPM-o-4_5", trust_remote_code=True)
cfg = create_duplex_session_config(ref_audio=audio_data_url(wav_bytes))
async with InlineDuplexClient(omni, model="openbmb/MiniCPM-o-4_5", config=cfg) as client:
    await client.stream_pcm(pcm16)
    await client.commit()
    async for response in client.responses():
        async for chunk in response.audio():
            play(chunk)
        break

There is no transport to drop, so this client has no reconnect, resume, heartbeat or event-acknowledgement machinery. The DuplexOmni instance is passed in by the caller; this module never imports server runtime code at import time.

InlineDuplexClient

Bases: DuplexClientBase

Async client for one duplex session on an in-process :class:DuplexOmni.

omni instance-attribute

omni = omni