LoRA Model Customization
LoRA Model Customization Job
Learn how to use the NeMo Platform to create a LoRA (Low-Rank Adaptation) customization job using a custom dataset. In this tutorial we use LoRA to fine-tune a question-answering model from the SQuAD dataset.
LoRA is a parameter-efficient fine-tuning method that requires fewer computational resources than full fine-tuning. If you need full model fine-tuning instead, see the Full SFT Customization Job tutorial.
Time to complete: approximately 45 minutes. Job duration increases with model size and dataset size.
Prerequisites
Before starting this tutorial, ensure you have:
- Completed the Quickstart to install and deploy NeMo Platform locally
- Installed the Python SDK (PyPI wrapper:
pip install "nemo-platform[all]"; source checkout: runmake bootstrapfrom the repository root) - Installed the
datasetspackage for loading SQuAD:pip install datasets - At least one GPU with CUDA 12.8+
Quick Start
1. Initialize SDK
The SDK needs to know your NeMo Platform server URL. By default, http://localhost:8080 is used. If NeMo Platform is running elsewhere, set the NMP_BASE_URL environment variable:
2. Prepare Dataset
Create your data in JSONL format (one JSON object per line). For SFT with LoRA, the platform expects prompt/completion pairs.
Dataset structure:
- Training files under
training/(or root withtraining.jsonl) - Validation files under
validation/(orvalidation.jsonl)
SFT format: Each line is a JSON object with:
prompt: The input (e.g. context + question)completion: The desired model output
Example record (single line in .jsonl):
Download SQuAD and Convert to SFT Format
We use the SQuAD dataset and convert it to prompt/completion JSONL.
3. Create FileSet and Upload Training Data
Upload the training and validation JSONL files to a FileSet so the customization job can use them.
4. Secrets Setup
For Huggingface models that require authentication, create a secret with your HF token. Get a token from Huggingface Settings and accept the model terms.
This is generally true for LLaMa based models (e.g. Llama-3.2-1B-Instruct).
5. Create Base Model FileSet and Model Entity
Create a fileset pointing to Qwen/Qwen3-0.6B and a Model Entity that references it. Model download happens when the customization job runs.
6. Create LoRA Customization Job
Submit to the Automodel backend using AutomodelJobInput with finetuning_type: lora. After training completes, deploy the base model with LoRA support manually (step 8).
7. Track Training Progress
Poll job status until it completes. Progress (step/max_steps) is shown when available.
8. Validate Output Model and Deployment
With the base model entity and LoRA adapter from training, create a NIM deployment with lora_enabled=True so the adapter is served alongside the base weights. Check the model entity and deployment status.
9. Monitor Deployment Until Ready
Wait for the deployment to reach RUNNING/READY before sending inference requests.
10. Check Model Output
Send a chat completion request to the deployed LoRA model and compare the output to the expected answer.
Conclusion
You have started a LoRA customization job, monitored it to completion, and evaluated the fine-tuned model. Use the output.name to access the model for further inference or evaluation.
Next Steps
- Monitor training metrics in detail
- Evaluate your fine-tuned model using the Evaluator service
- Try Full SFT for other customization options