llama_vocab_get_text: Get the text representation of a token

View source: R/llama.R

llama_vocab_get_textR Documentation

Get the text representation of a token

Description

Returns the raw text string stored in the vocabulary for a given token ID. Unlike [llama_token_to_piece], this does not apply any special rendering — it returns exactly what is stored in the GGUF vocabulary table.

Usage

llama_vocab_get_text(model, token)

Arguments

model

Model handle returned by [llama_load_model]

token

Integer token ID (0-based)

Value

A character string, or 'NULL' if the token has no text entry.


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