Skip to content

Agent Workflow

Practical setup and process steps for AI agents working on vLLM. The design principles and contribution policy in AGENTS.md take priority over everything here.

Environment Setup

Never use system python3 or bare pip/pip install. All Python commands go through uv and .venv/bin/python.

# Install `uv` if you don't have it already:
curl -LsSf https://astral.sh/uv/install.sh | sh

uv venv --python 3.14
source .venv/bin/activate

# Install `pre-commit` and its hooks:
uv pip install -r requirements/lint.txt
pre-commit install

# Editable install with precompiled artifacts:
VLLM_USE_PRECOMPILED=1 uv pip install -e . --torch-backend=auto

For C/C++ or CUDA changes, follow the incremental compilation workflow.

Tests

# Install test dependencies (use cuda.in on non-x86_64):
uv pip install -r requirements/test/cuda.in

# Run a specific test file:
.venv/bin/python -m pytest tests/path/to/test_file.py -v

Before writing tests, read tests/AGENTS.md. For model-specific requirements, see model tests.

Linting and Style

pre-commit run                          # staged files
pre-commit run --all-files              # all files
pre-commit run ruff-check --all-files   # one hook
  • The Python line length limit is 88 characters.
  • Use Google-style docstrings (Args:/Returns:/Raises:), not Sphinx fields (:param:, :return:).
  • Docstrings render as Markdown: write code in single backticks, not double backticks or Sphinx roles like :class:, and wrap shapes and indexing like [block][2][16] in backticks so mkdocs does not read them as cross-references (the check-docstring-style hook enforces this).
  • Match existing code style and assume the reader is familiar with vLLM.

Commits

Add attribution with commit trailers such as Co-authored-by:, in one block at the end of the message:

Your commit message here

Co-authored-by: Agent Name Here
Signed-off-by: Your Name <your.email@example.com>

Pull Requests

Check for duplicate work first:

gh issue view <issue_number> --repo vllm-project/vllm --comments
gh pr list --repo vllm-project/vllm --state open --search "<issue_number> in:body"
gh pr list --repo vllm-project/vllm --state open --search "<short area keywords>"

PR descriptions for AI-assisted work must include:

  • Why this does not duplicate an existing PR.
  • Test commands run and results (for unit tests, the reproducible pytest command and the exact pytest summary line, including time).
  • Model evaluation results when the change affects output, accuracy, or serving.
  • A clear statement that AI assistance was used.

User-visible changes (features, CLI args, config fields, env vars, models, hardware, defaults, deprecations) must update the rendered docs in the same PR; see Documenting User-Visible Changes.

Before opening a PR (drafts included) or requesting re-review, run the pr-checklist skill and address its findings.