[Bugfix][Frontend] Support scalar priority and wire priority into LLM.chat() (#57243)

Signed-off-by: subhash polisetti <subhashr161347@gmail.com>
This commit is contained in:
Subhash Polisetti
2026-10-11 10:03:33 +00:00
committed by GitHub
parent 2339bd39d6
commit f425a21208
5 changed files with 65 additions and 12 deletions
+8
View File
@@ -75,6 +75,10 @@ def test_multiple_priority(llm: LLM):
outputs = llm.generate(PROMPTS, sampling_params=None, priority=[0] * len(PROMPTS))
assert len(PROMPTS) == len(outputs)
# Generate works when priority is a single value applied to every prompt
outputs = llm.generate(PROMPTS, sampling_params=None, priority=1)
assert len(PROMPTS) == len(outputs)
# Exception raised, if the length of priority does not match the length of prompts
with pytest.raises(VLLMValidationError):
outputs = llm.generate(
@@ -91,6 +95,10 @@ def test_single_prompt_priority(llm: LLM):
outputs = llm.generate(PROMPTS[0], sampling_params=None, priority=[0])
assert len(outputs) == 1
# Single string prompts should also accept a single priority value.
outputs = llm.generate(PROMPTS[0], sampling_params=None, priority=1)
assert len(outputs) == 1
def test_max_model_len(vllm_runner):
max_model_len = 20