Skip to content

feat(gateway): /add_worker shim that accepts URL via query string + worker_type#17

Open
DavidBellamy wants to merge 19 commits intomainfrom
feat/gateway-miles-add-worker-shim-llm360-fork
Open

feat(gateway): /add_worker shim that accepts URL via query string + worker_type#17
DavidBellamy wants to merge 19 commits intomainfrom
feat/gateway-miles-add-worker-shim-llm360-fork

Conversation

@DavidBellamy
Copy link
Copy Markdown
Collaborator

Summary

Adds a `miles_add_worker` HTTP handler to `sgl-model-gateway/src/server.rs` that accepts the URL-as-query-string format Miles uses to register workers, and translates it into the gateway's standard JSON-body `WorkerConfigRequest`. Also handles PD-disaggregation worker types (`prefill` / `decode` / `regular`) once `LLM360/miles#990` lands the corresponding client-side change.

Why

Miles speaks a different request convention than the gateway expects. This adapter avoids a Miles-side change for every gateway-side API tweak, and lets PD-disaggregation worker registration flow through the same `create_worker` service path as the JSON-body endpoint.

Changes

  • New `MilesAddWorkerQuery` struct (Deserialize) for the URL-as-query-string payload (fields: `url`, optional `worker_type`, optional `bootstrap_port`).
  • New `miles_add_worker` async handler that constructs a minimal JSON body and dispatches to the existing `create_worker` service.
  • Worker-type validation: returns 400 with a structured error message on unknown values.
  • Uses `serde_json::from_value` so the shim stays resilient to upstream `WorkerConfigRequest` field additions (defaults handle them).

Test plan

  • Manual via curl with each worker_type.
  • Sanity check that the dispatched body matches what `service_discovery` already sends.

Provenance

One of five focused PRs that supersede #3.

mickqian and others added 19 commits April 4, 2026 23:37
…alistic perf and auto-discover ut (sgl-project#22086)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
…gl-project#21649)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
…orker_type

Adds a miles_add_worker HTTP handler to sgl-model-gateway/src/server.rs that
accepts the URL-as-query-string format Miles uses to register workers, and
translates it into the gateway's standard JSON-body WorkerConfigRequest.
Also handles PD-disaggregation worker types (prefill/decode/regular) once
LLM360/miles#990 lands the corresponding client-side change.

Miles speaks a different request convention than the gateway expects. This
adapter avoids a Miles-side change for every gateway-side API tweak, and lets
PD-disaggregation worker registration flow through the same create_worker
service path as the JSON-body endpoint.
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.

9 participants