Skip to content

docs: describe request admission and rate limiting in ARCHITECTURE.md - #480

Merged
maralbahari merged 2 commits into
vllm-project:mainfrom
Zheng-Lu:docs/architecture-rate-limit
Oct 26, 2026
Merged

maralbahari merged 2 commits into
vllm-project:mainfrom
Zheng-Lu:docs/architecture-rate-limit

Conversation

@Zheng-Lu

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #458, as requested in @maralbahari's approval: #458 (review). Documentation only.

ARCHITECTURE.md now describes:

  • Request admission (new section). Protected routes run OIDC (require_oidc), then rate-limit admission (enforce_rate_limit), then the retrieval-only API-key check, then the handler. Authentication comes first because the limiter keys a bucket by the verified principal whenever there is one. The section also explains why the rate-limit route_layer is added before the OIDC one, and which routes sit outside both layers.
  • rate_limit.rs (new section): GCRA buckets, keys (OIDC principal, otherwise the peer address with IPv6 grouped by /64; never unverified credentials or forwarded-for headers), the MAX_KEYS and overflow bound, the retry hints, and the per-frame WebSocket charge through RateLimitCharge.
  • error_response.rs (new section): GatewayError and the OpenAI or Anthropic envelope chosen by ErrorFormat::for_path, used for authentication failures and rate limits.
  • server_settings.rs: the [server] admission settings and their CLI > environment > file > default resolution.
  • Smaller updates:
    • rate_limit is added to the library exports and the gateway's module table;
    • server.rs serves with connect info;
    • auth.rs mentions require_api_key;
    • a new "Change request admission" row in the quick reference.

Test Plan

  • Checked each statement against main at a7dc7b5:
    • the layer order in build_router_with_auth;
    • RateLimitKey::for_caller;
    • LimiterState;
    • the WebSocket RateLimitCharge::check path, which sends an error event and keeps the connection open;
    • the OIDC 401 and 503 responses;
    • server_settings::resolve_rate_limit_values.
  • pre-commit run --files ARCHITECTURE.md passes.

Follow-up to vllm-project#458. Documents rate_limit.rs, error_response.rs and
server_settings.rs, and the admission order on protected routes:
OIDC authentication runs before rate-limit admission, so the limiter
keys a bucket by the verified principal whenever there is one.

Signed-off-by: Zheng Lu <[email protected]>
@maralbahari
maralbahari merged commit a6fa799 into vllm-project:main Oct 26, 2026
8 checks passed
haoshan98 added a commit to EmbeddedLLM/agentic-api that referenced this pull request Oct 27, 2026
Brings in vllm-project#480 (ARCHITECTURE.md request admission and rate limiting),
vllm-project#481 (PostgreSQL conversation upsert), vllm-project#467 (prompt cache breakpoints on
inlined text files), vllm-project#478 (benchmark session sweep) and vllm-project#487 (test
alignment with typed Responses validation). Merged without conflicts.

Signed-off-by: haoshan98 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants