add support to enable lora with embedding models (#17780)

Co-authored-by: Vedant Jhaveri <vjhaveri@linkedin.com>
This commit is contained in:
Vedant V Jhaveri
2026-02-11 07:19:40 -08:00
committed by GitHub
parent 947927bdb5
commit 98b5013d59
7 changed files with 260 additions and 0 deletions

View File

@@ -126,12 +126,24 @@ class OpenAIServingEmbedding(OpenAIServingBase):
# Other types (should not happen but handle gracefully)
prompt_kwargs = {"input_ids": prompt}
# Resolve LoRA adapter from model parameter or explicit lora_path
lora_path = self._resolve_lora_path(request.model, request.lora_path)
if lora_path:
first_adapter = (
lora_path
if isinstance(lora_path, str)
else next((a for a in lora_path if a), None)
)
if first_adapter:
self._validate_lora_enabled(first_adapter)
adapted_request = EmbeddingReqInput(
**prompt_kwargs,
rid=request.rid,
priority=request.priority,
routing_key=self.extract_routing_key(raw_request),
dimensions=request.dimensions,
lora_path=lora_path,
)
return adapted_request, request