llama_n_ctx: Get context window size

View source: R/llama.R

llama_n_ctxR Documentation

Get context window size

Description

Get context window size

Usage

llama_n_ctx(ctx)

Arguments

ctx

Context handle returned by [llama_new_context]

Value

An integer scalar: the context window size (number of tokens).

Examples

## Not run: 
model <- llama_load_model("model.gguf")
ctx <- llama_new_context(model, n_ctx = 4096L)
llama_n_ctx(ctx)  # 4096

## End(Not run)

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