llama_memory_seq_div: Integer-divide token positions in a sequence

View source: R/llama.R

llama_memory_seq_divR Documentation

Integer-divide token positions in a sequence

Description

Divides all token positions in the range [p0, p1) for the given sequence by d. Use p0 = -1 and p1 = -1 for the full range. Useful for implementing sliding-window context compression.

Usage

llama_memory_seq_div(ctx, seq_id, p0, p1, d)

Arguments

ctx

Context handle returned by [llama_new_context]

seq_id

Sequence ID

p0

Start position (inclusive). Use -1 for beginning.

p1

End position (exclusive). Use -1 for end.

d

Divisor (positive integer)

Value

No return value, called for side effects.


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