#1 [high] PR 553 core: HTTP-layer RequestTiming, flag plumbing
PR #553 (WynnD): --enable-per-request-metrics / [server] per_request_metrics adds a vLLM-shaped metrics object to OpenAI Chat+Completions responses.
- helios/src/server/http.rs:122-194
RequestTiming(started=HTTP admission, first/last token Instant, first_content, seen_tokens, committed_tokens, streaming); value() emits time_to_first_token_ms, time_to_first_content_token_ms, generation_time_ms, queue_time_ms (always null), mean_itl_ms, tokens_per_second. - http.rs:479 always constructs it; http.rs:562-573 calls
timing.token()(Instant::now) on every Token/LogprobToken UNCONDITIONALLY, even with the option off — contradicts PR text "none while it is off" and docs/api.md:901-903. - http.rs:660-672 stream: metrics written into
frames[..done].last_mut(); http.rs:686-688 non-stream top level. Guardstate.per_request_metrics && matches!(protocol, Chat|Completions)(http.rs:458). - Plumbing: helios/src/server.rs (+ServerConfig/HttpState field), helios/src/server/config.rs:354-360 (Bootstrap rejects non-bool), flare/src/settings.rs, flare/src/configuration.rs:31-34,136-138, flare/src/controller.rs:2563, flare-cli/src/cli.rs (Run+OrbitRun+OrbitPush), flare-cli/src/main.rs:355. 11 files.
- Tests: 2 helios tests (phase_tests.rs:4475, 4520), 1 flare settings test, 1 CLI flag test. No test for Completions, n>1, no-include_usage streams, Messages/Responses absence, echo, or the off-state cost.
#2 [high] Duplication: #552/#548 runtime-sourced timings; llama-swap precedence makes metrics override timings
- Issue #551 (WynnD): llama-swap shows prompt/decode rates as -1 for Flare; asks for llama.cpp
timingson all four protocols. - PR #552 (open, draft, same author, stacked on #548): emits llama.cpp-shaped
timingsfrom runtime instants (RequestTimes: first scheduled step, first/last committed token) + DraftCounts; covers Chat, Completions, Messages, Responses, streaming and not. Correct scheduler boundary. - PR #548 (open): request latency histograms + process metrics (closes #536).
- llama-swap v250 internal/server/metrics.go buildMetrics (fetched):
timingssets inputTokens=prompt_n, outputTokens=predicted_n, promptPerSecond=prompt_per_second, tokensPerSecond=predicted_per_second; THENmetrics.time_to_first_token_msrecomputes promptPerSecond=(inputTokens-cached)/TTFT andmetrics.mean_itl_msoverwrites tokensPerSecond=1000/mean_itl. So if both objects are present, #553's HTTP-layer numbers WIN over #552's accurate ones — and prompt rate goes negative on fully cached rows (exactly the limitation #553's own description admits). - Consequence: merging both is worse than merging #552 alone for the stated consumer.
#3 [high] Concrete defects in PR 553
- Unconditional clock read with the option off: http.rs:562-573 calls
timing.token()on every Token/LogprobToken outside anyper_request_metricscheck, andRequestTiming::newis built unconditionally at http.rs:479. PR body and docs/api.md:900-903 claim "disabling it reads no clock for timing"/"none while it is off" — false. - String-stop requests get an all-null object: runtime emits GenerationEvent::Protocol (runtime.rs:446-458, when prompt.stop_strings is non-empty) instead of Token/LogprobToken, and http.rs:574 handles Protocol without timing.token(). So first_token/last_token never set → time_to_first_token_ms, generation_time_ms, mean_itl_ms, tokens_per_second, content all null for any request with
stopstrings. No test covers it; silently returns a useless object. - time_to_first_content_token_ms includes reasoning text: implementation uses latency::stream_text (http.rs:504,663 → latency.rs:116-142, matches
reasoning_content/reasoning/thinking). vLLM's spec (docs.vllm.ai/en/latest/features/per_request_metrics) says this field excludes reasoning and tool-call output. Opposite semantics on the models Flare targets (thinking models). - n>1 and Completions multi-prompt: vLLM suppresses the metrics object (null) for n>1 and for multiple prompts because one sequence's timings cannot describe the response. PR emits one object over all choices (docs/api.md:900-901), and since timing.token() fires for every choice's tokens, first/last are the outermost across choices and mean_itl divides the whole span by sum(seen)-1, overstating per-token speed ~n×.
- Placement differs from vLLM when include_usage is set: metrics lands on the usage chunk (frames[..done].last_mut(), http.rs:667-670, encoder orders usage chunk before [DONE], encode.rs:647-660) although PR text says the finish_reason chunk; vLLM documents metrics on the final usage chunk, so with include_usage=false (default) a vLLM-shaped consumer finds no metrics anywhere.
- Mixed denominators: mean_itl uses seen_tokens (tokens actually delivered as Token events) while tokens_per_second uses committed_tokens (includes tokens withheld by text stops and EOS, docs/api.md:319), so the two disagree by the withheld count.
- Test coverage: only 2 helios HTTP tests (phase_tests.rs:4475, 4520), 1 flare settings test, 1 CLI test. No coverage for Completions, n>1, batched prompts, include_usage streaming, Messages/Responses absence, string stops, max_tokens 0, or the off-state clock-read claim.
#4 [high] Charter-based assessment of PR 553
- Charter "Solve the right problem in the right place": HTTP layer has no scheduler boundary, so queue_time_ms is permanently null and TTFT includes HTTP wait + queue + prefill. The runtime already holds the right instants (runtime.rs:899 arrival_ns, :920 enqueue_ns; #548 adds RequestTimes first-scheduled/first-committed/last-committed token).
- Charter "What gets merged": needs maintainer request, roadmap item, reproducible bug, measured perf/memory issue, or docs. #553 has none: #536 (the observability ask) is closed by #548; #551 is the same author's own gap report; vLLM parity is a competitor, not authorization (same point was made in the #548 autobot review).
- Charter "Stay focused / not interested in piling on random switches": adds a second full config-key+flag triplet (Run, OrbitRun, OrbitPush) for a second, parallel timing mechanism beside latency.rs FirstResponse and #548's RequestTimes.
- Cost: 11 files, ~290 net lines, 6 fields of which queue_time_ms is always null; performance cost is genuinely tiny (one Instant::now per output token) but the claim that it is zero when off is false.
- Benefit: narrow — llama-swap/gateway users only. Flare is a focused local research prototype; per-request billing/SLA is not a charter use case. The consumer (#551) is served better by #552.
- Honest pluses: off by default; wire format unchanged when off; Bootstrap rejects non-boolean; docs updated in both files; independent of #548/#549 so it can land alone.
#6 [high] Re-run of PR 553 (no new commits) — verdict unchanged
Re-ran the assessment on PR 553 with no new commits since the last review (last comment: autobot "Review Stopped — low value / charter misalignment", 2026-11-27 05:17). Verdict unchanged: not worth it as a separate flag; redirect the vLLM shape into runtime-sourced timings (#552).
Re-verified at head d6d7c7f9:
- http.rs:479 RequestTiming::new unconditional; http.rs:562-573 timing.token() unconditional → docs/api.md:903 "disabling it reads no clock for timing" and PR body "none while it is off" are false.
- runtime.rs:446-458 emit_output TextStops branch emits GenerationEvent::Protocol; runtime.rs:1961-1971 finish() also Protocol; http.rs:574-576 handles Protocol without timing.token() → any request with
stopstrings yields an all-null metrics object. - latency.rs:116-142 stream_text matches delta.reasoning_content/reasoning/thinking → time_to_first_content_token_ms includes reasoning, opposite of vLLM (docs.vllm.ai/en/latest/features/per_request_metrics: "excluding reasoning and tool-call output"; reasoning example 108.2 vs 268.2 ms).
- decode.rs:742-755: n>1 only reachable on Completions; vLLM suppresses metrics for n>1 and multi-prompt; PR emits one object (docs/api.md:900-901) and mean_itl divides span by seen_tokens-1 across choices.
- encode.rs:647-660: usage chunk pushed before the done frame → frames[..done].last_mut() (http.rs:667) targets the usage chunk when include_usage, otherwise the finish_reason chunk; vLLM documents the final usage chunk only (requires stream_options.include_usage).
- flare-cli/src/cli.rs:624-626: single-polarity
--enable-per-request-metrics; no--no-…pair, unlike cli.rs:974-1021 history_drafts / mtp_adaptive_verification. main.rs:355-356 ORs CLI and config. - llama-swap v250 internal/server/metrics.go buildMetrics (fetched raw): timings sets promptPerSecond/predicted_per_second; then metrics.time_to_first_token_ms recomputes promptPerSecond=(inputTokens-cached)/TTFT and metrics.mean_itl_ms overwrites tokensPerSecond=1000/mean_itl. #552's prompt_n is already prompt-minus-cache → double subtraction → negative prompt rate. Merging both is worse than #552 alone.
- Existing shipped alternative: observation.rs:56-75
performance{ingress_ns,enqueue_ns}+ token_timestamps_ns via return_token_ids/return_token_timestamps; client can compute all six fields including queue time. No maintainer request: #536 closed by #548; #551 is the author's own; vLLM parity is competitor, not authorization.
#7 [high] Final verdict PR 553 (second run)
Final verdict for this second run: Not worth merging as a standalone flag. Reasons: wrong layer (queue_time_ms structurally null, tokens_per_second folds HTTP wait+queue+prefill), fails charter "right problem, right place" and "stay focused / no random switches" (third enable-* flag + [server] key through Run/OrbitRun/OrbitPush, single polarity only), no authorization under "What gets merged" (#536 closed by #548, #551 is the author's own issue, vLLM parity is competitor parity — docs/core-design.md:210-219 "Flare does not aim for vLLM's feature matrix"), duplicates shipped observation path (return_token_ids/return_token_timestamps → performance{ingress_ns,enqueue_ns} + token_timestamps_ns) and the runtime-sourced #552, inverts vLLM's time_to_first_content_token_ms so it collapses to TTFT on thinking models (the charter's target models), yields an all-null object for any request with stop strings, claims no cost when off but reads a clock unconditionally, and merging with #552 makes llama-swap's prompt rate negative.
Recommendation: close, fold the vLLM metrics shape into a single runtime-sourced timing mechanism (or into #552) if maintainers want the third-party gateway compatibility; queue_time_ms should then be admission→first scheduled step. Plus sides acknowledged: off by default, wire unchanged when off, Bootstrap rejects non-boolean, both docs updated, four-part description with evidence and stated limitation.