llama_state_get_size: Get the size of the serialized context state in bytes

View source: R/llama.R

llama_state_get_sizeR Documentation

Get the size of the serialized context state in bytes

Description

Returns the number of bytes required to serialize the current context state (KV cache + sampling state). Use before allocating a buffer for raw state I/O.

Usage

llama_state_get_size(ctx)

Arguments

ctx

Context handle returned by [llama_new_context]

Value

A numeric scalar (size in bytes).


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