Skip to content

vllm_omni.model_executor.models.personaplex.duplex.policy

PersonaPlex frame/token contract (the model policy, no engine state).

This mirrors the minicpmo45 model-package layout from PR #3907: the token contract lives in policy.py, the model-owned runtime in runtime.py. Everything here is a constant or a pure function of the checkpoint's lockstep conventions; nothing touches weights, devices, or streaming state.

Frame layout per 80 ms tick: 17 token rows -- row 0 inner-monologue text, rows 1-8 agent audio codebooks, rows 9-16 user audio codebooks.

AUDIO_INITIAL_TOKEN module-attribute

AUDIO_INITIAL_TOKEN = 2048

AUDIO_SILENCE_FRAME_CNT module-attribute

AUDIO_SILENCE_FRAME_CNT = 6

NON_TEXT_TOKEN_IDS module-attribute

NON_TEXT_TOKEN_IDS = frozenset({0, 3})

SILENCE_TOKENS module-attribute

SILENCE_TOKENS = (
    948,
    243,
    1178,
    546,
    1736,
    1030,
    1978,
    2008,
)

SINE_TOKENS module-attribute

SINE_TOKENS = (430, 1268, 381, 1611, 1095, 1495, 56, 472)

TEXT_INITIAL_TOKEN module-attribute

TEXT_INITIAL_TOKEN = 32000

TEXT_VOCAB_SIZE module-attribute

TEXT_VOCAB_SIZE = 32000

ZERO_TEXT_TOKEN module-attribute

ZERO_TEXT_TOKEN = 3

PrefillStep dataclass

One tick of a recycled slot's system-prompt replay (see batched serving).

embedding class-attribute instance-attribute

embedding: Any = None

kind instance-attribute

kind: str

moshi_tokens class-attribute instance-attribute

moshi_tokens: Any = None

text_token class-attribute instance-attribute

text_token: int | None = None

user_sine class-attribute instance-attribute

user_sine: bool = False

wrap_with_system_tags

wrap_with_system_tags(text: str) -> str