llama_vocab_get_score: Get the score of a token

View source: R/llama.R

llama_vocab_get_scoreR Documentation

Get the score of a token

Description

Returns the log-probability score stored in the vocabulary (used by SPM/UGM tokenizers).

Usage

llama_vocab_get_score(model, token)

Arguments

model

Model handle returned by [llama_load_model]

token

Integer token ID (0-based)

Value

A numeric scalar.


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