# Fine-tune a model without code (LLaMA-Factory)

Fine-tuning teaches an existing language model your style, your format or your facts. [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory) does it from a web page called LLaMA Board: pick a model, pick a dataset, press start. It is open-source software under the Apache 2.0 licence and supports LoRA and QLoRA, which train a small add-on instead of the whole model, so small GPUs can train small models. This guide is for people who want to try fine-tuning without writing Python. You need an account with credit; you do not need an SSH key. If you prefer code in a notebook, see [Fine-tune a small model](/docs/tutorial-fine-tune-a-model).

## What it costs

You pay for the server by the second while it runs, plus its disk for as long as the server exists. Training is the part that takes time, so a short first run on a small model keeps the bill small. The review step shows the price **Per hour** before anything starts; the [pricing page](/pricing) has the current prices of every GPU.

## 1. Start the server

Never started a server? [Your first GPU server](/docs/tutorial-first-gpu-server) shows adding credit and **Quick start** step by step. Quick start's **Train or fine-tune a model** opens a notebook; the no-code LLaMA Board is in the full setup:

1. Open **Deploy**. Under **Sort by**, choose **Price, low to high** and pick a configuration with at least 8 GB of **VRAM**; 16 GB is recommended. Select **Continue**.
2. Above the template cards, select **Train and fine-tune**, then the **LLaMA-Factory (fine-tuning in the browser)** card, then **Continue**.
3. Name the server, for example `finetune-board`. Leave `LLAMAFACTORY_PASSWORD` empty: the platform creates a password for this server. Leave `HF_TOKEN` empty unless you want a gated model from Hugging Face.
4. Select **Continue**, check **Per hour** and keep the automatic stop under **Automation (optional)** on. Give it enough time for your training run. Select **Start my server**.

Some new servers are reviewed by our team before they start; you are not charged until the server runs.

The software is large, so the first start takes several minutes; the template card shows the expected time as **First start**. Later starts are faster.

## 2. Sign in

1. Open **Servers**, select the server and open the **Connect** tab.
2. Under **Sign in with** you see the **Username** (`admin`) and the **Password**. Press the eye button and copy the password.
3. Select **Open app**. Your browser asks for a user name and password: enter `admin` and the password. LLaMA Board opens.

LLaMA Board has a language menu at the top left if you prefer another language. The labels below are the English ones.

## 3. Train a first LoRA

1. Under **Model name**, choose a small model, for example `Qwen2.5-0.5B-Instruct` (Apache 2.0 licence). With 8 GB of GPU memory, stay with models of about 1.5 billion parameters or fewer.
2. Keep **Finetuning method** on `lora`.
3. On the **Train** tab, under **Dataset**, pick the example `alpaca_en_demo`. Select **Preview dataset** to see what the examples look like.
4. Keep the other settings for this first run and select **Start**.

The model downloads from Hugging Face the first time, then training begins. The page shows the progress and a loss chart; a falling loss means the model is learning the examples. Results are saved in `/workspace/llamafactory/saves` on the server's disk.

## 4. Chat with the result

1. When training is finished, open the **Chat** tab. Under **Checkpoint path**, pick the run you just trained.
2. Select **Load model**, type a message and compare the answers with the original model (load it without a checkpoint).

To train on your own data, your examples need the same format as the example dataset; the [LLaMA-Factory data guide](https://github.com/hiyouga/LLaMA-Factory/blob/main/data/README.md) explains it. The **Export** tab merges the adapter into a full model you can download or serve.

## Common mistakes

- **"CUDA out of memory"**: the model is too big for the GPU. Choose a smaller model, lower the batch size, or set **Quantization bit** to `4` (QLoRA).
- **A gated model does not download**: models such as Llama need you to accept their licence on Hugging Face and an `HF_TOKEN` set at launch.
- **The server stopped in the middle of training**: the automatic stop ran out. Your saved checkpoints stay on the disk; set a longer time on the server's **Settings** tab under **Automation** before the next run.
- **Results lost**: only `/workspace` is kept, and **Destroy** deletes it. Download what you want to keep first; see [Fine-tune or train: keep your work safe](/docs/tutorial-keep-your-work-safe).

## When you are done: stop or destroy

- **Stop** ends the compute charge. Models, datasets and results stay on the disk, which is still billed.
- **Destroy** ends every charge and deletes the disk. Open the server, go to **Settings** and choose **Destroy server**.

## Next

- [Serve an OpenAI-compatible API with vLLM](/docs/tutorial-model-api) to serve the merged model.
- [Move data in and out](/docs/tutorial-move-data)
- [Control costs](/docs/tutorial-save-money)
