Repository navigation
Conversation
|
Hi @boxcee, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
boxcee
marked this pull request as ready for review
August 15, 2026 07:23
…#27011) Co-Authored-By: Claude Opus 4.6 <[email protected]>
boxcee
force-pushed
the
feat/context-size-histogram
branch
from
September 27, 2026 09:35
401fc90 to
7aafbd1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a standard Prometheus histogram metric
llamacpp:request_context_tokensto the/metricsendpoint, recording the distribution of context sizes (in tokens) across completed requests. Closes #27011.Changes:
--metrics-ctx-buckets B1,B2,...CLI flag to configure bucket boundaries (default:1024,4096,8192,16384,32768,65536,131072,262144; env:LLAMA_ARG_METRICS_CTX_BUCKETS)server_metricsinserver-common.hserver_task_result_metrics::to_metrics(), labeled withmodel_nameandmodel_alias--metricsis enabled (existing gate)Example output:
Additional information
Test plan (all verified locally on an RTX 3090 with Muse-Glimmer-30B):
/metricsreturns histogram with correct cumulative buckets--metrics-ctx-bucketsoverrides defaults--alias/ model name--metricsis not setRequirements
server_metricsintoserver-common.hand Prometheus formatting intoto_metrics()). All code was manually reviewed and tested before submission.