Skip to content

[Build] Install vllm-rs as a native command - #57611

Draft
alec-flowers wants to merge 1 commit into
vllm-project:mainfrom
alec-flowers:agent/vllm-rs-package-command
Draft

alec-flowers wants to merge 1 commit into
vllm-project:mainfrom
alec-flowers:agent/vllm-rs-package-command

Conversation

@alec-flowers

@alec-flowers alec-flowers commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Installing a vLLM wheel currently places vllm-rs inside the Python package, so the native command cannot be invoked by name. Package it with RustBin so installers place it in the environment's scripts directory, including /usr/local/bin in the standard container and bin in virtual environments.

Draft alternative to #57606, which adds a symlink only to the CUDA serving image. This changes wheel packaging for all installers so vllm-rs directly executes the native binary. The existing vllm serve Python launcher, including VLLM_USE_RUST_FRONTEND=1 vllm serve, remains supported. The container's default vllm serve entrypoint is unchanged. These are alternative approaches to compare, not changes intended to merge together. Searched open PRs for RustBin, "vllm-rs" "packaging", and "vllm-rs" "console"; no other PR implements this packaging change. #51503 concerns a separate standalone renderer image.

Implementation

  • Declare the frontend as RustBin. Keep build_rust.sh output at vllm/vllm-rs by selecting that scripts build directory, preserving existing Docker staging paths.
  • When native artifacts already exist, copy the frontend into the scripts build directory instead of packaging a second copy inside vllm.
  • Accept both vllm/vllm-rs and *.data/scripts/vllm-rs when extracting precompiled wheels.
  • Preserve source-local binary discovery, then inspect installed distribution records for the command. Skip source egg-info without an executable so native editable installs work from the checkout. No PATH search is needed.

Four files changed; no Dockerfile or documentation changes. AI assistance was used to prepare and review this prototype.

Validation

Passed on Linux x86_64:

.venv/bin/python -m pytest --noconftest tests/test_envs.py -k 'rust or precompiled' -q
.venv/bin/pre-commit run --files setup.py tools/build_rust.py vllm/envs.py tests/test_envs.py
git diff --check

The focused pytest run passed all four cases. The new parameterized regression covers executable discovery with source metadata shadowing the installed distribution, and preference for an in-place source build.

Packaging checks used the actual setup.py with VLLM_TARGET_DEVICE=empty, prebuilt Rust artifacts, and CARGO set to a nonexistent path:

  • Built wheels contain one *.data/scripts/vllm-rs and retain the Rust parser extension.
  • uv pip install --no-deps installs an ELF executable; vllm-rs --help and automatic discovery pass. Uninstall removes the command.
  • uv pip install --no-deps --no-build-isolation -e . with VLLM_PRECOMPILED_WHEEL_LOCATION succeeds using both old and new wheel layouts. Discovery also passes from the checkout after removing the source-local binary.
  • Repeated with actual native artifacts from the pinned release (v0.29.0, image digest sha256:082ca6f035279109041ffd3fe0695cb568b29bc580b35c4f297a66a08b216c1b) and nightly (0.29.1rc1.dev347+gdee37d891, image digest sha256:b88541ab10490f6ee43d2e352edcfcb4b4e0e6b1fdd26ed427c89d73e3fa6a7b).
  • Installed the prototype wheels into derived images from both pinned containers with uv pip install --system --no-deps --no-index. /usr/local/bin/vllm-rs is a native executable, not a symlink. docker run --entrypoint vllm-rs ... --help passed as root and as UID 2000.
  • A minimal dependency-free Cargo fixture reused the actual frontend declaration and standalone build function to verify source-built wheels, the unchanged staging location, and native editable installation. Passed with setuptools-rust 1.9.0 and 1.13.0; precompiled packaging checks also passed with both versions.

Full vLLM Rust/CUDA compilation and model inference were not run. The Cargo fixture checks packaging destinations, not full frontend compilation. Model evaluation is not applicable to this packaging-only change.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Alec Flowers <aflowers@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants