Get per-token log probabilities from LLM responses.You can retrieve the log probability of each generated token. This is useful for uncertainty estimation, token-level filtering, confidence scoring, or building custom sampling logic. Log probabilities are supported across all request modes:
- OpenAI-compatible API — using
logprobsandtop_logprobsparameters - WhollyAPI Native API — streaming and non-streaming
OpenAI-compatible API
Setlogprobs: true in your request. Optionally set top_logprobs (1–20) to also get the top alternative tokens at each position.
WhollyAPI Native API (streaming)
The native streaming API returns log probabilities inline with each token as it is generated.logprob field is the log probability of the generated token (base e).