llama_state_save: Save context state to file

View source: R/llama.R

llama_state_saveR Documentation

Save context state to file

Description

Saves the full context state (including KV cache) to a binary file. This allows resuming generation later from the exact same state.

Usage

llama_state_save(ctx, path)

Arguments

ctx

Context handle returned by [llama_new_context]

path

File path to save state to

Value

A logical scalar: TRUE on success (errors on failure).

Examples

## Not run: 
llama_state_save(ctx, "state.bin")

## End(Not run)

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