Large language models (LLMs)
These examples fine-tune and post-train large language models (LLMs) on AI Runtime. They cover parameter-efficient methods like Low-Rank Adaptation (LoRA) and full supervised fine-tuning across libraries including TRL, Unsloth, Axolotl, and LLM Foundry. For batch inference examples, see Batch inference.
Example | Interface | Description |
|---|---|---|
Notebook | Post-train Gemma4-2B with Group Relative Policy Optimization (GRPO) and Low-Rank Adaptation (LoRA) on a single H100 GPU using Unsloth. | |
Notebook | Full-weight fine-tune Qwen3-4B on a single H100 GPU with TRL, using BF16 mixed precision and gradient checkpointing. | |
Notebook | LoRA fine-tune Llama-3.2-3B on a single GPU with the Unsloth library. | |
Notebook | LoRA fine-tune GPT-OSS 20B on 8 H100 GPUs with TRL and distributed data parallelism. | |
Notebook | Full-weight fine-tune Llama-3.2-1B on 8 H100 GPUs with TRL and DeepSpeed ZeRO Stage 3. | |
Notebook | LoRA fine-tune Olmo3 7B across multiple GPUs with the Axolotl library. | |
Notebook | Fine-tune Qwen3.5-0.8B on a single H100 GPU with TRL, then serve it behind a vLLM Model Serving endpoint. | |
Notebook | LoRA fine-tune Llama-3.2-3B across multiple GPUs with the Unsloth library. | |
Notebook | LoRA fine-tune GPT-OSS 120B on 8 H100 GPUs with TRL, using DDP and FSDP. | |
Notebook | Train Transformer models using PyTorch Fully Sharded Data Parallel (FSDP) to shard model parameters across multiple GPUs. | |
CLI | Supervised fine-tune Llama 3.1 8B with PyTorch FSDP across two 8x H100 nodes, log training loss to MLflow, and save a consolidated checkpoint. | |
CLI | Supervised fine-tune Qwen3.8-27B with PyTorch FSDP2 across four 8x H100 nodes. | |
CLI | Fine-tune Qwen3-8B for invoice and receipt entity extraction with TRL and DeepSpeed ZeRO-3 on one 8x H100 node. | |
CLI | Use Ray Train to fine-tune Qwen2.5-3B with one distributed data parallel worker per GPU on an 8x H100 node. | |
CLI | Use Ray Tune and the asynchronous successive halving algorithm (ASHA) to search LoRA configurations across four A10 GPUs and log the best configuration to MLflow. |
Video demo
This video walks through the Supervised Fine-tuning (LoRA) of Llama-3.2-3B example notebook in detail (12 minutes).