Clone the repository
The first step is to clone the GitHub repository:Python environment setup
vLLM is compatible with Python versions 3.10 to 3.13. However, vLLM’s default Dockerfile ships with Python 3.12 and tests in CI (exceptmypy) are run with Python 3.12.
Configure your Python virtual environment:
Installation options
Python-only development
If you are only developing vLLM’s Python code, install vLLM using:Python and CUDA/C++ development
If you are developing vLLM’s Python and CUDA/C++ code:Install build dependencies
Install the necessary build dependencies, skipping
torch as it was installed in the previous step:If any of the above commands fails with
Python.h: No such file or directory, install python3-dev with sudo apt install python3-dev.Installation for other hardware
For more details about installing from source and installing for other hardware platforms (AMD, Intel, etc.), check out the installation instructions for your hardware and head to the “Build wheel from source” section.Incremental compilation workflow
For an optimized workflow when iterating on C++/CUDA kernels, see the Incremental Compilation Workflow for recommendations.Setting up linting
vLLM usespre-commit to lint and format the codebase.
vLLM’s pre-commit hooks will now run automatically every time you commit.
Manual pre-commit usage
You can manually run thepre-commit hooks using:
CI-only hooks
Somepre-commit hooks only run in CI. If you need to run them locally:
Documentation setup
vLLM uses MkDocs for documentation. To preview documentation locally:Install documentation dependencies
Ensure your Python version is compatible with the plugins (e.g.,
mkdocs-awesome-nav requires Python 3.10+).Preview in browser
Once you see
Serving on http://127.0.0.1:8000/ in the logs, open http://127.0.0.1:8000/ in your browser.Testing setup
vLLM usespytest to test the codebase.
Install test dependencies
Running tests
Verify your setup
To verify your development environment is set up correctly:Next steps
Testing guide
Learn how to write and run tests
Adding models
Implement new model architectures