Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

[Docs] Enforce Black Formatting in Contributor Docs (#25135)

yuneng-jiangd2d99aa082f9
diff --git a/AGENTS.md b/AGENTS.md
index ba9c9b356bc..37411938e2f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -254,7 +254,7 @@ See `CLAUDE.md` and the `Makefile` for standard commands. Key notes:
- `openapi-core` must be installed (`poetry run pip install openapi-core`) for the OpenAPI compliance tests in `tests/test_litellm/interactions/`.
- The `--timeout` pytest flag is NOT available; don't pass it.
- Unit tests: `poetry run pytest tests/test_litellm/ -x -vv -n 4`
-- Black `--check` may report pre-existing formatting issues; this does not block test runs.
+- **Before committing, always run `poetry run black .` to format your code.** Black formatting is enforced in CI.
- If `poetry install` fails with "pyproject.toml changed significantly since poetry.lock was last generated", run `poetry lock` first to regenerate the lock file.
### Lint
diff --git a/CLAUDE.md b/CLAUDE.md
index f0478120181..a8800ff8884 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -20,6 +20,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- `make format` - Apply Black code formatting
- `make lint-ruff` - Run Ruff linting only
- `make lint-mypy` - Run MyPy type checking only
+- **Before committing, always run `poetry run black .` to format your code.** Black formatting is enforced in CI.
### Single Test Files
- `poetry run pytest tests/path/to/test_file.py -v` - Run specific test file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 77bc15ff50b..c029ccce1ab 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -149,6 +149,19 @@ Apply formatting (auto-fixes issues):
make format
```
+> **Black formatting is enforced in CI.** All PRs must pass the Black formatting check.
+>
+> - **AI coding agents** (Claude Code, Copilot, Cursor, etc.): `AGENTS.md` and `CLAUDE.md` instruct agents to run `poetry run black .` before committing.
+> - **VS Code users**: Install the [Black Formatter extension](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) and enable format-on-save:
+> ```json
+> {
+> "[python]": {
+> "editor.defaultFormatter": "ms-python.black-formatter",
+> "editor.formatOnSave": true
+> }
+> }
+> ```
+
### CI Compatibility
To ensure your changes will pass CI, run the exact same checks locally: