A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Frontend] Skip unnecessary detokenization when token_id is requested (#24236)
Signed-off-by: NickLucche <nlucches@redhat.com>
Nicolò Lucchesi committed
Sep 5, 2025 at 01:04 UTC
65e038931d8599dd9ab80ca5b53d5573d5b74fd7
1 file changed
+2
-1
vllm/entrypoints/openai/serving_chat.py
+2
-1
@@ -1419,9 +1419,10 @@ class OpenAIServingChat(OpenAIServing):
1419
step_top_logprobs = top_logprobs[i]
1420
if step_top_logprobs is None or step_top_logprobs.get(
1421
token_id) is None:
1422
- token = tokenizer.decode(token_id)
1422
if should_return_as_token_id:
1423
token = f"token_id:{token_id}"
1424
+ else:
1425
+ token = tokenizer.decode(token_id)
1426
1427
logprobs_content.append(
1428
ChatCompletionLogProbsContent(