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
safetensorsPathstringPath of the adapter's
.safetensorsfile.adapterConfigJsonstringContent of the adapter's
adapter_config.json, carrying at leastlora_alpha.architecturestringThe 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.outputPathstringDestination 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.