// guide

How to fine-tune an LLM with LlamaFactory

To fine-tune an LLM with LlamaFactory, pick a base model, a dataset and a method such as LoRA, QLoRA or full fine-tuning in its LlamaBoard web UI; on NVIDIA Brev, the LlamaFactory (LlamaBoard) Launchable runs LlamaFactory with Qwen/Qwen3-8B as the default base model on one NVIDIA L40S 48GB GPU.

Updated

On this page

What does the LlamaFactory Launchable run?

It runs LlamaFactory v0.9.5 with its LlamaBoard web UI from the official hiyouga/llamafactory:0.9.5 container image, pinned by digest. A Launchable is a reproducible, shareable environment configuration on NVIDIA Brev: GPU, disk, container setup and ports in one link (NVIDIA Brev Launchables (external site)).

SettingDefault
GPU1x NVIDIA L40S 48GB
Instance typeAWS g6e.xlarge
Disk256 GiB
Priceabout $2.23/hr (Brev console, 2026-11-15)
Base modelQwen/Qwen3-8B
LlamaBoard port7860
LicencesLlamaFactory Apache-2.0; Qwen/Qwen3-8B Apache-2.0

The README of the LlamaFactory (LlamaBoard) Launchable also lists Qwen/Qwen3-4B-Instruct-2507 and meta-llama/Llama-3.1-8B-Instruct as base model options, and you can set any Hugging Face model path in LlamaBoard. Each model keeps its own licence. For other training stacks, see fine-tuning.

LoRA vs QLoRA vs full fine-tuning: which should I pick?

Pick LoRA or QLoRA when you want to train small adapters on a frozen base model; pick full fine-tuning when you need to update every weight. LlamaFactory supports full-tuning, freeze-tuning, LoRA and QLoRA, among other methods (LlamaFactory README (external site)).

MethodWhat it trainsSource
LoRAFreezes the pre-trained weights and trains small low-rank matrices injected into each Transformer layerLoRA paper (external site)
QLoRABackpropagates through a frozen, quantized base model into LoRA adapters, to use less GPU memory than LoRA on full-precision weightsQLoRA paper (external site)
Full fine-tuningUpdates all model weights; it needs far more GPU memory than LoRA or QLoRALaunchable README (external site)

A LoRA or QLoRA run produces an adapter that you can merge into the base model at export. For LoRA on image models instead of LLMs, read train a FLUX LoRA on a cloud GPU.

How do I run a first fine-tune in LlamaBoard?

Open LlamaBoard, set the model path, pick a method and a bundled dataset, and start training. These steps follow the Launchable README:

  1. Open the LlamaBoard link, or forward the port with brev port-forward INSTANCE_NAME --port 7860:7860.

  2. Wait for the base model download; its log is /root/workspace/llamafactory/logs/model-fetch.log.

  3. Set the model path and select a fine-tuning method, for example LoRA.

  4. Choose a dataset; bundled examples such as identity work without uploads.

  5. Start training.

  6. Chat with the result in LlamaBoard, then export the trained model.

Datasets, checkpoints, downloaded models, the Hugging Face cache and the LlamaBoard settings live under /root/workspace/llamafactory/.

How do I serve the result?

Export the model, then serve it through an OpenAI-compatible API. The LlamaFactory README gives the commands (LlamaFactory README (external site)):

  1. Merge a LoRA adapter into the base model with LlamaBoard's export step, or with llamafactory-cli export examples/merge_lora/qwen3_lora_sft.yaml.

  2. Serve it with the vLLM backend: API_PORT=8000 llamafactory-cli api examples/inference/qwen3.yaml infer_backend=vllm vllm_enforce_eager=true.

  3. Or load the exported model into your own vLLM server, as in serve an OpenAI-compatible API with vLLM.

The Launchable exposes LlamaBoard on port 7860; check which other ports you open before you serve an API from the instance.

How do I deploy it on NVIDIA Brev?

Deploy it from its Launchable page and open LlamaBoard on port 7860. The full flow is in how to deploy a Launchable on NVIDIA Brev.

  1. Open the LlamaFactory (LlamaBoard) page and click its launch button.

  2. Deploy and wait for the instance to show Running.

  3. Open LlamaBoard on port 7860, or forward the port with the brev CLI.

  4. Wait for the base model download before you start training.

What happens when I stop or delete the instance?

Stop keeps your files; Delete removes them. Read how to stop, start and delete an NVIDIA Brev instance for the console and CLI steps.

  • Stop the instance when you are not training. Datasets, checkpoints and exports are written under /root/workspace/llamafactory/ inside the container; Delete removes them. Copy exports off the instance before you stop or delete it.
  • Storage is still billed while the instance is stopped.
  • Delete removes the instance and every file on it, including datasets, checkpoints and exported models.

How does this relate to NightKeeper?

This Launchable is a finished environment you deploy yourself. NightKeeper is a separate 9owls product for your own code: it packages your repository as an NVIDIA Brev Launchable, proves it on a fresh GPU and keeps it running.

Sources: where do these facts come from?

All guides