Case file: PR #553 — Add vLLM-compatible per-request metrics
Link: https://github.com/NVIDIA/hyperflare-inference/pull/553
Author: WynnD (GitHub association with the repo: NONE; Discord: oystersmiles)
State: open, ready for review (not draft) · head fd5c67e → main · 11 files, +302/−9 · no CI checks, no reviews, no comments, no labels · opened and last updated 2026-11-27 04:52 (no edits since)
Key findings
-
It contradicts its own sibling PR, filed 22 minutes earlier by the same author. #552 (draft, "Closes #551") emits a llama.cpp (not opened)
timingsobject for exactly this problem and argues against the vLLMmetricsobject; #553 emits the vLLMmetricsobject instead, cites no issue, and mentions neither #551 nor #552. #552's argument: "vLLM'smetricsobject was the alternative, but it carries no token counts of its own: llama-swap dividesusageinput minus cached tokens by time to first token, so a stream withoutstream_options.include_usagehas nothing to divide and reads zero." #553 asserts the opposite ("A tree that emits only this PR'smetricsobject gives llama-swap the prompt count fromusage"). Both cannot be the shipped answer in their current form. -
The "free when off" claim is false in code. The description and
docs/api.md:901-902say the cost is "two clock reads per output token while the option is on, and none while it is off". In the diff,RequestTiming::newis called unconditionally (helios/src/server/http.rs:479at pr/553) andtiming.token()is called in both token arms with noper_request_metricsguard (http.rs:562-573), soInstant::now()plus two stores and a counter increment run on every output token whether the option is on or off. It is one clock read per token, not two;content()reads a clock at most once per request, only when enabled and streaming (http.rs:155-157, gated at:502-507,:660-673). -
The documented streaming placement is not the placement produced. Description and
docs/api.md:886-888saymetricsrides "the chunk that reportsfinish_reason". The code puts it on the last frame before thedonesentinel (http.rs:667-671:frames[..done].last_mut()).Encoder::finishpushes the finish_reason chunk, then — whenstream_options.include_usageis set — a usage chunk with"choices":[], thendone(helios/src/server/protocol/encode.rs:636-660). So withinclude_usagethe object lands on the usage chunk, and withn > 1on the last choice's chunk. The testper_request_metrics_ride_the_final_stream_chunkonly greps for"metrics"on somedata:line and does not pin the chunk (phase_tests.rs:4520-4560), and the PR's own live check usedinclude_usageand reported it "on its final chunk". -
Undeclared cross-tool break: the new config key breaks the Ignition/Python CLI.
ignition/cli/config.py:24lists the accepted[server]keys and_validateraisesUsageError: unknown key per_request_metrics in [server]for anything else (config.py:109-111; rejection of unknown server keys is tested attests/cli/test_config.py:151-173). The docs state "Ignition and native Flare read this file" (docs/cli-design.md:1313-1315); #553 touches no Python file. Only the Rust reader tolerates the key (flare/src/configuration.rs:26-34,#[serde(default)], nodeny_unknown_fields). A user who sets the advertised key in the shared~/.config/flare/config.toml(not opened) makes everyignitioncommand fail with a usage error.Configuration.write_initial(config.py:176-204) does not mention the key, and the[server]sample block indocs/cli-design.md:1344-1350was not updated (only the prose at:1319-1320and the flag table at:738). -
The live verification cannot be attributed to this PR, by its own admission. The validation tree also carried an unpublished local
timingsobject, and llama-swap'sbuildMetrics(per #551:internal/server/metrics.go(not opened), v250 @60226b6) reads llama.cpp (not opened) keys —prompt_per_second,predicted_per_second,prompt_n,predicted_n,cache_n,draft_n— none of which #553's object contains. The quoted llama-swap numbers (7.11 prompt tok/s, 221.5 decode tok/s; 7.81 decode tok/s) therefore come from the other object. The paragraph also reports a negative prompt rate, a defect in someone else's unpublished code. -
Under the charter, the justification is the one already rejected in review. vLLM is listed as a competitor in the charter, and the Autobot review of #548 (same author, 2026-11-26 22:00, "Changes Requested") already said "vLLM-parity is a competitor, not an authorization under the charter". #553's framing is entirely vLLM compatibility, and it addresses no maintainer request and no filed issue of its own.
-
"Not run here: … which CI covers" is not a result. There are no checks on head
fd5c67e.
The change: what it does and how big
Opt-in, server-wide flag (--enable-per-request-metrics, or [server] per_request_metrics = true, default off) that makes OpenAI Chat and Completions responses carry a top-level metrics object. The runtime, scheduler and prepared core are untouched; all measurement happens in the HTTP delivery stream.
RequestTiming(helios/src/server/http.rs:122-194at pr/553):started(HTTP admission),first_token,last_token,first_content,seen_tokens,committed_tokens,streaming.token()(:148-153) sets first/last and incrementsseen_tokens; called fromGenerationEvent::Token(:569) andLogprobToken(:563).content()(:155-157) setsfirst_contentonce.committed_tokens += generated_tokensonGenerationEvent::Finished(:614).value()(:164-193) renderstime_to_first_token_ms,time_to_first_content_token_ms(null unless streaming),generation_time_ms(null iflast <= first),queue_time_ms(alwaysValue::Null),mean_itl_ms(null unlessseen_tokens > 1),tokens_per_second.
- Gating:
per_request_metrics = state.per_request_metrics && matches!(protocol, Chat | Completions)(:458-459) — Messages and Responses untouched, as documented. - Insertion: streaming on the last pre-
doneframe (:667-671); non-streaming asresponse["metrics"]before return (:686-688). - Plumbing:
ServerConfig.per_request_metricsdefault false (helios/src/server.rs:133,150), copied intoHttpState(:176,335);Bootstraprejects a non-boolean (helios/src/server/config.rs:357-361);flare/src/configuration.rs:34,136-138;settings.rs:32,159,212;controller.rs:2563(desktop/controller honours it);flare-cli/src/main.rs:355-356ORs flag with config;cli.rs:778adds the flag and:697puts it inrank_zero_options()(rank-zero only;OrbitPush::run_argshardcodes false at:520). - Docs:
docs/api.md:882-902;docs/cli-design.md:738,:1319-1320. - Size by area: helios/src 4 files +230/−8 (http.rs +114/−7, phase_tests.rs +105/−1, server.rs +6, config.rs +5); flare/src 3 files +26 (settings.rs +20, configuration.rs +5, controller.rs +1); flare-cli/src 2 files +22 (cli.rs +20, main.rs +2); docs 2 files +24/−1 (api.md +22, cli-design.md +2/−1).
- Tests: 2 in
phase_tests.rs(+105, plus newhttp_state_with/http_generation_request_withhelpers), 1 inflare/src/settings.rs:284-298, 1 inflare-cli/src/cli.rs:1519-1523.
Description says but change does not do: the "none while off" cost claim (finding 2); the finish_reason-chunk placement under include_usage (finding 3). Change does but description does not say: the key is added to the shared config schema without the Python reader being taught it (finding 4); controller.rs/settings.rs grow a desktop-side setting the description summarises only as "the desktop controller passes it"; orbit run gets the flag but orbit push does not.
The why
The problem statement — /metrics reports server aggregates, not one request's timing, and timing the HTTP round trip mixes queueing and client transfer in — is real and recognisable. The demand signal in-repo is thin and self-generated: the motivating issue #551 ("Report per-request timings on final responses so llama-swap can show prompt and decode rates", opened 2026-11-27 03:26) is by the same author, and the PR that says "Closes #551" is #552, not this one. #553 references no issue, no user report, no maintainer request and no roadmap item; the external motivation is llama-swap (a gateway the charter does not name) and vLLM (listed as a competitor). #551's own detail — llama-swap's buildMetrics key list and the literal -1 it shows when those fields are absent — is the strongest part of the case and is not carried into #553.
Related work
| Item | State | Relation |
|---|---|---|
| #551 | open issue, same author | Motivating issue; proposes llama.cpp (not opened) timings; closed by #552, not by #553 |
| #552 | open draft, same author, 04:30 | Competing implementation of the same feature in llama.cpp (not opened)'s format; +929/−26; stacked on #548; argues the vLLM object is the worse choice. Shares helios/src/server/http.rs, server.rs, docs/api.md with #553 and uses semantically identical slots (usage chunk, last-choice finish chunk, non-streaming body) |
| #548 | open draft, same author, 2026-11-26 20:24 | Closes #536; latency histograms + process metrics; Autobot review "Changes Requested" — the review asserting vLLM parity is not an authorization. #552 is stacked on it; #553 does not depend on it (verified: no shared hunks, metrics.rs (not opened) untouched) |
| #549 | open draft, same author | Closes #537; KV page gauges; no file overlap — #553's independence claim holds |
| #536 | open issue (Napuh) | The aggregate half of the same ambition: scrapeable histograms, explicitly not per-response fields. Closed by #548 |
| #537 | open issue | KV cache usage vLLM semantics, via #549; different metric family |
| #541 | open PR (jere357) | Grafana/Prometheus example consuming /metrics; other layer, no code overlap; its review documents the same metrics-doc gaps and cites #536/#537 |
| 949f180f | merged, Eugene Rakhmatulin, 2026-10-21 | "Match vLLM streaming response timing for client compatibility" — prior art for vLLM-compat timing in this file |
| #170, #176, #317, #333, #418 | merged | Response-shaping precedents in http.rs; background |
| #428, #193, #2, #540, #538, #547, #267, #469, #502, #482, #404, docs co-touchers | — | Matched only on identifier names (time_to_first_token_ms, finish_reason, unwrap_or_else, tokens_per_second); not relevant |
Physical overlap detail: #552's diff is http.rs +12/−1, docs/api.md +45/−3, server.rs +2; it rewrites the same encoders #553 hooks and adds a second docs section on a per-request timing object. If both land, either the objects nest or one is deleted.
Recent activity in the touched areas
helios/src is dominated by Luke Alonso (208 commits / 180 days), then Martin Vit (47), yatesdr (47); flare/src Luke Alonso (60), jasonc (17), Eugene Rakhmatulin (12); flare-cli/src Luke Alonso (11); docs Luke Alonso (367). http.rs was last shaped by 0b09434d (#418), 67cd3e01 (#317), dc0d40e0 (ingress hardening) and 949f180f (vLLM streaming timing). Nothing in the last 60 days in these areas is a metrics/timing feature, so #553 neither builds on nor reverses a recent commit — it is additive onto a file with a history of compatibility work. The nearest live activity is the author's own cluster (#548/#549, which #552 stacks on), and #553 forks away from it rather than building on it.
People
- WynnD — GitHub association NONE; 0 merged, 0 closed, 4 open in the previous 180 days (plus this one). Five artefacts in about 32 hours: #548 (20:24), #549 (20:24), #551 (03:26), #552 (04:30), #553 (04:52). No prior standing; no maintainer response to any of it. Discord
oystersmileson all of them. - Engagement on #553: none. Zero comments, zero reviews, zero labels. Across the cluster the only engagement is the flare-autobot intake/review bot on #548 and #549, both "Changes Requested".
- No priority contributor appears anywhere in the cluster (charter names @voipmonitor, @original-el8, @lukealonso — the areas #553 touches are overwhelmingly Luke Alonso's, and he has not engaged).
- Related contributors in this code: Eugene Rakhmatulin (949f180f), yatesdr (#333/#167/#176), jedi95 (#317), Napuh (#536/#537).
Community
Nothing beyond the above: no reactions, no comments, no reviews, no other item cross-links to #553. Measured interest so far is zero. The desire is argued by the author, not demonstrated by third parties.
Project fit (as facts)
Lines up:
- Charter "PR descriptions: expect four parts" — #553 has why / what changed / claimed result / evidence; the only one of the cluster that does.
- AGENTS.md:230 requires CLI-design and API docs for CLI/API/config changes — both files updated.
- Off by default in all three layers; no runtime or prepared-core change; Messages and Responses untouched.
Strains:
- Charter "Alternatives/Competitors: vLLM, SGLang, TensorRT-LLM, llama.cpp (not opened)" — vLLM is a competitor, and the same justification was already refused in #548's review.
- Charter "What gets merged: … a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs" — #553 cites none; the motivating issue is the same author's and is claimed by #552.
- Charter "smallest footprint in shared code, or a way to solve it without new code at all" — a server-wide flag + config key + CLI flag + desktop setting + ~200 lines for a timing object, when a per-request timing surface already exists (below).
- Charter "Stay focused … not interested in … random switches" — a new operator switch; serving-wide rather than per-model, so not a literal hit of "No per-model special cases or flags".
- Charter vision: "a focused research prototype … not trying to be a general-purpose production server" — gateway billing/SLA observability is production-serving framing.
- Charter supported matrix: verify across every supported model, cache scheme, parallel layout, multi-host and hardware target — verified on one layout (two-GPU DeepSeek-V4.1-Flash with llama-swap in front); Windows and multi-host untested.
Claims and evidence
| Claim | Backing |
|---|---|
| Off by default in helios, flare config and CLI | Code + tests: server.rs:150, config.rs:357-359, configuration.rs:136-138, settings.rs:284-298, cli.rs:1519-1523 — backed |
metrics present when on, absent when off |
phase_tests.rs:4475-4518 — backed |
| Streaming carries it, content-token interval present | phase_tests.rs:4520-4560 — backed, but does not pin the chunk |
| Two clock reads per token on, none off | Contradicted by the code (http.rs:479,563,569,148-157) |
metrics rides the finish_reason chunk |
True only without include_usage and with n == 1 (encode.rs:636-660, http.rs:667-671) |
| Admission-based intervals, null rules, prefill-inclusive throughput | Backed: AdmittedAt inserted in middleware (server.rs:826), value() at :164-193 |
mean_itl_ms = generation time / output tokens after the first |
Backed for plain token streams only: seen_tokens counts Token/LogprobToken events; stop-string text arrives as GenerationEvent::Protocol (runtime.rs:446-459) and does not advance token(), and seen_tokens sums across choices, so stop-string and n > 1 requests report intervals the docs do not imply |
"325 tests, one failure" for server:: |
Plausible, unverifiable here; the named failure (messages_image_hints_end_after_expansion_…) is documented in #548/#552 as needing FLARE_TEST_TEMPLATE_DIR |
| "Not run here: Windows, full suites, which CI covers" | No checks exist on fd5c67e — an expectation, not evidence |
| llama-swap live numbers | Not attributable: the same tree carried an unpublished local timings object, which is what llama-swap reads. The rows' internal arithmetic checks out (16 tokens ↔ 3.20 tok/s over ~4.99 s; 1920.16/128.01 ≈ 15 intervals = 16 tokens), but the 10× ttft spread (4925 ms vs 473 ms) is unexplained — presumably prefix cache, not stated |
Agreement with the local object (ttft == prompt_ms, mean_itl == predicted_per_token_ms) |
A consistency check between two numbers on one tree, not evidence a vLLM consumer reads #553 |
| Independence from #548/#549 | Verified for those two; nothing is said about #552, which is the real conflict |
Coverage gaps: no test for n > 1, none for stop strings, none for the Completions protocol (despite being in scope), none asserting Messages/Responses stay clean, none pinning stream placement under include_usage.
Reach
- Users/operators: anyone running
flare runor the desktop controller who turns the flag on. Wire format changes only for Chat/Completions and only when enabled. Adding the key to a shared config file breaks the Python/ignition CLI (finding 4) — config-file users, not flag users. - Configuration/defaults: new
[server]key, default off; missing from the[server]sample block (docs/cli-design.md:1344-1350) and fromConfiguration.write_initial. - Compatibility: OpenAI Chat/Completions only; Messages and Responses unchanged; the object is a non-standard top-level key, so strict clients see it only when opted in.
- Existing alternative surface the PR does not mention:
return_token_ids+return_token_timestampsalready addperformance: {ingress_ns, enqueue_ns, reused_prompt_tokens}per response (helios/src/server/observation.rs:56-75;enqueue_nsstamped atruntime.rs:920-922), documented indocs/api.md. That request-level opt-in already exposes the enqueue instant — the boundary #553 says the HTTP layer lacks — so a non-nullqueue_time_msis reachable without this PR.stream_options.continuous_usage_statsis already documented (docs/api.md:874-880), andprompt_tokens_details.cached_tokensis already vLLM-equivalent by default (docs/api.md:849-852): vLLM-compatible request-field opt-ins are the existing house pattern, not server-wide flags. - Dependencies/deployment: none added; rank-zero-only flag propagation;
orbit pushexcluded.
Process
Ready for review rather than draft (the only non-draft of the author's four), opened and last touched in the same minute, no edits since. No CI checks on the head commit, no reviews, no labels, no maintainer sign-off, no design-review trailer. Under a day old at case-file time; the whole cluster was created within ~32 hours.
Open questions and what could not be found
- Whether llama-swap populates its prompt/decode columns from a vLLM
metricsobject at all — #551's reading ofbuildMetricssays it reads llama.cpp (not opened) key names; llama-swap's source is not in this repo, so this stays unresolved. - Why a server-wide flag rather than extending the existing
performance/token-timestamp surface: the description discusses no alternatives and no design discussion exists. - What
n > 1plus stop strings actually reports: untested, andmean_itl_ms/generation_time_msare computed from a different denominator (seen_tokens) thantokens_per_second(committed_tokens). - Whether the Ignition-side rejection of the new key is intended (a
flare run-only setting) — nothing states it, while the docs say both tools read the file. - No maintainer or community position on this PR exists yet; there is nothing to report for review state beyond its absence.