feat(sglang): route multimodal requests to standalone encoder sidecars #19246
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.55) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 615 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.384
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #19246"
general
weight: 0.35
luckyq
Overview
Key Changes
--encoder-onlySGLang HTTP encoder as anEncodeworker (--disaggregation-mode encode). It polls/health, sends one native/encoderequest per modality under<request id>_local_part_<k>, keeps the calls in flight, and returns a descriptor with the encoder URL and the item count per modality.--route-to-encoder): forwards the descriptor to SGLang inencoder_handoffand sends the same request id asrid. SGLang's own receiver then registers its ZMQ address with that encoder.EncoderRouterselects the encoder, as it does for vLLM. A worker set that requires an encoder is ready only when a compatible encode set is present. vLLM behavior is unchanged.--route-to-encoderis refused for prefill and decode workers.Validation
cargo fmt,cargo check --all-targetsandcargo clippy -D warningspass fordynamo-sglang-sidecar,dynamo-sglang-generate,dynamo-generate-format-cataloganddynamo-llm.dynamo-sglang-sidecar122 passed; generate-format crates 23, 13, 3 and 2 passed;dynamo-llm --libfiltered to encoder, readiness, topology, model manager and model card tests, 247 passed. The one other test in that filter, an existing watcher test, failed on the test host because its home directory was full, on this branch and on the previous head alike; it passed when run with a writable home.launch/encoded.sh --encoders 2 --single-gpuand/v1/chat/completions: single images, two images in both orders, text only, and an image after text all answered correctly. Seven image requests produced seven encodes, split four and three across the two encoders./generaterequests (one image, two images, text only, one video) and chat requests with one video correctly.lib/sidecar/sglang/tests/encoder_pipeline.py(wrappertests/serve/test_sglang_encoder_pipeline.py) runs the real frontend and sidecars against fake HTTP encoders and a fake language worker, without a model. It checks round robin, the/encoderequest and its request id, the handoff andridthe language worker receives, image plus video part order, native/generate, encoder error statuses, release after a language refusal, readiness without an encoder and recovery after an encoder dies.Issues and Ongoing Work
Part of DIS-3538. Part of #14124. Follows #13966. Wait for sgl-project/sglang#51754 and publication of
sglang-api-types0.2.0. Dynamo main adopted the published bindings in #19156, which do not carryencoder_handoffyet, so this branch still conflicts with main until that release.<details>
<summary>Pull Request Checklist</summary>
/pr-checklistskill.</details>
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added support for routing staged images through standalone SGLang encoder workers, including deployments with split prefill and decode.
Native SGLang
/generaterequests can now use ordered image URLs alongside token IDs.Added a configurable launcher for SGLang deployments with encoder services.
Bug Fixes
Improved validation of staged image inputs and rejected unsupported media and client-supplied internal routing data.
Documentation
Updated SGLang deployment notes with image support details and validation limits.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->