[Rust Frontend] Make --max-model-len optional for the render server (#55328)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Signed-off-by: Wen Zhou <wenzhou@redhat.com>
This commit is contained in:
co-authored by
Claude Opus 5
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
5acd95906b
commit
68dcc4fd86
@@ -139,9 +139,10 @@ pub struct RenderArgs {
|
||||
/// How message content is exposed to the chat template.
|
||||
#[arg(long, default_value_t)]
|
||||
chat_template_content_format: ChatTemplateContentFormatOption,
|
||||
/// Maximum model context length used for request validation.
|
||||
/// Maximum model context length used for request validation. When not set,
|
||||
/// prompt-length validation is skipped and the engine enforces its own limit in later stage.
|
||||
#[arg(long)]
|
||||
max_model_len: u32,
|
||||
max_model_len: Option<u32>,
|
||||
/// Maximum accepted logprobs count; -1 disables the cap.
|
||||
#[arg(long, value_parser = clap::value_parser!(i32).range(-1..), allow_negative_numbers = true)]
|
||||
max_logprobs: Option<i32>,
|
||||
|
||||
@@ -57,7 +57,7 @@ fn render_args_build_config_without_tls() {
|
||||
assert_eq!(config.model, "Qwen/Qwen2.5-0.5B-Instruct");
|
||||
assert_eq!(config.host, "127.0.0.1");
|
||||
assert_eq!(config.port, 8080);
|
||||
assert_eq!(config.max_model_len, 32768);
|
||||
assert_eq!(config.max_model_len, Some(32768));
|
||||
assert_eq!(config.served_model_name, ["qwen"]);
|
||||
assert_eq!(config.tool_call_parser, ParserSelection::Auto);
|
||||
assert_eq!(config.reasoning_parser, ParserSelection::Auto);
|
||||
@@ -66,6 +66,18 @@ fn render_args_build_config_without_tls() {
|
||||
assert!(config.tls.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn render_args_allow_omitted_max_model_len() {
|
||||
let cli = Cli::try_parse_from(["vllm-rs", "render", "Qwen/Qwen2.5-0.5B-Instruct"]).unwrap();
|
||||
|
||||
let Command::Render(args) = cli.command else {
|
||||
panic!("expected render args");
|
||||
};
|
||||
let config = args.into_config();
|
||||
|
||||
assert_eq!(config.max_model_len, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn render_args_build_config_with_tls() {
|
||||
let cli = Cli::try_parse_from([
|
||||
|
||||
Reference in New Issue
Block a user