Value proposition report · NVIDIA/hyperflare-inference #553

Raw Markdown for agents: https://autobot.eidonix.com/p/0b596174-031e-4269-bfb3-3b3bf0728e2c.md

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

Verdict: Not worth it — decline as a separate feature, and redirect the vLLM shape into the runtime-sourced timing path (#552) that the same author already has open.

The change is small, opt-in, and mostly competently plumbed, but it lands the timing in the wrong layer (so one of its six fields can never be non-null), duplicates instrumentation the project already ships and is already landing in #548/#552, adds a second parallel timing mechanism plus a new flag/config-key triplet against the charter's "stay focused, don't pile on switches" rule, claims a wire-compatible field whose semantics it inverts, and — if merged alongside #552 — actively degrades the exact gateway numbers it exists to produce. Its own contribution to users would be a metrics object that a vLLM-shaped consumer can't find in the default streaming case and that reports reasoning time as content time.


What it actually does

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 per request; http.rs:562-573 ticks it on GenerationEvent::Token/LogprobToken; http.rs:614 adds the committed count on Finished; http.rs:660-672/686-688 attach timing.value() to the streaming finish/usage chunk or the non-streaming body. Gated by state.per_request_metrics && matches!(protocol, Chat | Completions) (http.rs:458). Flag/config plumbing spans flare-cli/src/cli.rs (Run, OrbitRun, OrbitPush), flare-cli/src/main.rs:355, flare/src/configuration.rs:31-34,136-138, flare/src/settings.rs, flare/src/controller.rs:2563, helios/src/server.rs:133,176, helios/src/server/config.rs:354-360; docs in docs/api.md:882-903, docs/cli-design.md:738,1319-1320. 11 files, ~+300/−10.


Charter comparison

"Solve the right problem in the right place" — fails. The HTTP layer is the wrong boundary, and the PR concedes it: queue_time_ms is a hard-coded Value::Null (http.rs:189, documented at docs/api.md:896), and tokens_per_second is measured from HTTP admission, so it folds HTTP wait, queue, and prefill into what vLLM documents as generation speed. The runtime already holds those instants — runtime.rs:899 (arrival_ns), runtime.rs:920-922 (enqueue_ns), the committed-token stamps #548 adds — and #552 renders from them. Six fields, one of which is structurally always null, is a design that shipped the wrong layer's limits to the client.

"What gets merged" — no authorization. Charter: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured perf/memory issue, or bad docs. This has none. The observability ask (#536) is closed by #548; the gap report #551 is the author's own; and "vLLM's field names / gateways already read it" is competitor parity, which the earlier #548 review already ruled out as authorization. Per-request billing/SLA is also explicitly 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, wired through three CLI structs, to run a second timing mechanism beside latency.rs's FirstResponseSamples (latency.rs:99-112) and the RequestTimes arriving with #548. The flag is also single-polarity (main.rs:355-356 ORs it in), so a config-file true cannot be turned off from the command line — unlike the project's existing --history-drafts/--no-history-drafts and --mtp-adaptive-verification/--no-… pairs (cli.rs:980-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 as claimed; tests exist for the flag and settings round-trip.

Cost: the CPU cost is genuinely trivial (one Instant::now() per output token — a vDSO read), so performance is not the objection. The cost is conceptual: one more flag, one more config key, one more object with vLLM's name but not vLLM's meaning, and 6 fields of divergence for docs/api.md to keep true.


Concrete defects

  1. The "no cost when off" claim is false. RequestTiming::new is built unconditionally (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, and trivially fixable, which suggests the claim was never tested.

  2. Any request with stop strings gets an all-null object. When prompt.stop_strings is non-empty the runtime takes the TextStops branch and emits GenerationEvent::Protocol (runtime.rs:446-458, built at runtime.rs:1528-1536), which http.rs:574-576 handles without timing.token(). first_token/last_token therefore stay None and time_to_first_token_ms, generation_time_ms, mean_itl_ms, tokens_per_second, and content-TTFT are all null — the option silently returns a useless object for a very common request shape. No test covers it.

  3. time_to_first_content_token_ms inverts vLLM's semantics. The implementation feeds it latency::stream_text (http.rs:504,663 → latency.rs:116-142), which matches delta.reasoning_content, delta.reasoning, and thinking. vLLM's spec (docs.vllm.ai/en/latest/features/per_request_metrics) says this field excludes reasoning and tool-call output, and exists precisely so a gateway can see "started emitting" (108 ms) separate from "started answering" (268 ms). Here it collapses to TTFT on every thinking model — which is what the charter actually targets (DeepSeek, Qwen3-class, Kimi; docs/api.md:826-841). On the validation run the two values are 473.78 and 473.79 ms: the field carries no information.

  4. n > 1 is not suppressed. vLLM returns metrics: null for n > 1 and for multi-prompt Completions, because one sequence's timing cannot describe the response. docs/api.md:900-901 here says "one object describes the whole response", and because timing.token() fires for every choice's tokens, first/last are the outermost across choices while mean_itl_ms divides the whole span by seen_tokens - 1 (http.rs:171-176) — overstating per-token speed by roughly n×. A wire-compatible field that means something different is worse than no field.

  5. Placement varies, and the description is wrong about it. frames[..done].last_mut() (http.rs:667-670) targets whatever precedes the [DONE] frame, and encode.rs:647-660 orders the usage chunk before [DONE]. So with stream_options.include_usage (vLLM's documented requirement for streaming metrics) the metrics ride the usage chunk — but without it, they ride the finish_reason chunk, where vLLM's documented consumers do not look. PR body says "the chunk that reports finish_reason"; the code does not, once usage is enabled.

  6. Mixed denominators. mean_itl_ms divides by seen_tokens (only tokens delivered as Token events) while tokens_per_second divides committed_tokens — which includes EOS and tokens withheld by text stops (docs/api.md:319). The two rates disagree by exactly the withheld count, and nothing documents it.

  7. Test coverage is thin for the surface. Two helios HTTP tests (phase_tests.rs:4475,4520), one flare settings test, one CLI test. Nothing for Completions, n>1, batched prompts, include_usage streaming, the 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

Both are smaller than adding a second mechanism.


The decisive harm: merging this with #552 breaks the gateway

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, #553'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 precisely the limitation #553's own evidence section describes; merging both guarantees it. Merging the pair is strictly worse for the stated consumer than merging #552 alone.


What I would ask for instead

Close this PR as a separate flag. If maintainers want the vLLM metrics shape at all (legitimate — third-party gateways read it), fold it into whichever single timing mechanism is chosen, sourced from the runtime, and then: drop the flag and the [server] key (or at most reuse one existing switch); make it flagless-or-per-request so nothing doubles; 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; and remove the unconditional Instant::now(). queue_time_ms should then carry 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 wasn't run. The disagreement is about layer and scope, not effort.