You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Log a per-request timing summary for every request, streamed or not #841
Please write a short timing summary to the flm serve log for every request: prompt tokens, generated tokens, prefill and decode durations. Write it whether or not the request streams, and whatever stream_options it sets.
Current behavior
The server log is the only place a tool on the host can watch flm serve's throughput without sitting between the client and the server. Today the timings reach the log only by accident:
Streamed requests (≤ 1.0.6): the log echoes the final ChatCompletionChunk, and its usage holds the timings:
Non-streamed requests (1.0.6): the timings are only in the HTTP response. The log shows the request body, Start prefill..., Prefill chunk 1/1 with 11 tokens, Start generating..., Model RAW Output: and NPU Lock Released!, but no token counts for the output and no durations.
Streamed requests (1.0.10): since usage is sent only when the client sets stream_options: {"include_usage": true} (which matches OpenAI, so it's a good change), I'd expect the echoed final chunk to carry no usage for most clients either. I haven't run 1.0.10 to confirm what it logs.
So from 1.0.10 on, whether the server's own log records a request's speed depends on how the client asked. An operator generally can't change that, for example when the client is an editor, an agent framework or an eval harness.
Proposal
After each request finishes, write one line to the server log built from the usage the server already computes, independent of the API response. For example:
A stable prefix makes it easy to grep and to parse. llama.cpp's server does something similar: its per-request print_timing lines (prompt eval time = …, eval time = …) appear for every request, streamed or not.
A /metrics (Prometheus) or /v1/stats endpoint would also work, but the log line is the smaller change and needs no polling.
Environment
FastFlowLM 1.0.6 (Linux, flm serve), checked against the 1.0.10 release notes
Thanks for the suggestion, @zeddius1983. This is now on main (#898, 64d330a). flm serve writes one line per finished request, streamed or not, whatever stream_options the client sets:
Request done: is the stable prefix to grep. When the prefix cache served part of the prompt it adds (N cached) after the prompt count, and prefill tok/s counts only the uncached tokens.
It covers /v1/chat/completions, /v1/completions, /api/chat and /api/generate, each streamed and non-streamed.
Requests cancelled during prefill and requests that fail with an error don't get the line.
It will ship in the next release. Closing; reopen if the format doesn't fit your tooling.
Activity
feat(server): log a 'Request done:' timing summary for every request (#…
tawei-amd commentedon Oct 30, 2026
Thanks for the suggestion, @zeddius1983. This is now on
main(#898, 64d330a).flm servewrites one line per finished request, streamed or not, whateverstream_optionsthe client sets:Request done:is the stable prefix to grep. When the prefix cache served part of the prompt it adds(N cached)after the prompt count, and prefill tok/s counts only the uncached tokens./v1/chat/completions,/v1/completions,/api/chatand/api/generate, each streamed and non-streamed.It will ship in the next release. Closing; reopen if the format doesn't fit your tooling.