Train your first model
Pick a dataset and a base model, choose where to train, start the run, and see what you get.
Here's the whole path from an empty account to a trained model. You'll need somewhere to train (a connected machine, see Connect your workstation, or a Hugging Face token for cloud training), a dataset, and a base model. Setting up a run takes a few minutes. How long it trains depends on the model and the data.
Prepare a dataset
The quickest start is the sample. When you have no datasets yet, the Datasets page offers Try a sample dataset. It creates "Sample: Chat Fine-Tune Starter", a small instruction-tuning set in chat format that's ready to train on.
To use your own data, you have a few options:
- Upload a file. On Datasets, choose Open the builder, then Custom. It accepts CSV, TSV, JSON, JSONL and Excel files up to 64 MB and 100,000 rows, detects the format, shows you the columns, and lets you map them to a Training format: Instruction tuning (SFT) for prompt and response pairs (with an optional system message), Preference pairs (DPO) for a prompt with a chosen and a rejected answer, or Raw text.
- Upload preference pairs as JSONL. On the new dataset page, Upload preference data takes a file with one
{"prompt": ..., "chosen": ..., "rejected": ...}per line, up to 64 MB. Invalid lines are skipped and counted for you. - Generate from facts. The Persona builder turns facts you type in into a training set in your own voice. It runs on your own Anthropic API key, saved in Settings.
One thing to know: datasets built From sources (GitHub, URLs, Hugging Face datasets, knowledge bases) can't be sent to your machine or to a cloud GPU yet. For training, stick to the sample or an uploaded dataset.
Choose a base model
On the Training page, the Model Selection card has two tabs:
- Hugging Face searches the Hub (text-generation models only) with a size filter. Pick from the results; there's no free-text field for a model id.
- Your Models lists your own completed runs, so you can keep training from one of them.
Gated models such as Llama and Gemma need your Hugging Face token, which you save in Settings. For cloud runs that's all it takes. For runs on your own machine, the machine downloads the model itself using the token in its own ~/azul-workstation/.env. To put it there, either run export HF_TOKEN=hf_... in the shell and run the connect command again (the installer saves the token and recreates the agent container, keeping your other settings), or add a line HF_TOKEN=hf_... to the file yourself and run docker compose -f ~/azul-workstation/docker-compose.yml up -d. A plain restart won't pick up changes to that file.
Models that need custom code from the Hub to load aren't supported. Standard architectures (Llama, Qwen, Gemma, Mistral and friends) work.
Configure the run
Mode. The page starts in Standard, which is continued pre-training with 10 epochs, batch size 32 and a learning rate of 0.001. For a first fine-tune, switch to Fine-Tune: a gentler learning rate, LoRA on, 3 epochs, batch size 2. Use DPO for preference pairs; it loads the base model in 4-bit by default.
LoRA and memory. LoRA is on by default in Fine-Tune mode. Turning LoRA (recommended) off trains all the weights, which needs far more memory. Setting Base Quantization to 4-bit (QLoRA) lets bigger models fit on smaller cards.
Dataset format. Defaults to OpenAI Messages, which is what the sample and the builder produce. Auto-detect inspects the data, and Alpaca, ShareGPT, completion pairs, Dolly, tabular and raw text are available too.
Serving quantization decides how the finished model is stored for serving later. Leave it on Auto unless you know your inference card well.
Everything else has sensible defaults: a max length of 2048, a 20 percent validation split, and early stopping. The Advanced section is collapsed for a reason.
Pick where to train
My workstation runs on your connected machine at no extra cost. With several machines, Which workstation runs this job lets you pick one or choose Any capable workstation. When the machine has more than one trainable GPU, Use all N GPUs is on by default and pools them into one run.
Hugging Face Cloud rents a cloud GPU billed per minute to your Hugging Face account. It needs your token in Settings and a Hugging Face PRO account (or a Team or Enterprise organization), because the run executes as a Hugging Face Job. Pick the Cloud GPU yourself from the list, which shows each option's VRAM and price per hour (as of this writing, from a T4 at $0.40 an hour to an 80 GB A100 at $2.50 an hour). The price shown is an estimate; Hugging Face bills the minutes actually used. Cloud runs are cut off after 8 hours.
If neither option is available, the page tells you why: the dataset pulls from external sources, the machine has no GPUs in its training pool (the Use every GPU for training button fixes that), or there's nowhere to train yet.
Start the run
Press Start Training. The run shows as Pending until a machine picks it up, which takes seconds when your machine is online, or until Hugging Face starts the job.
The run's page shows its status, where it's running (your machine's name or the cloud GPU), a Training Progress bar by epoch, and the Training & Validation Loss chart. The tabs are Configuration, Metrics, Logs (switch between Summary and Detailed), Attempts, and Final Results, which opens on its own when the run completes.
A few things worth knowing while it runs:
- Runs move through pending, running and completed, or end up failed or stopped.
- Stop ends a running run within about 30 seconds. For a cloud run it also cancels the Hugging Face job, so billing stops.
- Restart on a stopped or failed run starts it over from the beginning. There's no mid-run resume, on your machine or in the cloud.
- A run on your machine fails if no machine picks it up within a day, and a single attempt can run for up to 12 hours.
When it's done
The model appears on Models under Trained Checkpoints, with its base model, where it's stored, and its status. From there, and from the run's page, you can:
- Deploy it to a machine and talk to it. See Deploy and chat with your model.
- Upload to HF to push it to your Hugging Face account (repository id, private by default, FP8 or FP16, a license).
- Run Evaluation for a fixed scoring rubric over the run's training metrics, with no AI involved.
- Improve with feedback to run a follow-up DPO round on top of this model. It needs the full-precision base that Save full-precision base (bf16) keeps by default; otherwise the button reads Prepare for refinement.
Troubleshooting
"You have nowhere to train yet." Connect a machine, or save your Hugging Face token for cloud training.
The dataset is greyed out. It pulls from external sources. Use the sample or an uploaded dataset.
The machine has no GPUs in its training pool. Press Use every GPU for training, or change the GPU map in Settings.
A gated model fails to download on your machine. The machine needs its own token. See "Choose a base model" above.
Out of memory on your GPU. Lower the max length or the batch size, set Base Quantization to 4-bit, keep LoRA on, or turn on Use all N GPUs if the machine has more than one.