Skip to content

refactor(llm): serve HTTP through dynamo-http-server - #209

Draft
ishandhanani wants to merge 2 commits into
mainfrom
idhanani/dyn-llm-split-http-server
Draft

ishandhanani wants to merge 2 commits into
mainfrom
idhanani/dyn-llm-split-http-server

Conversation

@ishandhanani

@ishandhanani ishandhanani commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Step 1 of splitting lib/llm into smaller crates. dynamo-llm stops carrying its own copy of the HTTP server machinery and depends on dynamo-http-server for it, so the HTTP metrics and connection types that other dynamo-llm modules import now live below the crate instead of inside its largest import cycle.

Not in this PR: the error-class to HTTP status mapping (http::service::error), which is the remaining reason other modules import http; it moves next.

Validation

  • cargo test -p dynamo-llm -p dynamo-http-server -p dynamo-generate-format-catalog -p dynamo-sglang-generate -p dynamo-vllm-generate -p dynamo-global-frontend --no-fail-fast: exit 0, 63 test binaries, 4,688 passed, 0 failed, 31 ignored.
  • Against the pre-change tree, the 47 dynamo-llm integration and doc-test binaries report the same counts; the only edits to those test files are import paths.
  • Unit-test accounting: 57 tests left lib/llm/src and all 57 exist in lib/http-server/src by name; before this change 56 of them ran in both crates. dynamo-llm lib 3,956 to 3,900 (one new upstream test offsets the 57), dynamo-http-server lib 56 to 57.
  • Item-level comparison of the pre-change frontend files against lib/http-server: 269 shared functions, types and tests are identical after normalizing visibility and paths; 14 differ only by the intended adaptation (ModelLoadView in place of CommittedModelView, the serving-load collector split, set_worker_info_from_parts).
  • cargo check --workspace --all-targets: exit 0. cargo check --locked in lib/bindings/python: exit 0. cargo metadata --locked passes for all four lock files.
  • cargo clippy --no-deps --all-targets -- -D warnings on dynamo-llm, dynamo-http-server and the five touched caller crates: exit 0.
  • In-crate imports of http from other dynamo-llm modules: 26 files in 12 modules before, 14 files in 9 modules after; discovery, migration and frontend_load no longer import it.

dynamo-http-server was copied from lib/llm/src/http/service on 2026-10-23
and the frontend copy kept changing. Port those changes so the crate can
replace the frontend copy:

- metrics: batched output-token counter with flush on finish and drop,
  System One histograms and phase timer, Transcriptions, SystemOne and
  Decisions endpoints, UnsupportedModality error type, sample-count based
  ITL flush.
- metrics: own the Prometheus scrape route (scrape_router) so a caller
  hands over a registry and gets back the path and router.
- server: expose bind_listener, write_idle_timeout and
  HttpServer::tls_acceptor for a second listener that shares the TLS
  settings (the frontend admin listener).

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
dynamo-llm kept its own copy of the server loop, write deadlines,
connection monitor, lifecycle observer and the HTTP metrics family after
dynamo-http-server was created from them. Depend on dynamo-http-server
and delete the copies: server.rs, write_timeout.rs, the generic half of
disconnect.rs and metrics.rs, ServiceObserver/ServiceStage/InflightPermit,
get_body_limit and is_json_content_type.

The frontend keeps what needs the model catalog: the model-ready and
start-time collectors, LoRA metrics, the serving-load collector adapter,
MDC and runtime-config metric updates, response metric processing and
RouteDoc.

dynamo-llm does not re-export the moved items. Callers in the repo
(the dynamo-llm tests, ext-proc, global-frontend and the generate-format
crates) import them from dynamo-http-server.

Step 1 of splitting lib/llm into smaller crates: the HTTP metrics and
connection types that other dynamo-llm modules import now live below the
crate.

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
@ishandhanani
ishandhanani force-pushed the idhanani/dyn-llm-split-http-server branch from 6c86a91 to 81e5e7a Compare November 12, 2026 07:04

This branch had an error being deployed

1 failed deployment
external_collaborator — 81e5e7a1 Deployed Nov 12, 2026 by ishandhanani via ok-to-test #658
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