Skip to content

feat(vllm): publish RL worker metadata - #13529

Closed
biswapanda wants to merge 13 commits into
ai-dynamo:mainfrom
biswapanda:feat/vllm-sidecar-rl-metadata
Closed

biswapanda wants to merge 13 commits into
ai-dynamo:mainfrom
biswapanda:feat/vllm-sidecar-rl-metadata

Conversation

@biswapanda

@biswapanda biswapanda commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • publish vLLM sidecar RL worker metadata through Dynamo discovery
  • compute the inference world size from tensor, pipeline, and data parallelism
  • advertise the optional vLLM HTTP admin endpoint for weight-transfer control
  • reject topology or RL-capability drift between bootstrap and startup

Dependency

Stacked on #13524, which defines the shared worker metadata contract. Once #13524 merges, this PR reduces to the four vLLM sidecar files.

Validation

  • cargo test -p dynamo-vllm-sidecar: 23 library tests and 1 executable test passed
  • cargo clippy -p dynamo-vllm-sidecar --all-targets -- -D warnings
  • cargo fmt --all
  • git diff --check

Open in Devin Review

Summary by CodeRabbit

  • New Features
    • Added RL worker metadata, including world size and optional administrative endpoint details.
    • RL discovery responses now include a protocol version and richer worker information.
    • vLLM workers can advertise an HTTP administrative endpoint for RL weight-transfer control.
  • Bug Fixes
    • Improved validation for invalid metadata and blank endpoint values.
    • Startup checks now detect incompatible parallelism changes and handle model discovery failures more reliably.

Review follow-up validation

  • RED: HTTP endpoint tests failed before the dedicated validator existed; topology tests failed against the generic world-size error
  • GREEN: cargo test -p dynamo-vllm-sidecar --lib (26 passed)
  • GREEN: cargo clippy -p dynamo-vllm-sidecar --all-targets -- -D warnings

@biswapanda
biswapanda requested review from a team as code owners August 19, 2026 09:43
@biswapanda
biswapanda temporarily deployed to external_collaborator August 19, 2026 09:43 — with GitHub Actions Inactive
@biswapanda
biswapanda temporarily deployed to external_collaborator August 19, 2026 09:43 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi biswapanda! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added external-contribution Pull request is from an external contributor feat labels Aug 19, 2026
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test ca915e1

@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 20c8fc51-4cf6-485a-80fd-12b695cb4d3d

📥 Commits

Reviewing files that changed from the base of the PR and between 7b02c65 and ca915e1.

📒 Files selected for processing (9)
  • lib/backend-common/src/lib.rs
  • lib/backend-common/src/rl.rs
  • lib/backend-common/src/worker.rs
  • lib/bindings/python/rust/backend.rs
  • lib/rl/src/lib.rs
  • lib/sidecar/vllm/src/args.rs
  • lib/sidecar/vllm/src/engine.rs
  • lib/sidecar/vllm/src/model.rs
  • lib/sidecar/vllm/src/tests.rs

Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review.


Walkthrough

The change adds protocol-versioned RL worker metadata. vLLM discovers and validates metadata, WorkerConfig carries it, and RL routes responses serialize it.

Changes

RL worker metadata flow

Layer / File(s) Summary
Protocol discovery and route metadata
lib/rl/src/lib.rs
RL discovery validates route metadata, matches model registrations, propagates structured probe results, and returns protocol-versioned worker data.
Backend metadata contract and endpoint response
lib/backend-common/src/lib.rs, lib/backend-common/src/rl.rs, lib/backend-common/src/worker.rs, lib/bindings/python/rust/backend.rs
RlWorkerMetadata validates configuration and flows through WorkerConfig into RL route responses.
vLLM metadata discovery and startup validation
lib/sidecar/vllm/src/args.rs, lib/sidecar/vllm/src/engine.rs, lib/sidecar/vllm/src/model.rs, lib/sidecar/vllm/src/tests.rs
vLLM reads the HTTP endpoint, derives metadata from model parallelism, validates startup compatibility, and stores the result in WorkerConfig.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to ca915

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the changes and validation, but it omits the required Related Issues section and reviewer-start guidance. Add the required Related Issues section and specify where reviewers should start, using the repository template.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: publishing RL worker metadata from the vLLM sidecar.

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 4 potential issues.

Open in Devin Review

Comment thread lib/rl/src/lib.rs Resolved
Comment thread lib/sidecar/vllm/src/model.rs Resolved
Comment thread lib/sidecar/vllm/src/engine.rs Resolved
Comment thread lib/rl/src/lib.rs Resolved
@biswapanda
biswapanda force-pushed the feat/vllm-sidecar-rl-metadata branch from ca915e1 to 4571d43 Compare August 20, 2026 07:53
@biswapanda
biswapanda temporarily deployed to external_collaborator August 20, 2026 07:53 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 4571d43

@biswapanda
biswapanda temporarily deployed to external_collaborator August 20, 2026 18:44 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test c9de4cd

@biswapanda biswapanda removed the external-contribution Pull request is from an external contributor label Aug 20, 2026
@biswapanda biswapanda changed the title feat(vllm): publish RL worker metadata feat(RL): publish RL worker metadata Aug 20, 2026
@biswapanda
biswapanda requested a review from a team as a code owner August 20, 2026 18:57
@biswapanda
biswapanda temporarily deployed to external_collaborator August 20, 2026 18:57 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 0b413d8

@biswapanda
biswapanda temporarily deployed to external_collaborator August 20, 2026 18:58 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test ce4b917

@biswapanda biswapanda self-assigned this Aug 20, 2026
@biswapanda
biswapanda enabled auto-merge (squash) August 20, 2026 19:04
@biswapanda biswapanda changed the title feat(RL): publish RL worker metadata feat(vllm): publish RL worker metadata Aug 20, 2026

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

Left some nit picky comments mainly about tests and helper functions. One question I have is about the new HTTP endpoint. Why do we need this? I thought all control routes were exposed through gRPC.

Comment on lines +225 to +230

#[test]
fn rl_worker_metadata_rejects_invalid_values() {
assert!(RlWorkerMetadata::new(0, None).is_err());
assert!(RlWorkerMetadata::new(1, Some(" ".to_string())).is_err());
}

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.

I don't think this test is necessary

Comment on lines +49 to 59
fn normalized_optional(value: Option<String>, error: &str) -> anyhow::Result<Option<String>> {
value
.map(|value| {
let value = value.trim();
if value.is_empty() {
anyhow::bail!(error.to_string());
}
Ok(value.to_string())
})
.transpose()
}

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.

Why is this a separate function? It's only used in one place.

Comment thread lib/rl/src/lib.rs
Comment on lines +297 to +315
fn rl_endpoint_instances(
instances: Vec<DiscoveryInstance>,
rl_endpoint: &str,
component_filter: Option<&[String]>,
) -> Vec<Instance> {
instances
.into_iter()
.filter_map(|instance| match instance {
DiscoveryInstance::Endpoint(endpoint) => Some(endpoint),
_ => None,
})
.filter(|endpoint| endpoint.endpoint == rl_endpoint)
.filter(|endpoint| {
component_filter
.map(|components| components.iter().any(|c| c == &endpoint.component))
.unwrap_or(true)
})
.collect()
}

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.

Was there a reason for making this a helper function as well?

Comment thread lib/rl/src/lib.rs
Comment on lines +738 to +748
#[test]
fn rl_endpoint_instances_do_not_require_model_metadata() {
let endpoints = rl_endpoint_instances(
vec![endpoint_instance("dynamo", "backend", "rl", 1)],
"rl",
None,
);

assert_eq!(endpoints.len(), 1);
assert_eq!(endpoints[0].instance_id, 1);
}

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.

Unnecessary test

Comment on lines +493 to +514
#[test]
fn http_admin_endpoint_accepts_http_https_and_path_prefixes() {
for endpoint in [
"http://worker:8120",
"https://worker.example.com",
"https://worker.example.com/admin/v1",
] {
assert_eq!(
validate_http_endpoint(endpoint).expect("valid HTTP admin endpoint"),
endpoint
);
}
}

#[test]
fn http_admin_endpoint_rejects_invalid_values() {
for endpoint in ["", "worker:8120", "grpc://worker:8120", "https:///admin"] {
let error = validate_http_endpoint(endpoint).unwrap_err();
assert!(error.to_string().contains("--vllm-http-endpoint"));
}
}

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.

Unnecessary tests

Comment on lines +462 to +472
#[test]
fn discovered_model_reports_rl_worker_metadata() {
let model = DiscoveredModel::from_proto(model_info(), server_info()).expect("valid discovery");
assert_eq!(
model
.rl_worker_metadata(Some("http://worker:8120".to_string()))
.expect("valid RL metadata"),
RlWorkerMetadata::new(4, Some("http://worker:8120".to_string()))
.expect("valid expected metadata")
);
}

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.

Unnecessary test

Comment on lines +19 to +21
/// Optional vLLM HTTP admin endpoint advertised for RL weight-transfer control.
#[arg(long, env = "VLLM_HTTP_ENDPOINT")]
pub vllm_http_endpoint: Option<String>,

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.

Why do we need this? I thought all necessary controls were exposed through gRPC?

Comment thread lib/rl/src/lib.rs
Comment on lines +652 to +668
#[test]
fn parse_worker_routes_rejects_invalid_rl_metadata() {
let zero = parse_worker_routes(json!({ "routes": [], "world_size": 0 })).unwrap_err();
assert!(zero.to_string().contains("world_size"));
}

#[test]
fn parse_worker_routes_rejects_invalid_admin_base_url() {
for value in [json!(" "), json!(42)] {
let err = parse_worker_routes(json!({
"routes": [],
"admin_base_url": value,
}))
.unwrap_err();
assert!(err.to_string().contains("admin_base_url"));
}
}

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.

Not sure we really need these either

@biswapanda

Copy link
Copy Markdown
Contributor Author

Superseded by stacked upstream-head PR #13607, based directly on #13606. The reviewed commits are unchanged and the upper PR now shows only its sidecar-specific delta.

@biswapanda

Copy link
Copy Markdown
Contributor Author

Closing in favor of #13607.

@biswapanda biswapanda closed this Aug 20, 2026
auto-merge was automatically disabled August 20, 2026 19:23

Pull request was closed

This branch was previously deployed

1 inactive deployment
external_collaborator — ce4b9175 Deployed Aug 20, 2026 by biswapanda via ok-to-test #11409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants