Repository navigation
refactor(llm): serve HTTP through dynamo-http-server - #209
Draft
ishandhanani wants to merge 2 commits into
Draft
ishandhanani wants to merge 2 commits into
ishandhanani wants to merge 2 commits into
Conversation
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>
ishandhanani
had a problem deploying
to
external_collaborator
November 12, 2026 05:39 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 12, 2026 05:41 — with
GitHub Actions
Failure
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
force-pushed
the
idhanani/dyn-llm-split-http-server
branch
from
November 12, 2026 07:04
6c86a91 to
81e5e7a
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 12, 2026 07:04 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Step 1 of splitting
lib/llminto smaller crates.dynamo-llmstops carrying its own copy of the HTTP server machinery and depends ondynamo-http-serverfor it, so the HTTP metrics and connection types that otherdynamo-llmmodules import now live below the crate instead of inside its largest import cycle.dynamo-llm:http/service/server.rs,http/service/write_timeout.rs, the generic half ofdisconnect.rs(connection handle and monitor) and ofmetrics.rs(theMetricsfamily, guards, response collector, error predicates),ServiceObserver/ServiceStage/InflightPermit, the request-id echo middleware,get_body_limit,is_json_content_type, and the frontend-load frame types.http/service/metrics.rsgoes from 6,381 to 2,068 lines.dynamo-llm: everything that needs the model catalog or protocol types: model-ready and start-time collectors, LoRA metrics, the serving-load collector adapter, MDC and runtime-config metric updates, response metric processing, the frontend disconnect stream monitors, andRouteDoc(it carries the frontend's OpenAPI route kinds).dynamo-http-server: the crate was copied on 2026-10-23 and ten commits changed the frontend copy afterwards (perf(llm): batch the per-token output-token counter per request ai-dynamo/dynamo#17067, feat: add Muse Spark Open support and shared Chat/Responses tool APIs ai-dynamo/dynamo#17068, feat(decisions): coordinate bounded scoring with pinned worker placement ai-dynamo/dynamo#15853, feat(decisions): expose compatible decision and systemone endpoints ai-dynamo/dynamo#15854, refactor(frontend): unify native generate handlers behind format plugins ai-dynamo/dynamo#16983, fix(anthropic): align Messages framing, errors, and validation ai-dynamo/dynamo#17367, feat(vllm): add audio transcription serving ai-dynamo/dynamo#16208, feat(planner): collect batch scheduling observations ai-dynamo/dynamo#14196, feat(frontend): refuse media before routing for text-only models ai-dynamo/dynamo#17874, fix(beam): finalize constrained tool calls at confirmed model EOS ai-dynamo/dynamo#17625). Their changes to the shared code are ported: batched output-token counter with flush on finish and drop, System One histograms, the Transcriptions / SystemOne / Decisions endpoints, the UnsupportedModality error type, sample-count ITL flush.dynamo-http-server:metrics::scrape_router(the Prometheus scrape route; the frontend wraps it to add itsRouteDoc), andserver::{bind_listener, write_idle_timeout}plusHttpServer::tls_acceptor, which the frontend admin listener needs to share the main listener's TLS settings.dynamo-llmdoes not re-export the moved items. In-repo callers import them fromdynamo-http-server: seven test files underlib/llm/tests, ext-proc, global-frontend, the generate-format catalog test, and the SGLang and vLLM generate-format crates. The Python bindings need no source change.Not in this PR: the error-class to HTTP status mapping (
http::service::error), which is the remaining reason other modules importhttp; 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.dynamo-llmintegration and doc-test binaries report the same counts; the only edits to those test files are import paths.lib/llm/srcand all 57 exist inlib/http-server/srcby name; before this change 56 of them ran in both crates.dynamo-llmlib 3,956 to 3,900 (one new upstream test offsets the 57),dynamo-http-serverlib 56 to 57.lib/http-server: 269 shared functions, types and tests are identical after normalizing visibility and paths; 14 differ only by the intended adaptation (ModelLoadViewin place ofCommittedModelView, the serving-load collector split,set_worker_info_from_parts).cargo check --workspace --all-targets: exit 0.cargo check --lockedinlib/bindings/python: exit 0.cargo metadata --lockedpasses for all four lock files.cargo clippy --no-deps --all-targets -- -D warningsondynamo-llm,dynamo-http-serverand the five touched caller crates: exit 0.httpfrom otherdynamo-llmmodules: 26 files in 12 modules before, 14 files in 9 modules after;discovery,migrationandfrontend_loadno longer import it.