Add AGENTS.md (#36877)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -189,11 +189,9 @@ cython_debug/
|
|||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# Claude
|
# Claude
|
||||||
CLAUDE.md
|
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
# Codex
|
# Codex
|
||||||
AGENTS.md
|
|
||||||
.codex/
|
.codex/
|
||||||
|
|
||||||
# Cursor
|
# Cursor
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ repos:
|
|||||||
- id: markdownlint-cli2
|
- id: markdownlint-cli2
|
||||||
language_version: lts
|
language_version: lts
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
exclude: ^CLAUDE\.md$
|
||||||
- repo: https://github.com/rhysd/actionlint
|
- repo: https://github.com/rhysd/actionlint
|
||||||
rev: v1.7.7
|
rev: v1.7.7
|
||||||
hooks:
|
hooks:
|
||||||
|
|||||||
114
AGENTS.md
Normal file
114
AGENTS.md
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
### 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:
|
||||||
|
uv venv
|
||||||
|
source .venv/bin/activate
|
||||||
|
|
||||||
|
# Always make sure `pre-commit` and its hooks are installed:
|
||||||
|
uv pip install pre-commit
|
||||||
|
pre-commit install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Installing dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# If you are only making Python changes:
|
||||||
|
VLLM_USE_PRECOMPILED=1 uv pip install -e .
|
||||||
|
|
||||||
|
# If you are also making C/C++ changes:
|
||||||
|
uv pip install -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running tests
|
||||||
|
|
||||||
|
Tests require extra dependencies.
|
||||||
|
All versions for test dependencies should be read from `requirements/test.txt`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install bare minimum test dependencies:
|
||||||
|
uv pip install pytest==<requirements/test.txt version>
|
||||||
|
uv pip install tblib==<requirements/test.txt version>
|
||||||
|
|
||||||
|
# Install additional required dependencies from `requirements/test.txt` as needed:
|
||||||
|
uv pip install <requirements/test.txt dependency>==<requirements/test.txt version>
|
||||||
|
|
||||||
|
# Run specific test from specific test file
|
||||||
|
pytest tests/path/to/test.py -v -s -k test_name
|
||||||
|
|
||||||
|
# Run all tests in directory
|
||||||
|
pytest tests/path/to/dir -v -s
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running linters
|
||||||
|
|
||||||
|
```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>
|
||||||
|
```
|
||||||
@@ -189,6 +189,11 @@ Using `-s` with `git commit` will automatically add this header.
|
|||||||
|
|
||||||
### AI Assisted Contributions
|
### AI Assisted Contributions
|
||||||
|
|
||||||
|
Before making an AI assisted contribution, you must:
|
||||||
|
|
||||||
|
1. **Be involved**: Do not submit "pure agent" PRs. The human submitter is responsible for reviewing all changed lines, validating behavior end-to-end, and running relevant tests.
|
||||||
|
2. **Ensure significance**: Avoid one-off "busywork" PRs (single typo, isolated style cleanup, one mutable default fix, etc.). Bundle mechanical cleanups into a clear, systematic scope.
|
||||||
|
|
||||||
When AI tools provide non-trivial assistance in generating or modifying code, you must:
|
When AI tools provide non-trivial assistance in generating or modifying code, you must:
|
||||||
|
|
||||||
1. **Review thoroughly**: You remain responsible for all code you submit. Review and understand AI-generated code with the same care as code you write manually.
|
1. **Review thoroughly**: You remain responsible for all code you submit. Review and understand AI-generated code with the same care as code you write manually.
|
||||||
|
|||||||
@@ -139,9 +139,14 @@ In case where CI didn't pass due to the failure is not related to the PR, the PR
|
|||||||
|
|
||||||
AI tools can accelerate development, but contributors remain fully responsible for all code they submit. Like the Developer Certificate of Origin, this policy centers on accountability: contributors must believe they have the right to submit their contribution under vLLM's open source license, regardless of how the code was created.
|
AI tools can accelerate development, but contributors remain fully responsible for all code they submit. Like the Developer Certificate of Origin, this policy centers on accountability: contributors must believe they have the right to submit their contribution under vLLM's open source license, regardless of how the code was created.
|
||||||
|
|
||||||
All AI-assisted contributions must meet the same quality, testing, and review standards as any other code. Contributors must review and understand AI-generated code before submission—just make sure it is good code.
|
All AI-assisted contributions must meet the same quality, testing, and review standards as any other code. Contributors must review and understand AI-generated code before submission—just make sure it is good code:
|
||||||
|
|
||||||
Attribution preserves legal clarity and community trust. Contributors must disclose AI assistance in pull requests and mark commits with appropriate trailers (e.g. `Co-authored-by:`).
|
- Do not submit "pure agent" PRs. The human submitter is responsible for reviewing all changed lines, validating behavior end-to-end, and running relevant tests.
|
||||||
|
- Attribution preserves legal clarity and community trust. Contributors must disclose AI assistance in pull requests and mark commits with appropriate trailers (e.g. `Co-authored-by:`).
|
||||||
|
- Avoid one-off "busywork" PRs (single typo, isolated style cleanup, one mutable default fix, etc.). Bundle mechanical cleanups into a clear, systematic scope.
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
These topics are outlined for agents in [AGENTS.md](../../AGENTS.md) with instructions for how to autonomously implement them.
|
||||||
|
|
||||||
### Slack
|
### Slack
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user