Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic_logprob_result Struct Reference

Per-token log-probability result. More...

#include <entropic/entropic.h>

Public Attributes

float * logprobs
 Per-token log-probabilities (N-1 values).
 
int32_t * tokens
 Input tokens echoed back (N values).
 
float perplexity
 exp(-mean(logprobs)) over the sequence.
 
float total_logprob
 Sum of all logprob values.
 
int n_tokens
 Number of input tokens.
 
int n_logprobs
 Number of logprob values (n_tokens - 1).
 

Detailed Description

Per-token log-probability result.

Contains per-token log-probabilities for a sequence evaluated against a loaded model. The logprobs array has (n_tokens - 1) entries: logprobs[i] is the log-probability of tokens[i+1] given tokens[0..i].

The struct itself is caller-owned (stack or heap). The internal logprobs and tokens arrays are engine-allocated and must be freed via entropic_free_logprob_result().

Version
1.9.10

Definition at line 2077 of file entropic.h.

Member Data Documentation

◆ logprobs

float* entropic_logprob_result::logprobs

Per-token log-probabilities (N-1 values).

Engine-allocated.

Definition at line 2078 of file entropic.h.

◆ n_logprobs

int entropic_logprob_result::n_logprobs

Number of logprob values (n_tokens - 1).

Definition at line 2083 of file entropic.h.

◆ n_tokens

int entropic_logprob_result::n_tokens

Number of input tokens.

Definition at line 2082 of file entropic.h.

◆ perplexity

float entropic_logprob_result::perplexity

exp(-mean(logprobs)) over the sequence.

Definition at line 2080 of file entropic.h.

◆ tokens

int32_t* entropic_logprob_result::tokens

Input tokens echoed back (N values).

Engine-allocated.

Definition at line 2079 of file entropic.h.

◆ total_logprob

float entropic_logprob_result::total_logprob

Sum of all logprob values.

Definition at line 2081 of file entropic.h.


The documentation for this struct was generated from the following file: