Skip to content

Commit 4fbd8bb

Browse files
authored
Fix passing SpeculativeConfig from the CLI (#22652)
Signed-off-by: Harry Mellor <[email protected]>
1 parent ad344ef commit 4fbd8bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vllm/engine/arg_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,10 @@ def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
826826
title="VllmConfig",
827827
description=VllmConfig.__doc__,
828828
)
829+
# We construct SpeculativeConfig using fields from other configs in
830+
# create_engine_config. So we set the type to a JSON string here to
831+
# delay the Pydantic validation that comes with SpeculativeConfig.
832+
vllm_kwargs["speculative_config"]["type"] = optional_type(json.loads)
829833
vllm_group.add_argument("--speculative-config",
830834
**vllm_kwargs["speculative_config"])
831835
vllm_group.add_argument("--kv-transfer-config",

0 commit comments

Comments
 (0)