% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_get_logits}
\alias{llama_get_logits}
\title{Get logits from the last decode step}
\usage{
llama_get_logits(ctx)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context]}
}
\value{
A numeric vector of length \code{n_vocab} containing the logits.
}
\description{
Returns the raw logit vector (unnormalized log-probabilities) from the
last token position after a decode operation.
}
\examples{
\dontrun{
model <- llama_load_model("model.gguf")
ctx <- llama_new_context(model)
result <- llama_generate(ctx, "The capital of France is", max_new_tokens = 1L)
logits <- llama_get_logits(ctx)
# Find top token
top_id <- which.max(logits)
}
}
