Architecture report · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/ad031fd7-647b-47b9-a61c-3ad2795a93c8.md

Key findings

Verdict: should-fix issues only. One substantive finding, two nits, no blocking defect in the Architecture-and-scope lens.

The mechanism is right-sized and the layering is correct: the worker owns every instant, the encoder owns placement, no HTTP-layer clock is read, and nothing is emitted or requested when the option is off. Two findings I raised at the previous head were genuinely fixed by the new commits (public RequestTimes, and the flag-only configuration), and I verified both in code.

What remains is one scope/authorization question that a maintainer, not a reviewer, has to settle (no maintainer request, roadmap item, or measured problem is behind the feature; the only named requirement is an issue opened by the same author, unanswered), plus two nits.

I also withdraw a cost finding from my earlier pass: I had read #560's per-step runtime work as its own, but this branch is stacked on the still-open #548 and pr_diff is computed against main, so that delta is #548's. The description's "no clock read; only copying instants when off" is accurate. The detail is below so the author does not have to re-litigate it.


Should fix

1. The feature has no maintainer request, roadmap item, or measured problem behind it — docs/api.md:1005-1050, flare-cli/src/cli.rs:649, flare/src/configuration.rs:34

What is wrong. The charter's merge gate is explicit: "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." AGENTS.md:165-169 sharpens it — "Every contribution must address an explicit maintainer request, a demonstrated defect, a measured performance or memory problem, or inaccurate documentation … Hypothetical future consumers, agent-generated suggestions, and lint findings alone do not establish a need for a change" — and AGENTS.md:188-193 rejects "configuration switches without a concrete requirement".

Against that, the PR's stated requirement is:

Why it matters. This is the exact shape the charter declines twice: "Stay focused. … We're not interested in piling on extra model aliases, random switches, or broad hardware support", and AGENTS.md's "configuration switches without a concrete requirement". The change adds a user-visible non-standard response field on three protocols, a --enable-per-request-metrics flag on two commands (flare-cli/src/cli.rs:649, :863), and a new [server] per_request_metrics key (flare/src/configuration.rs:34) — measured against "the smallest footprint in shared code, or a way to solve it without new code at all" (charter, "Solve the right problem in the right place"). It does not break a rule — adding an extension field behind an off-by-default switch is compatible with "Don't silently ignore API fields" and the charter targets "the documented subset of the OpenAI API", which does not forbid extra response keys — but it is unapproved scope under AGENTS.md:201-207, where "A feature request, passing tests, or a performance gain does not waive an architectural invariant", and a maintainer decision is required.

Fix. Not a code change. Either (a) a maintainer records an explicit decision on #551/#536 that per-request response metrics are in scope, in which case this merges as designed, or (b) the description is reframed around the reproducible defect it fixes (a documented llama-swap integration returning -1 for every request) rather than around vLLM parity — note the charter lists vLLM as a competitor, not an authorization ("Alternatives / Competitors"), so "vLLM has it" is not itself a merge reason. Optionally narrow the surface: the n > 1 null rule, the multi-prompt omission, and the Responses placement all exist to match vLLM; if a maintainer prefers the smallest footprint, Chat plus Completions non-streaming would answer #551's actual complaint.


Nits

2. mean_itl_ms is not exactly vLLM's on speculative cores — helios/src/server/protocol/encode.rs:266-268

mean_itl_ms divides the first→last committed-token interval by generated - 1. A speculative step commits several tokens that share one completion instant (docs/api.md:1025-1026: "tokens committed by one speculative step share it"), so the true number of inter-token intervals is smaller than generated - 1 and the reported mean is understated relative to vLLM, which averages over recorded inter-token intervals. The interval count already exists — RequestRecord::inter_token observes exactly once per committing step (helios/src/server/runtime.rs:1800-1802, helios/src/server/metrics.rs:343-346, :352-362) — so carrying that count in RequestTimes would make the field exactly vLLM's at no extra cost. Rated a nit because the deviation is documented (docs/api.md:1022) and the placement/null contract is unaffected, but it is the one field where "vLLM-compatible" is loose.

3. The diff carries an unmerged dependency, so scope review has to be done against #548 — merge order

The PR states "Depends on #548 … #548 must merge first", and it is stacked: #548 is still open, and its commits are in this branch. Verified: tokens_committed and the first_scheduled_ns stamp already exist at pr/548 (helios/src/server/runtime.rs:1795, :2261, :2272 there), and #560's own commits are only c4fef6b2, 6c07ef44, a5d47950, f0ccabcc, 046aaef0. Consequence: the reported "+1757/−77 across 22 files" is mostly #548's metrics.rs/runtime.rs work, and #548 has three outstanding should-fix items from its own 2026-11-28 05:09 review. Declaring the dependency is fine practice; just expect this PR to be reviewed and merged only after #548 lands, then re-based so its own delta (the encoder, the four Finished emit sites, the config chain, and docs) is what reviewers judge.


Findings from my previous pass that are resolved at this head

Recorded so they are not re-raised:


What is sound (affirmative, with citations)


Open questions

  1. Does a maintainer consider #551 sufficient authorization? This is the whole of finding 1 and I cannot settle it from code. A one-line maintainer comment on #551 would close it.
  2. Is a response-body metrics object in the runtime's remit at all, given #536 (maintainer-authored) asked for scrapeable Prometheus series and #548 delivers them? If a gateway can scrape, the response-body object may be redundant for this repo's supported deployment; if gateways cannot scrape by design (#551 says llama-swap parses bodies), it is not. That distinction is a maintainer call.
  3. Would mean_itl_ms be better as exactly vLLM's by carrying the inter-token interval count? Cheap, and it removes the only loose field.

What I could not verify


Files read in context at head 046aaef

docs/api.md:1005-1052; docs/cli-design.md:736, :1317-1318, :1349; AGENTS.md:160-210; charter in full; helios/model-contract.md:340-360 (not opened); helios/src/server.rs:25-40; helios/src/server/config.rs:340-360 (not opened), :719-740; helios/src/server/http.rs:380-395; helios/src/server/metrics.rs:320-370; helios/src/server/protocol/encode.rs:228-280; helios/src/server/runtime.rs:95-112, :1720-1735, :1790-1810, :2255-2295; flare-cli/src/cli.rs:535, :649, :863, :1379-1401; flare-cli/src/config.rs:73-75, :223-233; flare/src/configuration.rs:34; flare/src/settings.rs:32, :224; flare/src/controller.rs:2566; plus the metrics.rs and runtime.rs diffs and the pr/548 equivalents used to attribute stacked work.