inference/research
verifiedhigh · 0.94updated 2026-10-04

TGI per-request mean-time-per-token histogram

text-generation-inference · histogram

Fields

id
metric-exposures/w3m-text-generation-inference-tgi-request-mean-time-per-token-duration
Metric name
tgi_request_mean_time_per_token_duration
Metric type
histogram
Unit
seconds
Exposure
prometheus
Endpoint
:9000/metrics
Histogram buckets
0.00010.000150.0002250.00033750.000506250.000759380.001139060.001708590.002562890.003844340.00576650.008649760.012974630.019461950.029192930.043789390.065684080.098526130.147789190.221683780.332525670.498788510.748182761.122274151.683411222.525116833.787675245.681512878.522269312.7834039519.1751059228.7626588843.1439883364.7159824997.07397374
Enabled by default
yes
Phase scoped
yes
notes
TGI main, router/src/server.rs plus backends/v3/src/{backend,queue,lib}.rs, read 2026-10-04. On by default: the Prometheus recorder is built unconditionally with PrometheusBuilder and an HTTP listener on prometheus_port, default 9000, so nothing has to be opted into. Label keys are method (prefill|decode) on the batch families, err on tgi_request_failure, and reason on tgi_batch_concat - there are no model or engine labels, so every series is fleet-wide. This is TGI's TPOT, and its denominator is the trap: the router computes time_per_token = inference_time / generated_tokens, so it INCLUDES prefill and is not comparable to vLLM's vllm:request_time_per_output_token_seconds or SGLang's sglang:request_time_per_output_token_seconds. Buckets are the shared 35-step geometric ladder because the matcher is Matcher::Suffix("duration") - in seconds, starting at 0.00015.

Notes

TGI main, router/src/server.rs plus backends/v3/src/{backend,queue,lib}.rs, read 2026-10-04. On by default: the Prometheus recorder is built unconditionally with PrometheusBuilder and an HTTP listener on prometheus_port, default 9000, so nothing has to be opted into. Label keys are method (prefill|decode) on the batch families, err on tgi_request_failure, and reason on tgi_batch_concat - there are no model or engine labels, so every series is fleet-wide. This is TGI's TPOT, and its denominator is the trap: the router computes time_per_token = inference_time / generated_tokens, so it INCLUDES prefill and is not comparable to vLLM's vllm:request_time_per_output_token_seconds or SGLang's sglang:request_time_per_output_token_seconds. Buckets are the shared 35-step geometric ladder because the matcher is Matcher::Suffix("duration") - in seconds, starting at 0.00015.

Cross-references