llama_get_logits_ith: Get logits for a specific token position

View source: R/llama.R

llama_get_logits_ithR Documentation

Get logits for a specific token position

Description

Returns the logit vector for token at index i in the last decoded batch. Use i = -1 to get the logits for the last token.

Usage

llama_get_logits_ith(ctx, i)

Arguments

ctx

Context handle returned by [llama_new_context]

i

Integer index into the last batch (0-based). Use -1 for the last token.

Value

A numeric vector of length n_vocab.


llamaR documentation built on May 28, 2026, 1:06 a.m.