# Fine-tune or train: keep your work safe

Training runs for hours, and the result is the one thing you cannot buy again. This guide shows where your files live on a rented GPU server, what happens to them when you stop, pause or delete, and the few habits that keep a run from being lost. For a first training run, see [Fine-tune a small model](/docs/tutorial-fine-tune-a-model).

## Know where your work lives

Your servers run on third-party machines operated by independent, verified hosting providers. They are real hardware that can fail. **We do not make backups of your servers or volumes.** Anything important must also be in a place you control.

There are two places to keep files on our platform:

| | Server disk | Volume |
|---|---|---|
| What it is | The disk you choose in **Deploy** | Named disk space you create on the **Storage** page |
| Kept after a stop or restart | Yes | Yes |
| Kept after you destroy the server | No, deleted for good | Yes |
| Billed | While the server exists, also when stopped | Per hour from creation, also when unused |
| Where it lives | On the server's machine | On one physical machine, chosen for a GPU plan |

Memory is never kept: anything not written to disk is lost when a server stops, restarts or is paused.

A volume outlives a server, but it is not a backup. It sits on one machine like a server disk, and only a server on that machine can use it. See [Volumes and copies](/docs/storage).

## 1. Choose the disk before you start

1. In **Deploy**, on the configure step, set the disk large enough for the model, your data and several checkpoints. The line under the slider shows what the disk costs per hour. The **Fine-tuning starter** template suggests 150 GB.
2. If the data should outlive this server, pick a volume under **Volume (optional)** on the same step, or create one there. It is mounted at `/workspace` unless you choose another path. A volume cannot be attached to a server that is already running.

## 2. Save checkpoints as you go

A checkpoint is a saved copy of the training state. If the run stops, you continue from the last checkpoint instead of starting again.

1. Write checkpoints under `/workspace`, which is on the disk (or on the volume, if you mounted one there).
2. Save often enough that losing the time since the last one does not hurt, for example every few hundred steps.
3. Keep only the last few checkpoints, so the disk does not fill up.

With the Hugging Face `transformers` `Trainer`, the settings `output_dir="/workspace/checkpoints"`, `save_steps` and `save_total_limit` do this, and `trainer.train(resume_from_checkpoint=True)` continues from the newest one. In plain PyTorch, save the model and optimizer state with `torch.save` and load them at the start of your script. These options belong to those libraries; check their documentation for your version.

## 3. Copy results off the server

Copy checkpoints and finished models to a place you control while the server runs:

- **To your computer:** with an SSH key on the server, run `rsync` from your own computer, with `PORT` and `HOST` from the SSH command on the **Connect** tab:

```bash
rsync -avz -e "ssh -p PORT" root@HOST:/workspace/checkpoints/ ./checkpoints/
```

- **To your own bucket:** the `gpu-backup.sh` helper copies a folder to any S3-compatible storage and checks every file; it can also run every day on a schedule. Your bucket keys stay on the server. See [Back up to your own storage](/docs/backups).
- **From JupyterLab:** right-click a file in the file browser and choose **Download**. Good for a few small files.

More ways are in [Moving files](/docs/moving-files).

## 4. Know what each action does to your files

- **Stop:** compute stops, the disk is kept and still billed. Running processes end, so a training script stops too.
- **Start again:** the GPU on that machine may be taken by someone else while your server is stopped. Then the server cannot start until the GPU is free; your disk is not lost. See [If a server fails to start](/docs/if-a-server-fails-to-start).
- **Balance at zero:** after a short grace period, running servers are stopped. The disk is kept until the delete date shown in the console. Add credit before then.
- **Destroy:** the server and its disk are deleted for good. A volume that was mounted stays.
- **Launch a copy:** starts a new server with the same settings, but not the files on the disk.

An automatic stop (after a running time, when the GPU is idle, or at a spending limit) is a stop: the disk is kept. See [Automation](/docs/automation).

## 5. Interruptible servers need checkpoints

An interruptible server costs less, but it can be paused at any time when demand rises. Its processes stop, the disk is kept, and it does not resume by itself: you select **Start** when you want it back.

Use it for training only if your script saves checkpoints and can continue from them. **Redeploy on demand** on a paused server moves it to a new machine and deletes everything on the old disk, so copy your data first. See [Interruptible servers](/docs/interruptible).

## A checklist before a long run

1. The disk has room for the model, the data and a few checkpoints.
2. Checkpoints are written under `/workspace` and the script can resume from them.
3. A copy of the checkpoints goes somewhere you control, by hand or on a schedule.
4. Your balance covers the run, or auto top-up is on. See [Control costs](/docs/tutorial-save-money).
5. An automatic stop is set, so a finished or stuck run does not keep billing.

## When you are done

Download the final model and your logs, check that the copy opens, then destroy the server. A stopped server keeps billing for its disk.

## Next

- [Fine-tune a small model](/docs/tutorial-fine-tune-a-model)
- [Back up to your own storage](/docs/backups)
- [Storage and data](/docs/storage-and-data)
