[Bugfix][Frontend] Apply model-default reasoning parser in GPU-less render server (#54835)

Signed-off-by: Shimi Bandiel <shimib@google.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
Shimi Bandiel
2026-10-06 18:46:24 +08:00
committed by GitHub
co-authored by Claude Cyrus Leung
parent 68088ed392
commit 09e0ce3d82
6 changed files with 189 additions and 9 deletions
+20 -7
View File
@@ -2136,6 +2136,25 @@ class EngineArgs:
cfg = json.loads(cfg)
return WatermarkConfig(**cfg)
def create_structured_outputs_config(self) -> StructuredOutputsConfig:
"""Merge frontend parser flags into the structured outputs config.
Mutates `self.structured_outputs_config` in place and returns it
(not a copy). Model-specific defaults (e.g. gpt_oss ->
"openai_gptoss") are applied later by `verify_and_update_config`
only when the resolved value is still empty, so explicit CLI flags
take precedence.
"""
if self.reasoning_parser:
self.structured_outputs_config.reasoning_parser = self.reasoning_parser
if self.reasoning_parser_plugin:
self.structured_outputs_config.reasoning_parser_plugin = (
self.reasoning_parser_plugin
)
return self.structured_outputs_config
def create_observability_config(self) -> ObservabilityConfig:
return ObservabilityConfig(
show_hidden_metrics_for_version=self.show_hidden_metrics_for_version,
@@ -2728,13 +2747,7 @@ class EngineArgs:
load_config = self.create_load_config()
# Pass reasoning_parser into StructuredOutputsConfig
if self.reasoning_parser:
self.structured_outputs_config.reasoning_parser = self.reasoning_parser
if self.reasoning_parser_plugin:
self.structured_outputs_config.reasoning_parser_plugin = (
self.reasoning_parser_plugin
)
self.create_structured_outputs_config()
observability_config = self.create_observability_config()
+12 -2
View File
@@ -50,6 +50,16 @@ async def init_render_app_state(
default_chat_template_kwargs = resolve_default_chat_template_kwargs(args)
state.tool_server = await init_tool_server(args)
# The config-resolved reasoning parser carries both the CLI flag (merged
# in the entrypoint via `create_structured_outputs_config`) and any
# model-specific default applied by `verify_and_update_config`
# (e.g. "openai_gptoss" for gpt_oss), matching the main API server.
# Keep `args.reasoning_parser` as the first source so callers that build
# a VllmConfig without that merge still honor an explicit flag.
reasoning_parser = (
args.reasoning_parser or vllm_config.structured_outputs_config.reasoning_parser
)
state.online_renderer = OnlineRenderer(
model_config=vllm_config.model_config,
renderer=renderer,
@@ -62,7 +72,7 @@ async def init_render_app_state(
exclude_tools_when_tool_choice_none=args.exclude_tools_when_tool_choice_none,
tool_parser=args.tool_call_parser,
tool_strict_level=args.tool_strict_level,
reasoning_parser=args.reasoning_parser,
reasoning_parser=reasoning_parser,
default_chat_template_kwargs=default_chat_template_kwargs,
log_error_stack=args.log_error_stack,
)
@@ -79,7 +89,7 @@ async def init_render_app_state(
exclude_tools_when_tool_choice_none=args.exclude_tools_when_tool_choice_none,
tool_parser=args.tool_call_parser,
tool_strict_level=args.tool_strict_level,
reasoning_parser=args.reasoning_parser,
reasoning_parser=reasoning_parser,
default_chat_template_kwargs=default_chat_template_kwargs,
log_error_stack=args.log_error_stack,
)
@@ -87,9 +87,14 @@ async def run_launch_fastapi(args: argparse.Namespace) -> None:
# cache space warning from CpuPlatform.check_and_update_config.
envs.VLLM_CPU_KVCACHE_SPACE = 0
# Merge frontend parser flags (e.g. --reasoning-parser) into the
# structured outputs config, mirroring `create_engine_config`, which this
# GPU-less entrypoint bypasses. Model-specific defaults are then applied
# by `verify_and_update_config` during VllmConfig construction.
vllm_config = VllmConfig(
model_config=model_config,
logging_config=engine_args.create_logging_config(),
structured_outputs_config=engine_args.create_structured_outputs_config(),
)
shutdown_task = await build_and_serve_renderer(
vllm_config, listen_address, sock, args