[oai serving chat] Add argument --sampling-defaults and fix ChatCompletionRequest defaults (#11304)

This commit is contained in:
Chang Su
2025-10-07 17:36:05 -07:00
committed by GitHub
parent fde9b96392
commit 7ba3de0e92
6 changed files with 198 additions and 126 deletions

View File

@@ -252,6 +252,7 @@ class ServerArgs:
reasoning_parser: Optional[str] = None
tool_call_parser: Optional[str] = None
tool_server: Optional[str] = None
sampling_defaults: str = "model"
# Data parallelism
dp_size: int = 1
@@ -1872,6 +1873,16 @@ class ServerArgs:
default=ServerArgs.tool_call_parser,
help=f"Specify the parser for handling tool-call interactions. Options include: {tool_call_parser_choices}.",
)
parser.add_argument(
"--sampling-defaults",
type=str,
choices=["openai", "model"],
default=ServerArgs.sampling_defaults,
help="Where to get default sampling parameters. "
"'openai' uses SGLang/OpenAI defaults (temperature=1.0, top_p=1.0, etc.). "
"'model' uses the model's generation_config.json to get the recommended "
"sampling parameters if available. Default is 'model'.",
)
parser.add_argument(
"--tool-server",
type=str,