[Bugfix][Rust Frontend] Inject VLLM_USE_RUST_FRONTEND=1 into vllm-rs managed engine envs (#61586)

Signed-off-by: Isotr0py <Isotr0py@outlook.com>
Co-authored-by: Kimi Code <noreply@moonshot.cn>
Co-authored-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
Isotr0py
2026-10-14 17:09:08 +08:00
committed by GitHub
co-authored by Kimi Code Bugen Zhao
parent be4ce2e505
commit 8a8e2baa02
+35
View File
@@ -54,6 +54,14 @@ impl ManagedEngineConfig {
format!("tcp://{}:{}", self.handshake_host, self.handshake_port)
}
/// Env vars every managed engine needs when serving the Rust frontend:
/// `VLLM_USE_RUST_FRONTEND=1` tells Python vLLM to keep frontend-side
/// multimodal normalization (`mm_device_do_normalize = False`,
/// vllm/config/model.py) instead of expecting raw uint8 pixels.
pub fn rust_frontend_envs() -> Vec<(String, String)> {
vec![("VLLM_USE_RUST_FRONTEND".to_string(), "1".to_string())]
}
/// Build the concrete Python command line for the managed headless engine.
pub fn to_command(&self) -> StdCommand {
let mut command = StdCommand::new(&self.python);
@@ -70,6 +78,7 @@ impl ManagedEngineConfig {
.arg("--data-parallel-size")
.arg(self.data_parallel_size.to_string())
.args(&self.python_args);
command.envs(Self::rust_frontend_envs());
command
}
}
@@ -256,6 +265,32 @@ mod tests {
]
"#]]
.assert_debug_eq(&args);
let envs = command.get_envs().collect::<Vec<_>>();
expect![[r#"
[
(
"VLLM_USE_RUST_FRONTEND",
Some(
"1",
),
),
]
"#]]
.assert_debug_eq(&envs);
}
#[test]
fn rust_frontend_envs_include_rust_frontend_flag() {
expect![[r#"
[
(
"VLLM_USE_RUST_FRONTEND",
"1",
),
]
"#]]
.assert_debug_eq(&ManagedEngineConfig::rust_frontend_envs());
}
#[test]