llama_lora_load: Load a LoRA adapter

View source: R/llama.R

llama_lora_loadR Documentation

Load a LoRA adapter

Description

Loads a LoRA (Low-Rank Adaptation) adapter file that can be applied to modify the model's behavior without changing the base weights.

Usage

llama_lora_load(model, path)

Arguments

model

Model handle returned by [llama_load_model]

path

Path to the LoRA adapter file (.gguf or .bin)

Value

An external pointer (class externalptr) wrapping the loaded LoRA (Low-Rank Adaptation) adapter. Pass this handle to llama_lora_apply to activate the adapter.

Examples

## Not run: 
model <- llama_load_model("base-model.gguf")
lora <- llama_lora_load(model, "fine-tuned-adapter.gguf")

ctx <- llama_new_context(model)
llama_lora_apply(ctx, lora, scale = 1.0)

# Now generation uses the LoRA-modified model
result <- llama_generate(ctx, "Hello")

## End(Not run)

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