Skip to content

vllm.renderers.chat_utils.content_parser

Classes:

Attributes:

PROMPT_EMBEDS_PLACEHOLDER_TOKEN = '<prompt_embeds>' module-attribute

The special token used as a placeholder for each embedding position during chat template rendering.

Registered as an additional special token when --enable-prompt-embeds is set. See _ensure_prompt_embeds_placeholder_token in vllm/renderers/hf.py.

AsyncMultiModalContentParser

Bases: BaseMultiModalContentParser

Methods:

  • parse_prompt_embeds –

    Schedule async prompt embeds decode and store the coroutine in the tracker.

parse_prompt_embeds(data)

Schedule async prompt embeds decode and store the coroutine in the tracker.

Like the sync variant, emits a single sentinel PROMPT_EMBEDS_PLACEHOLDER_TOKEN per content part. Unlike the sync variant, the tensor decode is deferred to a thread-pool executor via safe_load_prompt_embeds_async.

MultiModalContentParser

Bases: BaseMultiModalContentParser

Methods:

parse_prompt_embeds(data)

Decode a base64 prompt embeds tensor and store it in the tracker.

Emits a single PROMPT_EMBEDS_PLACEHOLDER_TOKEN sentinel per content part. The renderer later expands each sentinel to a span of tensor.shape[0] placeholder tokens after tokenization.

_loads_audio_from_video(model_config, mm_processor_kwargs)

Whether to add each video's audio track as an audio item, with the request's setting taking precedence over the server's.