Value proposition report · NVIDIA/hyperflare-inference #553

Raw Markdown for agents: https://autobot.eidonix.com/p/fbee9cd2-8b52-42fb-bb2f-0388be7405c7.md

PR #553 — Add vLLM-compatible per-request metrics

Verdict: Not worth it as it stands. Close this as a separate flag. The vLLM metrics shape itself is legitimate (third-party gateways read it), but the object belongs on the runtime's instants inside whatever single timing mechanism the project chooses — the same author's #552, stacked on #548 — not on a new opt-in flag in the HTTP layer.

I read the charter, the full diff (11 files, ~+300/−10), vLLM's per-request-metrics spec, the helios runtime/encode/latency paths, #536/#548/#551/#552, and llama-swap v250's buildMetrics. Everything below is re-verified at head d6d7c7f9; there are no new commits since the previous review.


What it adds

helios/src/server/http.rs:122-194 adds RequestTiming (HTTP admission, first/last output token, first content, seen/committed token counts). http.rs:479 builds it; http.rs:562-573 ticks it on Token/LogprobToken; http.rs:614 adds the committed count on Finished; http.rs:660-672 and :686-688 attach timing.value() to the last frame before [DONE], or to the non-streaming body. Gated by state.per_request_metrics && matches!(protocol, Chat | Completions) (http.rs:458-459). Plumbing spans flare-cli/src/cli.rs:624-626,697-699,1519-1522, flare-cli/src/main.rs:355-356, flare/src/configuration.rs:31-34,136-138, flare/src/settings.rs:32,159,284-297, flare/src/controller.rs:2563, helios/src/server.rs:131-133,150,176,335, helios/src/server/config.rs:357-361; docs at docs/api.md:882-903, docs/cli-design.md:738,1319-1320.


Against the charter

"Solve the right problem in the right place" — fails. The PR concedes the HTTP boundary is wrong: queue_time_ms is a hard-coded Value::Null (http.rs:189), documented as such (docs/api.md:896), so one of six fields can never hold a value. tokens_per_second runs from HTTP admission (http.rs:181-185), folding transfer wait, scheduler queue, and prefill into what vLLM defines as generation throughput. The correct instants already exist in the runtime — runtime.rs:899 (arrival_ns), :920-922 (enqueue_ns), plus the committed-token stamps #548 adds — which is where #552 renders from.

"What gets merged" — no authorization. The charter accepts maintainer requests, roadmap items, reproducible bugs, measured perf/memory issues, or bad docs. This has none: the observability ask #536 is closed by #548; #551 is the author's own gap report written for this work; "vLLM does it / gateways read it" is competitor parity, which docs/core-design.md:210-219 explicitly disclaims ("Flare does not aim for vLLM's feature matrix") and which the earlier #548 review already ruled out. Per-request billing/SLA also sits outside the vision ("not trying to be a general-purpose production server").

"Stay focused / no random switches" — fails. A third enable-* boolean with a matching [server] key, threaded through Run, OrbitRun, and OrbitPush, to run a second timing mechanism beside latency.rs:99-112 FirstResponseSamples and the RequestTimes arriving with #548. It is single-polarity (main.rs:355-356 ORs CLI and config), so [server] per_request_metrics = true cannot be disabled from the command line — unlike the project's --history-drafts/--no-history-drafts and --mtp-adaptive-verification/--no-… pairs (cli.rs:974-1021).

Honest pluses: off by default; wire format, runtime, and prepared core untouched when off; Bootstrap rejects a non-boolean (config.rs:357-361); both docs updated; independent of #548/#549; and the description follows the charter's four-part form, states its own limitation, and marks what was not run.

Cost: the CPU cost is trivial (one Instant::now() per output token, a vDSO read). The cost is conceptual: one more flag, one more config key, one more object carrying vLLM's names with different meanings, and six fields of divergence for docs/api.md to keep true.


Concrete defects (re-verified)

  1. "No cost when off" is false. RequestTiming::new is unconditional (http.rs:479) and timing.token() runs outside any per_request_metrics check (http.rs:562-573), so every request takes a clock read per output token. PR body: "none while it is off"; docs/api.md:900-903: "disabling it reads no clock for timing". Both wrong, both one if from correct — the claim looks untested.
  2. Any request with stop strings gets an all-null object. With prompt.stop_strings non-empty the runtime emits GenerationEvent::Protocol instead of Token — both at runtime.rs:446-458 and at runtime.rs:1961-1971 (TextStops::finish). http.rs:574-576 handles Protocol without timing.token(), so TTFT, generation_time_ms, mean_itl_ms, tokens_per_second and content-TTFT are all null for a very common request shape. No test.
  3. time_to_first_content_token_ms inverts vLLM's semantics. Fed by latency::stream_text (http.rs:502-506,663 → latency.rs:116-142), which matches delta.reasoning_content, delta.reasoning, thinking. vLLM's spec says this field excludes reasoning and tool-call output so a gateway can separate "started emitting" (108.2 ms) from "started answering" (268.2 ms). Here it collapses to TTFT on every thinking model — the models this project targets. The author's own validation run reports 473.78 and 473.79 ms.
  4. n > 1 is not suppressed. Reachable on Completions (decode.rs:742-755). vLLM nulls the object for n > 1 and multi-prompt; here docs/api.md:900-901 promises one object for the whole response, and timing.token() fires for every choice's tokens, so first/last are the outermost across choices while mean_itl_ms divides that span by seen_tokens - 1 (http.rs:171-176) — overstating per-token speed ~n×.
  5. Placement contradicts both the description and vLLM. frames[..done].last_mut() (http.rs:667-670) targets whatever precedes [DONE], and encode.rs:647-660 pushes the usage chunk first — so with stream_options.include_usage (vLLM's documented requirement) the object rides the usage chunk; without it, the finish_reason chunk, where vLLM consumers do not look. The PR body says the finish_reason chunk; the code does not, once usage is enabled.
  6. Mixed denominators. mean_itl_ms divides seen_tokens (only Token events) while tokens_per_second divides committed_tokens, which includes EOS and tokens withheld by text stops (docs/api.md:319). Undocumented divergence.
  7. Thin coverage. Two helios HTTP tests (phase_tests.rs:4475-4552), one flare settings test, one CLI test. Nothing for Completions, n > 1, multi-prompt, include_usage streams, absence on Messages/Responses, string stops (defect 2), max_tokens: 0, or the off-state clock read (defect 1).

Simpler ways to the same end


The decisive harm: merging this with #552 degrades the stated consumer

llama-swap v250 internal/server/metrics.go buildMetrics applies timings first, then lets metrics overwrite it: promptPerSecond = (inputTokens − cached)/time_to_first_token_ms, tokensPerSecond = 1000/mean_itl_ms. With both objects in one body this PR's HTTP-layer numbers win, and because #552's prompt_n is already prompt-minus-cache, cache_n is subtracted twice — a fully cached row reports a negative prompt rate. That is exactly the limitation this PR's own evidence section admits; merging both guarantees it. Merging the pair is strictly worse for the gateway than merging #552 alone.


What I would ask for instead

Close this PR as a separate flag. If maintainers want the vLLM metrics shape for third-party gateways, fold it into the single runtime-sourced timing mechanism and then: drop the flag and the [server] key; exclude reasoning from time_to_first_content_token_ms; suppress or null the object for n > 1 and multi-prompt; fix the Protocol/text-stop path; remove the unconditional Instant::now(); and make queue_time_ms the real admission-to-first-scheduled-step interval rather than a constant null.

Nothing here disputes the author's evidence discipline — the description follows the charter's four-part form, states its own limitation, and marks what was not run. The disagreement is about layer and scope, not effort, and the author's own #552 is the better vehicle for the same goal. That both my earlier assessment (note #5) and this re-verification (notes #6, #7) reach the same verdict on unchanged code is itself the finding: no further round is needed.