[model-gateway]: add gRPC router embeddings endpoint implementation (#15273)

This commit is contained in:
ratish
2025-12-23 09:12:22 -08:00
committed by GitHub
parent 80ae2229d3
commit 5f3a47d8a7
30 changed files with 1097 additions and 35 deletions
+8 -3
View File
@@ -1710,9 +1710,14 @@ class Scheduler(
if recv_req.image_inputs is not None:
image_inputs = self._get_multimodal_inputs(recv_req.image_inputs)
# Expand a single image token into multiple dummy tokens for receiving image embeddings
req.origin_input_ids = self.pad_input_ids_func(
req.origin_input_ids, image_inputs
)
# The `pad_input_ids_func` is model-specific and may be None for
# embedding models or models not requiring special padding.
# If None, `req.origin_input_ids` is expected to be correctly populated already.
if self.pad_input_ids_func:
req.origin_input_ids = self.pad_input_ids_func(
req.origin_input_ids, image_inputs
)
req.extend_image_inputs(image_inputs)
if len(req.origin_input_ids) >= self.max_req_input_len: