vllm.entrypoints.pooling.embed.protocol
¶
Embedding API protocol models for OpenAI and Cohere formats.
OpenAI: https://platform.openai.com/docs/api-reference/embeddings Cohere: https://docs.cohere.com/reference/embed
Classes:
-
EmbeddingBatchChatInputRequest–OpenAI embeddings request with batched chat conversations in
input. -
EmbeddingBatchChatRequest–OpenAI embeddings request with batched top-level chat conversations.
-
EmbeddingChatInputRequest–OpenAI embeddings request with one chat conversation in
input. -
EmbeddingChatRequest–OpenAI embeddings request with one top-level chat conversation.
Functions:
-
build_typed_embeddings–Encode a batch of pooling outputs in the requested Cohere formats.
EmbeddingBatchChatInputRequest
¶
Bases: EmbeddingBatchChatRequest
OpenAI embeddings request with batched chat conversations in input.
EmbeddingBatchChatRequest
¶
Bases: PoolingBasicRequestMixin, ChatRequestOptionsMixin, EmbedRequestMixin, EmbeddingTokenizeParamsMixin
OpenAI embeddings request with batched top-level chat conversations.
Mirrors BatchChatCompletionRequest by keeping batched conversations in
messages instead of introducing a separate batch-specific field.
EmbeddingChatInputRequest
¶
EmbeddingChatRequest
¶
Bases: PoolingBasicRequestMixin, ChatRequestMixin, EmbedRequestMixin, EmbeddingTokenizeParamsMixin
OpenAI embeddings request with one top-level chat conversation.
_pack_binary_embeddings(float_embeddings, signed)
¶
Bit-pack float embeddings: positive -> 1, negative -> 0.
Bits are packed MSB-first, eight per byte.
build_typed_embeddings(outputs, embedding_types)
¶
Encode a batch of pooling outputs in the requested Cohere formats.