How to merge fine-tuned LLaMA-3.1-8B (via LLaMA-Factory) into a single GGUF for LM Studio?

Hi everyone!

I successfully fine-tuned the meta-llama/Llama-3.1-8B-Instruct model using the dataset G-reen/TheatreLM-v2.1-Characters.
The training was done using LLaMA-Factory, since that was the only method that worked for me.

The training itself went fine. But now I’m stuck with a problem.

:red_question_mark: I don’t understand how to merge the base model and the fine-tuned files into a single .gguf file so I can use it in LM Studio.

Here’s how my files are organized:

  • :white_check_mark: Fine-tuned files (LoRA output):
    D:\IA\LLaMA-Factory\saves\Llama-3.1-8B\lora\train_2025-05-24-18-39-59

  • :package: Base model:
    D:\IA\LLaMA-Factory\models\Llama-3.1-8B

I’ve tried different ways but nothing worked so far.
If anyone can explain how to properly combine these into a .gguf file — I would really appreciate the help!

Thanks in advance!

1 Like

Maybe similar case?