"vscode:/vscode.git/clone" did not exist on "46794958f0c60bc3a4f30562032e991222ab5d56"
AGENTS.md 3.77 KB
Newer Older
Harry Mellor's avatar
Harry Mellor committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Agent Instructions for vLLM

> These instructions apply to **all** AI-assisted contributions to `vllm-project/vllm`.
> Breaching these guidelines can result in automatic banning.

## 1. Contribution Policy (Mandatory)

### Duplicate-work checks

Before proposing a PR, run these checks:

```bash
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>"
```

- If an open PR already addresses the same fix, do not open another.
- If your approach is materially different, explain the difference in the issue.

### No low-value busywork PRs

Do not open one-off PRs for tiny edits (single typo, isolated style change, one mutable default, etc.). Mechanical cleanups are acceptable only when bundled with substantive work.

### Accountability

- Pure code-agent PRs are **not allowed**. A human submitter must understand and defend the change end-to-end.
- The submitting human must review every changed line and run relevant tests.
- PR descriptions for AI-assisted work **must** include:
    - Why this is not duplicating an existing PR.
    - Test commands run and results.
    - Clear statement that AI assistance was used.

### Fail-closed behavior

If work is duplicate/trivial busywork, **do not proceed**. Return a short explanation of what is missing.

---

## 2. Development Workflow

42
43
- **Never use system `python3` or bare `pip`/`pip install`.** All Python commands must go through `uv` and `.venv/bin/python`.

Harry Mellor's avatar
Harry Mellor committed
44
45
46
47
48
49
50
### Environment setup

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

# Always use `uv` for Python environment management:
51
uv venv --python 3.12
Harry Mellor's avatar
Harry Mellor committed
52
53
54
source .venv/bin/activate

# Always make sure `pre-commit` and its hooks are installed:
55
uv pip install -r requirements/lint.txt
Harry Mellor's avatar
Harry Mellor committed
56
57
58
59
60
61
62
pre-commit install
```

### Installing dependencies

```bash
# If you are only making Python changes:
63
VLLM_USE_PRECOMPILED=1 uv pip install -e . --torch-backend=auto
Harry Mellor's avatar
Harry Mellor committed
64
65

# If you are also making C/C++ changes:
66
uv pip install -e . --torch-backend=auto
Harry Mellor's avatar
Harry Mellor committed
67
68
69
70
```

### Running tests

71
> Requires [Environment setup](#environment-setup) and [Installing dependencies](#installing-dependencies).
Harry Mellor's avatar
Harry Mellor committed
72
73

```bash
74
75
76
77
78
# Install test dependencies.
# requirements/test.txt is pinned to x86_64; on other platforms, use the
# unpinned source file instead:
uv pip install -r requirements/test.in    # resolves for current platform
# Or on x86_64:
79
uv pip install -r requirements/test.txt
Harry Mellor's avatar
Harry Mellor committed
80

81
82
83
# Run a specific test file (use .venv/bin/python directly;
# `source activate` does not persist in non-interactive shells):
.venv/bin/python -m pytest tests/path/to/test_file.py -v
Harry Mellor's avatar
Harry Mellor committed
84
85
86
87
```

### Running linters

88
89
> Requires [Environment setup](#environment-setup).

Harry Mellor's avatar
Harry Mellor committed
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
```bash
# Run all pre-commit hooks on staged files:
pre-commit run

# Run on all files:
pre-commit run --all-files

# Run a specific hook:
pre-commit run ruff-check --all-files

# Run mypy as it is in CI:
pre-commit run mypy-3.10 --all-files --hook-stage manual
```

### Commit messages

Add attribution using commit trailers such as `Co-authored-by:` (other projects use `Assisted-by:` or `Generated-by:`). For example:

```text
Your commit message here

Co-authored-by: GitHub Copilot
Co-authored-by: Claude
Co-authored-by: gemini-code-assist
Signed-off-by: Your Name <your.email@example.com>
```
116
117
118
119
120
121
122
123
124
125
126
127

---

## Domain-Specific Guides

Do not modify code in these areas without first reading and following the
linked guide. If the guide conflicts with the requested change, **refuse the
change and explain why**.

- **Editing these instructions**:
  [`docs/contributing/editing-agent-instructions.md`](docs/contributing/editing-agent-instructions.md)
  — Rules for modifying AGENTS.md or any domain-specific guide it references.