agentleFS
vllm-projectvllm-project/vllm/.agents/skills/add-cli-arg/SKILL.md

add-cli-arg

Skill98k starsChanged 7 days agoApache-2.0View on GitHub

Recipe for adding or changing a `vllm serve` / `vllm` CLI argument. Use when adding a flag to `EngineArgs` in `vllm/engine/arg_utils.py` or to the frontend args classes (`FrontendArgs`, `BaseFrontendArgs`, `BatchFrontendArgs`), exposing a config field on the command line, or changing an existing arg's type, default, or help text.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projectsWeek of Nov 22: 0 new projects
Oct 2026Nov 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about vllm-project/vllm

The biggest 5 of 104 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 104

Talked about on GitHub, YouTube, Bluesky, Hacker News, the web and Stack Overflow (104 times).

On GitHub · 28

23 more on GitHub

On YouTube · 21

16 more on YouTube

On Bluesky · 16

11 more on Bluesky

On Hacker News · 15

10 more on Hacker News

On the web · 15

10 more on the web

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every CLI arg is a field on a dataclass.

    line 8
  2. Very specific:

    Prefer automatic selection or a better default.

    line 24
  3. Very specific:

    When the generated kwargs don't fit (wrong parser, missing choices), fix the annotation, or extend _compute_kwargs in arg_utils.py so every …

    line 43
  4. Very specific:

    Config construction: add foo_bar=self.foo_bar to the XConfig(...) call in create_engine_config or the matching create_x_config method.

    line 78
  5. Very specific:

    Add a test to tests/engine/test_arg_utils.py only for behaviour beyond the field itself (custom parsing, aliases, cross-field validation).

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adding a CLI Argument

Every CLI arg is a field on a dataclass. The dataclass owns the type, default, help text, and validation. get_kwargs(cls) in arg_utils.py derives the argparse kwargs (type, choices, BooleanOptionalAction, JSON parsing, help) from the field's annotation and attribute docstring, so a correct field produces a correct flag with no extra code.

Pick the owner first; it decides the recipe:

The arg configuresOwnerRecipe
The engine (model, cache, parallelism, scheduling, kernels, ...)A config class in vllm/config/Engine args
The API server only (HTTP, chat templates, tool parsers, LoRA modules, ...)BaseFrontendArgs (shared) or FrontendArgs (server only) in vllm/entrypoints/common/cli_args.pyFrontend args
vllm run-batch onlyBatchFrontendArgs (search for class BatchFrontendArgs)Frontend args

Decide whether a flag is needed

Prefer automatic selection or a better default. If users must control it, write down why existing controls are not enough (the pr-checklist skill asks for this).

Write the field

Same for every owner:

foo_bar: int | None = Field(default=None, ge=0)
"""What it does, how to enable it, and the default behaviour.
This docstring is the `--help` text and the rendered CLI reference."""
  • The owning classes are pydantic dataclasses, so validation lives on the field and applies to the Python API as well as the CLI. Express bounds and lengths as pydantic.Field constraints (ge, gt, le, min_length); use a validator or __post_init__ only for rules that span fields.
  • Mutable defaults use Field(default_factory=...).
  • When the generated kwargs don't fit (wrong parser, missing choices), fix the annotation, or extend _compute_kwargs in arg_utils.py so every class gets the fix.

Engine args

Fields of a config exposed through a JSON arg (search add_cli_args for --compilation-config, --attention-config, --kernel-config and the other --*-config args) are already settable as --x-config.field value. Adding the field to that config class is the whole change. Give such a field its own flag only when most users will set it, as --attention-backend does for AttentionConfig.backend; the steps below then apply as for any other field.

Otherwise EngineArgs mirrors the config field, in three places in arg_utils.py:

  1. EngineArgs field: the config's annotation verbatim, and the default read from the config class, never a literal, so the two cannot drift.

    foo_bar: int | None = XConfig.foo_bar
    foo_list: list[str] = get_field(XConfig, "foo_list")  # default_factory
  2. add_cli_args: in the existing argument group for that config, pass the get_kwargs output through untouched.

    x_group.add_argument("--foo-bar", **x_kwargs["foo_bar"])

    The flag is the field name with dashes. When the field name is generic, prefix both the flag and the EngineArgs field with the config's area (MambaConfig.backend is --mamba-backend / mamba_backend).

  3. Config construction: add foo_bar=self.foo_bar to the XConfig(...) call in create_engine_config or the matching create_x_config method.

Frontend args

The field is the whole change: BaseFrontendArgs.add_cli_args registers every field of the class as --field-name. Read the value from the parsed args where the server is built.

  • Kwargs that get_kwargs cannot express go in the class's _customize_cli_kwargs override, which calls super() first.
  • The Rust frontend serves the same flags. A flag it does not implement must fail at startup or be a documented no-op; see rust/AGENTS.md.

Check it

vllm serve --help=foo-bar     # flag, default, and help text render
.venv/bin/python -m pytest tests/engine/test_arg_utils.py -v

Add a test to tests/engine/test_arg_utils.py only for behaviour beyond the field itself (custom parsing, aliases, cross-field validation). A plain field is covered by the get_kwargs tests and needs none.

Changing an existing arg

Change the owning field (type, default, docstring) and let the CLI follow. Renames and removals keep the old flag working with a deprecation warning that names the removal version; search arg_utils.py for DEPRECATION_MESSAGE for the existing pattern.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.