llama_memory_seq_pos_range: Get position range for a sequence

View source: R/llama.R

llama_memory_seq_pos_rangeR Documentation

Get position range for a sequence

Description

Returns the minimum and maximum token positions for a given sequence in the KV cache.

Usage

llama_memory_seq_pos_range(ctx, seq_id)

Arguments

ctx

Context handle returned by [llama_new_context]

seq_id

Sequence ID

Value

A named integer vector with elements min and max.

Examples

## Not run: 
range <- llama_memory_seq_pos_range(ctx, seq_id = 0L)
cat("Positions:", range["min"], "to", range["max"], "\n")

## End(Not run)

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