Skip to main content

Usage & Performance Metrics

When completions finish, GoingMerry includes statistics in the final JSON chunk. These parameters allow you to monitor local system load and calculate inference performance.


1. Metrics Fields Reference

The final JSON response includes:

ParameterUnitDescription
total_durationnanosecondsTotal wall-clock duration of the request.
load_durationnanosecondsTime spent loading model weights into memory.
prompt_eval_countcountNumber of tokens in the prompt.
prompt_eval_durationnanosecondsTime spent evaluating the prompt.
eval_countcountNumber of tokens in the generated response.
eval_durationnanosecondsTime spent generating output tokens.

2. Calculating Tokens Per Second (tok/s)

Tokens per second = (eval_count / eval_duration) * 10^9

Python Example

import json

# Final chunk data
data = {
"eval_count": 250,
"eval_duration": 5000000000 # 5 seconds
}

tokens_per_second = data["eval_count"] / (data["eval_duration"] * 1e-9)
print(f"Velocity: {tokens_per_second:.2f} tok/s") # Output: 50.00 tok/s