Large Language Models (LLMs)#
Introduction#
Large Language Models (LLMs) power a variety of tasks such as dialogue systems, text classification, summarization, and more. NeMo Automodel provides a simple interface for loading and fine-tuning LLMs hosted on the Hugging Face Hub.
Run LLMs with NeMo Automodel#
To run LLMs with NeMo Automodel, make sure you’re using NeMo container version 25.07
or later. If the model you intend to fine-tune requires a newer version of Transformers, you may need to upgrade to the latest version of NeMo Automodel by using:
pip3 install --upgrade git+git@github.com:NVIDIA-NeMo/Automodel.git
For other installation options (e.g., uv), please see our Installation Guide.
Supported Models#
NeMo Automodel interoperates with most LLMs available on the Hugging Face Hub. During preprocessing, it uses transformers.AutoTokenizer
, which is sufficient for most LLM cases. If your model requires custom text handling, such as for reasoning tasks, you can override the default tokenizer during the data preparation stage.
The table below lists the main architectures we test against (FSDP2 combined with SFT/PEFT) and includes a representative checkpoint for each.
Architecture |
Models |
Example HF Models |
---|---|---|
|
Aquila, Aquila2 |
|
|
Baichuan2, Baichuan |
|
|
Bamba |
|
|
ChatGLM |
|
|
Command‑R |
|
|
DeciLM |
|
|
DeepSeek |
|
|
EXAONE‑3 |
|
|
Falcon |
|
|
Gemma |
|
|
Gemma 2 |
|
|
Gemma 3 |
|
|
GLM‑4 |
|
|
GLM‑4‑0414 |
|
|
StarCoder, SantaCoder, WizardCoder |
|
|
GPT‑J |
|
|
GPT‑NeoX, Pythia, OpenAssistant, Dolly V2, StableLM |
|
|
Granite 3.0, Granite 3.1, PowerLM |
|
|
Granite 3.0 MoE, PowerMoE |
|
|
Granite MoE Shared |
|
|
GritLM |
|
|
InternLM |
|
|
InternLM2 |
|
|
InternLM3 |
|
|
Jais |
|
|
Llama 3.1, Llama 3, Llama 2, LLaMA, Yi |
|
|
MiniCPM |
|
|
MiniCPM3 |
|
|
Mistral, Mistral‑Instruct |
|
|
Mixtral‑8x7B, Mixtral‑8x7B‑Instruct |
|
|
Nemotron‑3, Nemotron‑4, Minitron |
|
|
OLMo |
|
|
OLMo2 |
|
|
OLMoE |
|
|
Orion |
|
|
Phi |
|
|
Phi‑4, Phi‑3 |
|
|
Phi‑3‑Small |
|
|
QwQ, Qwen2 |
|
|
Qwen2MoE |
|
|
Qwen3 |
|
|
Qwen3MoE |
|
|
StableLM |
|
|
Starcoder2 |
|
|
Solar Pro |
|
Fine-Tuning LLMs with NeMo Automodel#
The models listed above can be fine-tuned using NeMo Automodel to adapt them to specific tasks or domains. We support two primary fine-tuning approaches:
Parameter-Efficient Fine-Tuning (PEFT): Updates only a small subset of parameters (typically <1%) using techniques like Low-Rank Adaptation (LoRA). This is ideal for resource-constrained environments. See our PEFT Guide for details.
Supervised Fine-Tuning (SFT): Updates all or most model parameters for deeper adaptation, suitable for high-precision applications. See our SFT Guide for implementation details.
Tip
In these guides, we use the SQuAD v1.1
dataset for demonstation purposes, but you can specify your own data as needed.
Example: Fine-Tuning with SQuAD Dataset#
We demonstrate fine-tuning using the Stanford Question Answering Dataset (SQuAD) as an example. SQuAD is a reading comprehension dataset where models learn to answer questions based on given context passages.
Key features of SQuAD:
v1.1: All answers are present in the context (simpler for basic fine-tuning)
v2.0: Includes unanswerable questions (more realistic but complex)
Sample data format:
{
"id": "5733be284776f41900661182",
"title": "University_of_Notre_Dame",
"context": "Architecturally, the school has...",
"question": "To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?",
"answers": {
"text": ["Saint Bernadette Soubirous"],
"answer_start": [515]
}
}
This structure makes SQuAD ideal for training context-based question answering models. Both our PEFT and SFT guides use SQuAD v1.1 as an example, but you can substitute your own dataset as needed.
Get Started with Fine-Tuning#
To fine-tune any of the supported models:
Choose your approach:
For parameter-efficient tuning: Follow the PEFT Guide
For full model tuning: Follow the SFT Guide
Key steps in both guides:
Model and dataset configuration
Training recipe setup
Inference with fine-tuned models
Model sharing via Hugging Face Hub
Deployment with vLLM
Example launch commands:
# For PEFT
automodel finetune llm -c peft_guide.yaml
# For SFT
automodel finetune llm -c sft_guide.yaml
Both guides provide complete YAML configuration examples and explain how to:
Customize training parameters
Monitor progress
Save and share checkpoints
Deploy the fine-tuned model with optimized inference