ion7-core / model.lora

class

ion7.core.LoraHandle

_ptr cdata `llama_adapter_lora*` (auto-freed via ffi.gc).
path string Origin path on disk.
scale number Default blend strength used by `apply_lora`.

Functions

M.load_lora

Load a LoRA adapter from disk.

M.load_lora(self, path, scale)
pathstringPath to the adapter `.gguf` file.
scalenumber?Default scale used by `Model:apply_lora` (1.0).
→ ion7.core.LoraHandle

raises — When the adapter file fails to open.

M.lora_load

Backwards-compatible alias for `load_lora`.

M.lora_load(self, path)

M.apply_lora

Apply a LoRA adapter to a context with the given blend strength. The underlying `llama_set_adapters_lora` takes ARRAYS, so we materialise a 1-element array of pointers and a matching float[] for the scale.

M.apply_lora(self, ctx, adapter, scale)
ctxion7.core.ContextTarget inference context.
adapterion7.core.LoraHandleAdapter from `load_lora`.
scalenumber?Override the adapter's default scale.
→ booleantrue on success.

M.remove_lora

Remove all LoRA adapters from a context. Equivalent to passing an empty array to `llama_set_adapters_lora`.

M.remove_lora(self, ctx)
ctxion7.core.Context
→ booleantrue on success.