Skip to content

feat(router): add load-aware generate paths - #199

Open
bvolpato wants to merge 1 commit into
vllm-project:mainfrom
bvolpato:bvolpato/typed-skyrl-generate
Open

feat(router): add load-aware generate paths#199
bvolpato wants to merge 1 commit into
vllm-project:mainfrom
bvolpato:bvolpato/typed-skyrl-generate

Conversation

@bvolpato

@bvolpato bvolpato commented Aug 5, 2026

Copy link
Copy Markdown

Purpose

Extensions can expose generate-compatible endpoints beyond /inference/v1/generate. Unknown paths currently use transparent proxying, which bypasses typed request routing and cache-aware worker selection.

Add extra_generate_paths and --extra-generate-paths. Each configured path:

  • validates with existing InferenceGenerateRequest schema
  • extracts token_ids for cache-aware routing
  • forwards request to same backend path
  • uses typed retries, circuit breaking, and in-flight load accounting
  • supports regular and prefill/decode routing

This lets integrations register endpoints without adding integration-specific routes or concepts to vLLM Router.

Compatibility

Configured paths retain transparent-proxy wire behavior:

  • request JSON is forwarded semantically unchanged, including omitted optional fields, nested values, and unknown extension fields
  • client-only headers remain isolated while configured backend authorization is preserved
  • backend response status, headers, and body bytes are preserved
  • configured requests use existing authorization and concurrency limiting
  • built-in routes keep priority and cannot be overridden by extension configuration
  • unconfigured paths retain existing transparent-proxy or disabled-proxy 404 behavior

Routing metadata and original JSON remain separate, so typed selection never rewrites payload shape. Prefill/decode routing receives explicit generate request kind instead of inferring it from payload fields.

Configured paths are validated before startup to reject duplicates and dynamic patterns. Extra paths dispatch from unmatched-route fallback, so built-in routes remain defined by Axum route table without duplicate reserved-path inventory.

Cancellation-safe global load accounting is intentionally separate in #200. Related consumer dependency/startup update: NovaSky-AI/SkyRL#1988.

Test Plan

  • Register /custom/v1/generate against two delayed workers.
  • Start one shared-prefix request, then send another while first remains active.
  • Verify cache-aware routing sends one request to each worker.
  • Compare complete forwarded JSON object, including omitted stream, nested values, priority, and unknown fields.
  • Verify backend path, authorization isolation, response status, headers, and body.
  • Verify configured paths use concurrency limiting and cannot override built-ins.
  • Verify disabled transparent proxy still returns 404 before auth for unknown paths.
  • Verify prefill/decode request-kind separation and nested sampling-limit mutation.
  • Validate Python and Rust configuration surfaces.

Test Result

  • cargo fmt --all -- --check: passed.
  • cargo clippy --all-targets --all-features -- -D warnings: passed.
  • cargo test --all-features: passed, including 487 library tests and 51 API endpoint tests.
  • .venv/bin/pytest py_test/unit -q: 109 passed, 4 skipped.
  • uvx black --check py_src py_test: passed.
  • uvx ruff check py_src py_test: passed.
  • git diff --check: passed.

Essential Elements of an Effective PR Description Checklist
  • Purpose documented.
  • Test plan documented.
  • Test results documented.

@bvolpato
bvolpato marked this pull request as ready for review August 5, 2026 18:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c35714f5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/routers/http/vllm_pd_router.rs Outdated
@bvolpato bvolpato changed the title feat(router): register SkyRL generate as typed route feat(router): add load-aware SkyRL generation Aug 5, 2026
@bvolpato
bvolpato force-pushed the bvolpato/typed-skyrl-generate branch from 0385fdd to dc05d1e Compare August 5, 2026 18:49
@bvolpato
bvolpato marked this pull request as draft August 5, 2026 18:50
@bvolpato
bvolpato force-pushed the bvolpato/typed-skyrl-generate branch from dc05d1e to 8d88d15 Compare August 5, 2026 19:09
@bvolpato bvolpato changed the title feat(router): add load-aware SkyRL generation feat(router): add load-aware generate paths Aug 5, 2026
@bvolpato
bvolpato marked this pull request as ready for review August 5, 2026 19:10
@bvolpato
bvolpato force-pushed the bvolpato/typed-skyrl-generate branch from 8d88d15 to 7e94458 Compare August 5, 2026 19:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d88d153c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/routers/router_manager.rs Outdated
@bvolpato
bvolpato force-pushed the bvolpato/typed-skyrl-generate branch 4 times, most recently from 4d15d57 to ed0c3d5 Compare August 5, 2026 20:20
Signed-off-by: Bruno Volpato <brunocvcunha@gmail.com>
@bvolpato
bvolpato force-pushed the bvolpato/typed-skyrl-generate branch from ed0c3d5 to 0971b39 Compare August 16, 2026 20:26
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.

1 participant