llama.cpp per-position accepted-token counter
Fields
metric-exposures/w3m-llama-cpp-llamacpp-spec-decode-num-accepted-tokens-per-pos-totalNotes
llama.cpp master, server_task_result_metrics::to_metrics() in tools/server/server-task.cpp, read 2026-10-04. Off by default: '--metrics enable prometheus compatible metrics endpoint (default: disabled)' (env LLAMA_ARG_ENDPOINT_METRICS), and 'This endpoint is only accessible if --metrics is set'. The body is assembled by string concatenation with no Prometheus client library, so there are NO labels at all and no multiprocess mode - every series is a bare name-plus-value line. In router mode /metrics requires ?model={model_id} or returns HTTP 400. CONDITIONAL: emitted only when metrics.n_accepted_per_pos is non-empty, i.e. only after speculative decoding has actually run, so its absence from a fresh /metrics scrape is expected rather than a broken endpoint. Hand-written into the exposition text outside the two tables, and typed counter explicitly.