[Model] Engine based plamo3 parser (#56575)

Signed-off-by: Shinichi Hemmi <shemmi@preferred.jp>
This commit is contained in:
Shinichi Hemmi
2026-09-29 05:17:42 +00:00
committed by GitHub
parent 36768d1bfd
commit 17cc3cd80e
14 changed files with 1311 additions and 5 deletions
+10 -1
View File
@@ -38,6 +38,7 @@ from vllm.entrypoints.openai.chat_completion.protocol import (
from vllm.entrypoints.openai.responses.protocol import ResponsesRequest
from vllm.exceptions import VLLMValidationError
from vllm.logger import init_logger
from vllm.parser.engine.adapters import ParserEngineToolAdapter
from vllm.parser.metrics import record_tool_parser_invocation
from vllm.parser.utils import count_history_tool_calls
from vllm.reasoning.abs_reasoning_parsers import ReasoningParser
@@ -128,7 +129,15 @@ class Parser:
tokenizer, *args, model_config=model_config, **kwargs
)
if self.__class__.tool_parser_cls is not None:
self._tool_parser = self.__class__.tool_parser_cls(tokenizer, tools)
# Engine-based adapters take the same construction kwargs as
# the reasoning parser (e.g. chat_template_kwargs for per-request
# thinking toggles); legacy ToolParser classes take none.
if issubclass(self.__class__.tool_parser_cls, ParserEngineToolAdapter):
self._tool_parser = self.__class__.tool_parser_cls(
tokenizer, tools, model_config=model_config, **kwargs
)
else:
self._tool_parser = self.__class__.tool_parser_cls(tokenizer, tools)
self._engine_based = (
self._reasoning_parser is None