71 int n = std::snprintf(
73 "Generated: %d tokens, finish=%s, %.0fms, %.1f tok/s",
74 s.token_count,
s.finish_reason.c_str(),
75 s.generation_time_ms,
s.throughput_tok_s);
76 std::string out(
buf,
n > 0 ?
static_cast<size_t>(
n) : 0
U);
81 if (
s.n_drafted > 0) {
82 const double rate =
static_cast<double>(
s.n_accepted)
83 /
static_cast<double>(
s.n_drafted);
84 n = std::snprintf(
buf,
sizeof(
buf),
85 ", drafted=%d, accepted=%d, accept_rate=%.3f",
86 s.n_drafted,
s.n_accepted,
rate);
87 out.append(
buf,
n > 0 ?
static_cast<size_t>(
n) : 0
U);
Activate model on GPU (WARM → ACTIVE).
@ optional
optional: every escape asks the host's path approver
std::string format_generation_summary(const GenerationSummary &s)
Format the one-line generation summary.
The numbers a finished generation reports, whatever produced it.
int n_drafted
Speculative: tokens proposed (0 = plain).
int token_count
Tokens actually generated.
double throughput_tok_s
token_count / seconds.
int n_accepted
Speculative: tokens accepted.
double generation_time_ms
Wall clock for the generation.
std::string finish_reason
stop / length / error / cancel.