vllm.multimodal.media.base ¶
MediaIO ¶
Configuration values can be user-provided either by --media-io-kwargs or by the runtime API field "media_io_kwargs". Ensure proper validation and error handling.
Source code in vllm/multimodal/media/base.py
load_base64 abstractmethod ¶
List of media types: https://www.iana.org/assignments/media-types/media-types.xhtml
merge_kwargs classmethod ¶
merge_kwargs(
default_kwargs: dict[str, Any] | None,
runtime_kwargs: dict[str, Any] | None,
) -> dict[str, Any]
Merge config-level kwargs and request-level kwargs.
By default this performs a shallow merge where runtime kwargs override keys in default kwargs. Subclasses may override to apply modality- specific behavior.
Source code in vllm/multimodal/media/base.py
MediaWithBytes dataclass ¶
Bases: Generic[_T]
Wrapper that couples a media object with its original encoded bytes.
This ensures the raw bytes and media object remain synchronized, preventing cache corruption from in-place modifications.
The wrapper delegates attribute access to the underlying media object, making it behave transparently like the wrapped type (e.g., PIL.Image).
NOTE: Currently, this wrapper is used only for the image modality.