Axolotl tutorial: fine-tune Llama 3.2 locally in Python

Learn Axolotl setup, LoRA training and Python inference with Llama 3.2 1B, demonstrated on a 3060 Ti with 8 GB VRAM.

Player not loading? Watch on YouTube

This Axolotl tutorial walks through a local LLM fine-tuning example using Llama 3.2 1B and a custom JSONL dataset. The task teaches the model to reverse a string and swap each character's case. The speaker presents it as a basic workflow demonstration, with limited success on unfamiliar inputs.

Setup uses uv and Python 3.12 because the speaker encountered issues with 3.13. The demonstrated hardware is an NVIDIA 3060 Ti with 8 GB VRAM. The speaker reports telemetry errors with Axolotl 0.13 onward and suggests using 0.12.* only if the same problem occurs. Flash Attention stays disabled in this setup.

The training configuration points to local data in Alpaca format, with instruction, input and output fields. It uses a sequence length of 256, LoRA rank 32, alpha 64 and 10 epochs. The tutorial explains how to adapt an example YAML file, launch training and locate the saved adapter files.

Inference follows two routes: Axolotl's command line and a Python script using Transformers and PEFT. Both use an Alpaca prompt template. Dependency conflicts interrupt the Python example, so the speaker rebuilds the environment and suggests separating training from inference. Some tested strings produce the intended result, while others fail. The example shows that training changed the model's behavior, but does not establish reliable generalization or optimal training settings.