Table of Contents

Method ConvertPeftToGguf

Namespace
LMKit.Finetuning
Assembly
LM-Kit.NET.dll

ConvertPeftToGguf(string, string, string, string)

Converts a PEFT LoRA adapter to a GGUF adapter file.

public static void ConvertPeftToGguf(string safetensorsPath, string adapterConfigJson, string architecture, string outputPath)

Parameters

safetensorsPath string

Path of the adapter's .safetensors file.

adapterConfigJson string

Content of the adapter's adapter_config.json, carrying at least lora_alpha.

architecture string

The BASE model's architecture identifier (for example llama, qwen3, gemma3), stamped into the adapter so the engine can verify it against the model the adapter is applied to.

outputPath string

Destination path of the GGUF adapter.

Exceptions

ArgumentException

An argument is null or empty.

FormatException

The safetensors container is malformed, the configuration carries no lora_alpha, or the adapter targets a module this converter cannot map.

Share