agentleFS
vllm-projectvllm-project/agentic-api/AGENTS.md

agentic-api

AGENTS.md346 starsChanged 6 days agoApache-2.0View on GitHub

Instructions for AI coding agents working on this repository. Read .agents/skills/agentic-api-engineering/SKILL.md before implementing, refactoring, fixing, or reviewing code. It defines repository-wide discovery, reuse of existing typed extension points, Rust design and Clippy expectations, provider documentation/parity evidence, and the recorder/test workflow. Apply its shared preparation once. For Rust changes, use the bundled Rust skill; use the focused review skills where relevant. This repository is Rust-first under the vllm-project GitHub organization. - Rust -- primary and active implementation language at the repo…

  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

22 rules. About 0 are common, 9 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .agents/skills/agentic-api-engineering/SKILL.md before implementing, refactoring, fixing, or reviewing code.

    line 7
  2. Very specific:

    Read and follow TERMINOLOGY.md when naming API, state, tool, streaming, MCP, or reasoning concepts in code, documentation, issues, and pull …

    line 24
  3. Very specific:

    Treat TERMINOLOGY.md as normative for preferred prose.

    line 26
  4. Very specific:

    When local wording conflicts with current OpenAI documentation, prefer the OpenAI term unless this repository has a distinct implementation …

    line 28
  5. Very specific:

    Before adding or updating replay cassettes, read crates/agentic-server-core/tests/cassettes/README.md and use its recorder workflow and …

    line 70
  6. Distinctive:

    Read the release guide before preparing or publishing a release or changing release automation.

    line 99
  7. Distinctive:

    Use the Cargo workspace's declared version as the source of truth.

    line 106
  8. Distinctive:

    Verify actual registry artifacts before reporting a release complete or updating website install versions.

    line 110
  9. Very specific:

    Read the target streaming pipeline before changing streaming code in events/ or executor/.

    line 135
  10. Distinctive:

    Keep transport free of semantic-event and output-item decisions.

    line 146
  11. Distinctive:

    Keep the relay free of response-assembly state.

    line 147
  12. Distinctive:

    Do not introduce unbounded channels.

    line 148
  13. Very specific:

    Run synchronous ingestion inline by default.

    line 150
  14. Very specific:

    Use .agents/skills/executor-architecture-review/SKILL.md for a focused, read-only boundary review while planning or reviewing these changes.

    line 156
  15. Distinctive:

    Read Schema, migrations, and where data goes before changing the schema, a migration, or what is persisted.

    line 161
  16. Very specific:

    Do not use loose/untyped JSON signatures (serde_json::Value and similar) at a public API boundary.

    line 169
  17. Very specific:

    Prefer borrowing (&T, &str, &[T]) and avoid .clone() unless ownership or lifetime requirements make it necessary.

    line 173
  18. Very specific:

    Never hold a Mutex/RwLock guard across .await.

    line 179
  19. Very specific:

    Avoid speculative optimization: minimize allocations in hot paths with borrowing, slices, Bytes, and known capacities, then validate …

    line 184
  20. Very specific:

    Always sign off commits with the -s flag (git commit -s).

    line 189
  21. Distinctive:

    Use conventional commit prefixes:

    line 190
  22. Distinctive:

    Ensure all pre-commit hooks pass before opening the PR.

    line 203

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
AGENTS.md

AGENTS.md

Instructions for AI coding agents working on this repository.

Before coding or reviewing

Read .agents/skills/agentic-api-engineering/SKILL.md before implementing, refactoring, fixing, or reviewing code. It defines repository-wide discovery, reuse of existing typed extension points, Rust design and Clippy expectations, provider documentation/parity evidence, and the recorder/test workflow. Apply its shared preparation once. For Rust changes, use the bundled Rust skill; use the focused review skills where relevant.

Project Overview

This repository is Rust-first under the vllm-project GitHub organization.

  • Rust -- primary and active implementation language at the repo root.
  • Docs -- MkDocs documentation in docs/.
  • Python -- a lightweight distribution and launcher for the packaged Rust gateway; the gateway implementation remains Rust-first.

Terminology

  • Read and follow TERMINOLOGY.md when naming API, state, tool, streaming, MCP, or reasoning concepts in code, documentation, issues, and pull requests.
  • Treat TERMINOLOGY.md as normative for preferred prose. Preserve exact field names and item types when discussing a wire protocol.
  • When local wording conflicts with current OpenAI documentation, prefer the OpenAI term unless this repository has a distinct implementation concept documented in TERMINOLOGY.md.

Project Structure

.
├── TERMINOLOGY.md              # Normative project vocabulary
├── crates/agentic-server/       # Axum binary, transport handlers, and configuration
├── crates/agentic-server-core/  # Protocol types, execution, tools, and persistence
├── crates/agentic-llm-d/        # Split-execution state backend for the llm-d coordinator
├── crates/agentic-cli-docs/     # Build-time generator for the CLI reference docs
├── crates/agentic-praxis/       # Praxis integration
├── python/agentic_api/          # Python distribution, diagnostics, and launcher
├── tests/python/                # Python package and CLI tests
├── .agents/skills/              # Engineering, Rust, and focused review skills
├── pyproject.toml               # Python wheel build metadata
├── Cargo.toml                    # Workspace manifest and shared dependencies/lints
└── docs/                         # Documentation (MkDocs)

Setup

Install pre-commit hooks and build the project:

pre-commit install
cargo build

Testing

cargo test

# Python distribution and CLI tests
uv run --python 3.12 --with maturin==1.14.1 --with pytest==9.1.1 python -m pytest tests/python

# Source-install CLI E2E (also exercises the packaged wheel build)
python3 scripts/tests/agentic-cli-e2e-test.py
  • Before adding or updating replay cassettes, read crates/agentic-server-core/tests/cassettes/README.md and use its recorder workflow and existing scenario scripts; do not hand-author captured request/response YAML.

Linting and Formatting

cargo clippy --all-targets -- -D warnings   # lint
cargo fmt                                     # format
cargo fmt -- --check                          # check formatting only

To run all pre-commit hooks manually:

pre-commit run --all-files

Documentation

Install docs dependencies and run docs locally:

uv venv
uv pip install -r docs/requirements.txt
uv run mkdocs serve

Releases

  • Read the release guide before preparing or publishing a release or changing release automation. Keep that guide synchronized with the workflow inputs and checks.
  • PRs and merges validate artifacts; they do not publish packages. Release preparation, crates publication, and PyPI publication use separate GitHub Actions workflows. Trigger publishing on main after checking the run's commit and version; GitHub Actions handles validation and registry uploads. The crates workflow also publishes the container from the release tag. Container-only recovery uses the dedicated workflow; do not republish packages to repair an image or website failure.
  • Use the Cargo workspace's declared version as the source of truth. Keep the core dependency and lockfile aligned; do not invent a default release version or a separate Python version.
  • Preserve duplicate-version failures and all platform-specific wheel checks. Inspect registry state before retrying any failed publication; never add skip-existing or blindly retry a partial upload.
  • Verify actual registry artifacts before reporting a release complete or updating website install versions. PyPI README/metadata fixes require a new release to reach the published package page.

Code Style

  • Rust edition: 2024.
  • Maximum line length: 120 characters (configured in rustfmt.toml).
  • unsafe code is forbidden (unsafe_code = "forbid" in Cargo.toml).
  • Clippy all lints are denied; pedantic lints are warnings.
  • Minimum supported Rust version (MSRV): 1.98.1, declared as rust-version in Cargo.toml and checked by the msrv CI job. Keep msrv in clippy.toml equal to it.

The agentic-server and core design architecture

See ARCHITECTURE.md for the full crate breakdown, request lifecycle, module-by-module walkthrough, and contribution guide.

  • types/ owns wire/domain data; events/ parses and normalizes upstream events; tool/ owns tool discovery, routing, and execution; executor/ orchestrates requests across inference, tools, and persistence; storage/ owns database models and operations; utils/ contains genuinely shared, domain-neutral helpers.
  • Respect this dependency direction: handlers call core APIs; executor coordinates events, tool, and storage; those modules share contracts through types. Do not introduce transport concerns into core types or business logic.

Executor streaming change rules

Read the target streaming pipeline before changing streaming code in events/ or executor/. RFC #241 is split into synchronous ingestion #243, client delivery #244, and execution-placement measurement #245. New work must converge on those boundaries:

  • Assign every responsibility to one stage: inference.rs owns HTTP/SSE framing, events/ owns normalization, the synchronous ingestion state machine owns semantic-event validation and output-item assembly, the stream relay owns ordered client delivery, and engine.rs owns inference rounds, the tool loop, and persistence.
  • Extend the single ingestion path. Do not add a second parser, lifecycle validator, delta folder, finalizer, tool-call translator, or client-emission path. Different validation policies must share the same state transitions.
  • Keep transport free of semantic-event and output-item decisions. Keep ingestion free of client-delivery concerns. Keep the relay free of response-assembly state. Keep the engine free of SSE parsing.
  • Do not introduce unbounded channels. A channel needs an entry capacity plus either a byte budget or a maximum item size, defined full/disconnect behavior, cancellation propagation, and task join/error handling.
  • Run synchronous ingestion inline by default. Add worker or spawn_blocking placement only when representative measurements show a benefit and include queue occupancy, tail latency, memory, and cancellation behavior.
  • Preserve compile-time extension points: typed output-item state, exhaustive matches, and one declared path for a new semantic event or output-item kind. Test invalid lifecycle order, identifier/index mismatch, duplicate completion, terminal finalization, slow consumers, and disconnects when the changed boundary can encounter them.

Use .agents/skills/executor-architecture-review/SKILL.md for a focused, read-only boundary review while planning or reviewing these changes.

Storage change rules

Read Schema, migrations, and where data goes before changing the schema, a migration, or what is persisted. Model SQL stays portable across SQLite and PostgreSQL; backend differences belong in storage/pool.rs and storage/schema.rs. Keep responses.metadata to what a continuation needs, and give data read by another path its own column. Use .agents/skills/storage-schema-change/SKILL.md as the checklist.

Rust Best Practices

  • Do not use loose/untyped JSON signatures (serde_json::Value and similar) at a public API boundary. Request, response, and tool payloads must be modeled as proper types in agentic-server-core/types and serialized/ deserialized through them. Functions and APIs introduced in this repo must be typed Rust; untyped JSON is not a substitute for a real type at a public boundary.
  • Prefer borrowing (&T, &str, &[T]) and avoid .clone() unless ownership or lifetime requirements make it necessary. Move values when ownership is transferred; use Arc only for genuinely shared thread-safe state, and keep required clones explicit and close to task spawn.
  • Return Result for recoverable failures and propagate with ?. Use typed thiserror errors in library/core code, preserve sources during conversion, add useful boundary context, and avoid unwrap/expect in production paths except for documented, impossible invariants.
  • Never hold a Mutex/RwLock guard across .await. Use Tokio async I/O, spawn_blocking for blocking or CPU-heavy work, bounded channels for backpressure, and try_join! for independent fallible work. Spawned tasks must have clear cancellation, shutdown, and join/error handling.
  • Encode invariants with enums, newtypes, Option, and validated constructors. Prefer exhaustive matches and safe conversions (From/TryFrom) over stringly typed state, unchecked casts, or panics.
  • Avoid speculative optimization: minimize allocations in hot paths with borrowing, slices, Bytes, and known capacities, then validate non-obvious optimizations with measurements. unsafe remains forbidden.

Commits

  • Always sign off commits with the -s flag (git commit -s).
  • Use conventional commit prefixes:
    • feat: -- new feature
    • fix: -- bug fix
    • ci: -- CI/CD changes
    • chore: -- maintenance tasks (deps, config)
    • docs: -- documentation only

Pull Requests

  • Target the main branch.
  • Include two sections in the PR description:
    • Summary -- what the PR does and why.
    • Test Plan -- how the changes were verified.
  • Ensure all pre-commit hooks pass before opening the PR.

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.