llama_memory_seq_cp: Copy a sequence in the KV cache

View source: R/llama.R

llama_memory_seq_cpR Documentation

Copy a sequence in the KV cache

Description

Copies cached tokens from one sequence to another in the position range [p0, p1).

Usage

llama_memory_seq_cp(ctx, seq_id_src, seq_id_dst, p0 = -1L, p1 = -1L)

Arguments

ctx

Context handle returned by [llama_new_context]

seq_id_src

Source sequence ID

seq_id_dst

Destination sequence ID

p0

Start position (inclusive, -1 for beginning)

p1

End position (exclusive, -1 for end)

Value

No return value, called for side effects.

Examples

## Not run: 
# Copy sequence 0 to sequence 1
llama_memory_seq_cp(ctx, seq_id_src = 0L, seq_id_dst = 1L,
                    p0 = -1L, p1 = -1L)

## End(Not run)

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