Skip to content

[Serve] Route multiplexed ingress through a Serve request router - #66588

Merged
eicherseiji merged 10 commits into
masterfrom
seiji/multiplexed-ingress-router-app
Oct 19, 2026
Merged

eicherseiji merged 10 commits into
masterfrom
seiji/multiplexed-ingress-router-app

Conversation

@eicherseiji

@eicherseiji eicherseiji commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Wire a specialized MultiplexedIngressRequestRouter into HAProxy applications whose ingress uses @serve.multiplexed. The router passes the model ID and session metadata through the ingress deployment handle, selects a replica with the requested model loaded, and returns that replica to HAProxy.

User-defined ingress routing remains explicit. Users attach their own ingress request router deployment that implements /internal/route. A custom request_router_config on an HAProxy ingress is rejected when no explicit ingress request router is attached because HAProxy would otherwise bypass it. An explicitly attached router always takes priority over automatic multiplexing wiring.

The multiplexing router uses max_ongoing_requests=1000 so its default deployment limit does not throttle ingress replica selection.

Tests

  • 11 focused build and application-state tests passed
  • Pre-commit passed, including Ruff, Black, mypy, Pyrefly, and import-order checks

Duplicate search

No open duplicate found. #65678 and #65679 add request-router primitives but do not wire multiplexed ingress routing into HAProxy.

AI assistance

AI assistance was used. The changes require submitter review before merge.

@eicherseiji
eicherseiji force-pushed the seiji/multiplexed-ingress-router-app branch from 80b844d to 71fb807 Compare September 30, 2026 00:50
@eicherseiji
eicherseiji changed the base branch from master to seiji/haproxy-ingress-router-dispatch September 30, 2026 00:50
@eicherseiji
eicherseiji force-pushed the seiji/multiplexed-ingress-router-app branch from 71fb807 to 47e13e4 Compare September 30, 2026 00:54
@eicherseiji
eicherseiji force-pushed the seiji/multiplexed-ingress-router-app branch 3 times, most recently from 45a83ef to 1d1b368 Compare September 30, 2026 01:22
@eicherseiji eicherseiji changed the title [Serve] Add a model-multiplexed ingress request router [Serve] Route model-mux and custom ingress through Serve routers Sep 30, 2026
@eicherseiji eicherseiji added the go add ONLY when ready to merge, run all tests label Sep 30, 2026
@eicherseiji
eicherseiji force-pushed the seiji/multiplexed-ingress-router-app branch from 1d1b368 to 83cdcf6 Compare September 30, 2026 22:45
@eicherseiji
eicherseiji marked this pull request as ready for review October 1, 2026 17:40
@eicherseiji
eicherseiji requested a review from a team as a code owner October 1, 2026 17:40

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enables routing HAProxy ingress selection through the deployment's Serve router when model multiplexing is used or when a custom request router is configured, removing previous limitations and updating corresponding tests. The review feedback suggests a performance and correctness improvement in ingress_request_router.py to pass request.headers directly to session_id_from_headers instead of casting it to a dictionary, which avoids an unnecessary copy and potential case-sensitivity issues.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@ray-gardener ray-gardener Bot added the serve Ray Serve Related Issue label Oct 1, 2026
Base automatically changed from seiji/haproxy-ingress-router-dispatch to master October 15, 2026 17:49

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 242df34. Configure here.

@eicherseiji eicherseiji changed the title [Serve] Route model-mux and custom ingress through Serve routers [Serve] Route multiplexed ingress through a Serve request router Oct 15, 2026

@harshit-anyscale harshit-anyscale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

changes lgtm!
can we also add a test in serve-validation for the multiplexed ingress?

@eicherseiji
eicherseiji merged commit c99bd19 into master Oct 19, 2026
6 checks passed
@eicherseiji
eicherseiji deleted the seiji/multiplexed-ingress-router-app branch October 19, 2026 18:21
@eicherseiji

Copy link
Copy Markdown
Contributor Author

Thanks @harshit-anyscale! Created ray-project/serve_workloads#39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants