Skip to main content

Fine-Tune Your First LLM

Fine-tune an LLM with LoRA in three commands using a pipeline template


The fastest way to fine-tune an LLM on Clarifai is to scaffold a project from the lora-pipeline-unsloth-quick-start pipeline template, then upload and run it. The template uses public data, sensible defaults, and auto-provisions compute — no dataset setup or hyperparameter tuning required for the first run.

Prerequisites

Install the Clarifai CLI and authenticate:

pip install --upgrade clarifai
clarifai login

clarifai login auto-detects your user ID and saves your Personal Access Token (PAT) locally.

Fine-Tune the Model

Scaffold a project from the LoRA quick-start template, then upload and run it:

clarifai pipeline init --template lora-pipeline-unsloth-quick-start
cd lora-pipeline-unsloth-quick-start
clarifai pipeline upload
clarifai pipeline run --instance=g5.xlarge

This trains a LoRA fine-tune of unsloth/Qwen3-0.6B on the mlabonne/FineTome-100k dataset using Unsloth. --instance=g5.xlarge auto-provisions a compute cluster and nodepool — no separate cluster setup required, and the same nodepool can later serve inference on the fine-tuned model.

When training completes, the fine-tuned model is registered in your Clarifai model registry, ready to serve, evaluate, or refine further.

Customize Before Running

To override defaults at init time — a different base model, more epochs, custom LoRA rank — pass --set key=value flags. For example, to fine-tune Llama 3.2 1B for three epochs:

clarifai pipeline init --template lora-pipeline-unsloth-quick-start \
--set base_model_name="unsloth/Llama-3.2-1B-Instruct" \
--set num_epochs=3

See the Pipeline Templates reference for all customizable parameters.

What to Explore Next