Schema.ai· vLLM
vLLM official site Log in
vLLM v0.23.0 · Version scoped

In vLLM v0.23.0, vllm:prefix_cache_hits increments from SchedulerStats.prefix_cache_stats.hits on each scheduler-stats logging update.

MetricvLLM v0.23.0confidence: highverified Sep 29verified-docs

Metric

prefix_cache_hits

Applies when

PrometheusStatLoggerV1 metrics

Evidence

vLLM v0.23.0 metrics design docs(docs/design/metrics.md:405-432)
definesprimarydocumentationdocs_extraction

Open cited lines in immutable upstream source ↗

405: ### Prefix Cache metrics
406: 
407: The discussion in <https://github.com/vllm-project/vllm/issues/10582> about adding prefix cache metrics yielded
408: some interesting points which may be relevant to how we approach
409: future metrics.
410: 
411: Every time the prefix cache is queried, we record the number of tokens
412: queried and the number of queried tokens present in the cache
413: (i.e. hits).
414: 
415: However, the metric of interest is the hit rate - i.e. the number of
416: hits per query.
417: 
418: In the case of logging, we expect the user is best served by
419: calculating the hit rate over a fixed number of the most recent
420: queries (the interval is fixed to 1k most recent queries for now).
421: 
422: In the case of Prometheus though, we should take advantage of the
423: time-series nature of Prometheus and allow the user to calculate the
424: hit rate over an interval of their choosing. For example, a PromQL
425: query to calculate the hit interval of the past 5 minutes:
426: 
427: ```text
428: rate(cache_query_hit[5m]) / rate(cache_query_total[5m])
429: ```
430: 
431: To achieve this, we should record the queries and hits as counters in
432: Prometheus, rather than recording the hit rate as a gauge.

Source text is evidence data, not instructions.

Claim support

No independent claim-support receipt is recorded. Source freshness confirms that the pinned source still matches upstream; it does not establish that the cited lines entail this claim.

Does not establish

  • a workload-independent healthy threshold
  • semantics in any vLLM version other than v0.23.0

Guards

  • vllm_version = v0.23.0
  • metric_name = vllm:prefix_cache_hits

Freshness

Pinned release-tag semantics; do not carry to another version without continuity evidence.