#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.