@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0e95916155
Fork 0

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 6, 13:15 UTC

[responsesAPI] parser.extract_response_outputs can take in token IDs (#37130)

Signed-off-by: Andrew Xia <axia@meta.com>

Andrew Xia committed Mar 17, 2026 at 22:31 UTC 0e95916155a89195e97b8fae8d880c0aa0afc34e
2 files changed +6
vllm/entrypoints/openai/responses/serving.py
+1
@@ -1012,6 +1012,7 @@ class OpenAIServingResponses(OpenAIServing):
1012 parser = self.parser(tokenizer)
1013 return parser.extract_response_outputs(
1014 model_output=final_output.text,
1015 + model_output_token_ids=final_output.token_ids,
1016 request=request,
1017 enable_auto_tools=self.enable_auto_tools,
1018 tool_call_id_type=self.tool_call_id_type,
vllm/parser/abstract_parser.py
+5
@@ -155,7 +155,9 @@ class Parser:
155 @abstractmethod
156 def extract_response_outputs(
157 self,
158 + *,
159 model_output: str,
160 + model_output_token_ids: Sequence[int],
161 request: ResponsesRequest,
162 enable_auto_tools: bool = False,
163 tool_call_id_type: str = "random",
@@ -170,6 +172,7 @@ class Parser:
172
173 Args:
174 model_output: The complete model-generated string.
175 + model_output_token_ids: The token IDs of the model output.
176 request: The request object used to generate the output.
177 enable_auto_tools: Whether to enable automatic tool call parsing.
178 tool_call_id_type: Type of tool call ID generation ("random", etc).
@@ -313,7 +316,9 @@ class DelegatingParser(Parser):
316
317 def extract_response_outputs(
318 self,
319 + *,
320 model_output: str,
321 + model_output_token_ids: Sequence[int],
322 request: ResponsesRequest,
323 enable_auto_tools: bool = False,
324 tool_call_id_type: str = "random",