176 rec.token_count =
r.token_count;
177 rec.prefill_tokens =
r.prefill_tokens;
178 rec.throughput_tok_s =
r.throughput_tok_s;
179 rec.n_drafted =
r.n_drafted;
180 rec.n_accepted =
r.n_accepted;
181 rec.grammar =
r.grammar;
Error types for cross-.so error reporting.
entropic_error_t
Error codes returned by all C API functions.
Activate model on GPU (WARM → ACTIVE).
@ optional
optional: every escape asks the host's path approver
GenerationRecord make_generation_record(const GenerationResult &r)
Project a result down to the record kept for metrics.
One generation's metrics, without its text (gh#154).
double throughput_tok_s
Measured decode throughput.
int n_drafted
Speculative/MTP tokens proposed.
std::string finish_reason
"stop", "length", "error"
GrammarProvenance grammar
What constrained the decode.
int n_accepted
Of those, accepted by the target.
int token_count
Tokens generated.
int prefill_tokens
Prompt tokens actually decoded (gh#144)
Result of a single generation call.
bool time_limited
true if generation was terminated by time limit rather than EOS/stop sequence/max_tokens.
entropic_error_t error_code
Error code (ENTROPIC_OK if no error)
double swap_ms
Model swap time.
double routing_ms
Router classification time.
bool ok() const
True if generation completed without error.
double generation_time_ms
Wall-clock generation time.
int n_drafted
Tokens proposed by the draft/MTP head across all rounds.
int seq_id
Sequence identifier for multi-sequence backends.
double throughput_tok_s
Measured throughput for this generation (tok/s).
std::string raw_content
Raw model output before adapter processing.
std::string finish_reason
Finish reason: "stop", "length", "error".
int original_max_tokens
Original max_tokens before auto-adaptation reduced it.
std::string content
Generated text (cleaned by adapter)
int prefill_tokens
Prompt tokens actually pushed through llama_decode during this run's prefill (gh#144,...
std::vector< ToolCall > tool_calls
Tool calls parsed from content.
int n_accepted
Draft tokens the target accepted (≤ n_drafted).
std::string error_message
Error description (empty if no error)
int token_count
Generated token count.
GrammarProvenance grammar
What constrained this decode and who asked for it.
double total_ms
Total end-to-end time.
What constrained one decode, and what asked for it (gh#154).
std::string key
Registry key / frontmatter stem that was named ("" = none).
std::string source
"request" | "tier" | "tool_call" | "none".
bool resolved
true when a grammar text actually constrained this decode.
std::string conflict_winner
The winning source when two grammars collided ("" = no collision).