### Run Example Finetuning Configurations
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/mistral4/README.md
Executes example configurations for finetuning Mistral Small 4. Use these commands to start text-only or text+vision finetuning jobs.
```bash
# text-only
axolotl train examples/mistral4/qlora-text.yml # no experts ~69 GiB, experts ~93 GiB
axolotl train examples/mistral4/fft-text.yml
# text + vision
# run: wget https://huggingface.co/datasets/Nanobit/text-vision-2k-test/resolve/main/African_elephant.jpg
axolotl train examples/mistral4/qlora-vision.yml # no experts ~68 GiB
axolotl train examples/mistral4/fft-vision.yml
```
--------------------------------
### Complete Profiling Setup Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
Demonstrates a comprehensive profiling setup within a custom trainer class, including applying decorators and context managers with custom configurations for different methods.
```python
from axolotl.integrations.swanlab.profiling import (
swanlab_profile,
swanlab_profiling_context,
ProfilingConfig,
)
class OptimizedTrainer(AxolotlTrainer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Custom profiling config for high-frequency operations
self.fast_op_config = ProfilingConfig(
enabled=True,
min_duration_ms=0.5,
log_interval=50,
)
@swanlab_profile
def training_step(self, model, inputs):
"""Main training step - always profile."""
return super().training_step(model, inputs)
@swanlab_profile
def compute_loss(self, model, inputs, return_outputs=False):
"""Loss computation - always profile."""
return super().compute_loss(model, inputs, return_outputs)
def _prepare_inputs(self, inputs):
"""High-frequency operation - throttled profiling."""
with swanlab_profiling_context_advanced(
self,
"prepare_inputs",
config=self.fast_op_config,
):
return super()._prepare_inputs(inputs)
```
--------------------------------
### Setup and Run Ministral3 Fine-tuning
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/ministral3/README.md
This snippet shows the bash commands to set up the environment and initiate the fine-tuning process for the Ministral3 model using Axolotl. It includes copying a configuration file, switching to a specific Git branch, installing dependencies, and starting the training job.
```bash
cp examples/ministral3/ministral3-3b-qlora.yaml ministral3-3b-qlora.yaml
git fetch
git checkout transformers-v5
# Install packages for transformers v5
uv pip install -e .
axolotl train ministral3-3b-qlora.yaml
```
--------------------------------
### Run Mistral Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/ministral/README.md
Execute the provided configuration file to start the fine-tuning process for Mistral models. This command uses a QLoRA configuration and requires approximately 8.76 GiB of VRAM.
```bash
axolotl train examples/ministral/ministral-small-qlora.yaml
```
--------------------------------
### Run Olmo 3 Finetuning Example with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/olmo3/README.md
Execute the provided example configuration to fine-tune Olmo 3 7B models using QLoRA. This command requires Axolotl and Cut Cross Entropy to be installed.
```bash
axolotl train examples/olmo3/olmo3-7b-qlora.yaml
```
--------------------------------
### Quick Start Full-Featured DPO Production Setup
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/swanlab/README.md
Launch a comprehensive DPO training setup for production, including team notifications and workspace. Requires API key and Lark webhook details.
```bash
export SWANLAB_API_KEY=your-api-key
export SWANLAB_LARK_WEBHOOK_URL=https://open.feishu.cn/...
export SWANLAB_LARK_SECRET=your-webhook-secret
accelerate launch -m axolotl.cli.train examples/swanlab/dpo-swanlab-full-featured.yml
```
--------------------------------
### Run AFM Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/arcee/README.md
Executes the fine-tuning process for the ArceeAI AFM model using a specified configuration file. This command requires Axolotl to be installed.
```bash
axolotl train examples/arcee/afm-4.5b-qlora.yaml
```
--------------------------------
### Install Transformers from Main
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/mistral4/README.md
Installs the transformers library directly from its GitHub repository. This is a prerequisite for some configurations.
```bash
uv pip install git+https://github.com/huggingface/transformers.git
```
--------------------------------
### Run Gemma 4 Finetuning Examples with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/gemma4/README.md
Execute finetuning jobs for various Gemma 4 configurations using the Axolotl CLI. Ensure Axolotl and Cut Cross Entropy are installed prior to running.
```bash
axolotl train examples/gemma4/26b-a4b-moe-qlora.yaml
```
```bash
axolotl train examples/gemma4/31b-qlora.yaml
```
```bash
axolotl train examples/gemma4/31b-qlora-flex.yaml
```
--------------------------------
### Run Qwen3 Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/qwen3/README.md
Execute the Qwen3 finetuning process using a specified YAML configuration file with Axolotl.
```bash
axolotl train examples/qwen3/32b-qlora.yaml
```
--------------------------------
### Launch SGLang Inference Server
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/gpt-oss/README.md
Starts an SGLang inference server for a fine-tuned GPT-OSS model. Requires SGLang to be installed from source. Modify '--tp' to match your tensor parallel size.
```bash
python3 -m sglang.launch_server --model ./outputs/gpt-oss-out/ --served-model-name axolotl/gpt-oss-120b --host 0.0.0.0 --port 8888 --tp 8
```
--------------------------------
### Fetch and Train with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/README.md
Fetch example configuration files and initiate a model training process using a LoRA configuration. Ensure you have fetched the examples first.
```bash
# Fetch axolotl examples
axolotl fetch examples
# Or, specify a custom path
axolotl fetch examples --dest path/to/folder
# Train a model using LoRA
axolotl train examples/llama-3/lora-1b.yml
```
--------------------------------
### Run Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/apertus/README.md
Executes the finetuning process for the Apertus model using a specified configuration file. This command initiates the training job.
```bash
axolotl train examples/apertus/apertus-8b-qlora.yaml
```
--------------------------------
### Install Axolotl from Source
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Installs Axolotl in development mode from a local clone of the repository. Requires uv and setting the CUDA backend.
```bash
git clone https://github.com/axolotl-ai-cloud/axolotl.git
cd axolotl
export UV_TORCH_BACKEND=cu128
uv venv && source .venv/bin/activate
uv pip install --no-build-isolation -e '.[deepspeed]'
```
--------------------------------
### Install XIELU with Python Executable Env Var
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/apertus/README.md
Installs the XIELU package by passing the Python executable path via an environment variable. This is a troubleshooting step for installation errors.
```bash
Python_EXECUTABLE=$(which python) uv pip install git+https://github.com/nickjbrowning/XIELU@59d6031 --no-build-isolation --no-deps
```
--------------------------------
### Start Resource Servers
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/nemo_gym/README.md
Command to start the necessary resource servers for single-turn training. This command assumes you are in the ~/Gym directory.
```bash
cd ~/Gym && ng_run "+config_paths=[resources_servers/reasoning_gym/configs/resources_only.yaml]" "+skip_venv_if_present=true"
```
--------------------------------
### Install SwanLab
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
Install the SwanLab library using pip. This is a prerequisite for using the integration.
```bash
pip install swanlab
```
--------------------------------
### Start vLLM Server and Train (Structured Mode)
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/ebft/README.md
Initiates a vLLM server for efficient generation and then starts the EBFT training process using a configuration file for structured data.
```bash
CUDA_VISIBLE_DEVICES=0 axolotl vllm-serve examples/ebft/qwen3-4b-ebft-structured-async.yaml
CUDA_VISIBLE_DEVICES=1 axolotl train examples/ebft/qwen3-4b-ebft-structured-async.yaml
```
--------------------------------
### Install Axolotl and Dependencies
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/colab-notebooks/colab-axolotl-example.ipynb
Installs the Axolotl library and the cut-cross-entropy package. This step can take several minutes.
```python
%%capture
# This step can take ~5-10 minutes to install dependencies
!pip install --no-build-isolation "axolotl>=0.16.1"
!pip install "cut-cross-entropy[transformers] @ git+https://github.com/axolotl-ai-cloud/ml-cross-entropy.git@fec1a88"
```
--------------------------------
### Quick Start DPO with Completion Logging
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/swanlab/README.md
Run DPO training with SwanLab completion table logging enabled. Ensure SWANLAB_API_KEY is set.
```bash
export SWANLAB_API_KEY=your-api-key
accelerate launch -m axolotl.cli.train examples/swanlab/dpo-swanlab-completions.yml
```
--------------------------------
### Saving Initial Configurations and Starting Trainer
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/colab-notebooks/colab-axolotl-example.ipynb
Logs indicating the pre-saving of adapter, tokenizer, and model configurations, followed by the start of the training process and gathering batch lengths.
```text
[2025-05-07 22:11:41,755] [INFO] [axolotl.train.save_initial_configs:359] [PID:1336] [RANK:0] Pre-saving adapter config to ./outputs/qwen-sft-pirate-rrr...[39m
[2025-05-07 22:11:41,756] [INFO] [axolotl.train.save_initial_configs:363] [PID:1336] [RANK:0] Pre-saving tokenizer to ./outputs/qwen-sft-pirate-rrr...[39m
[2025-05-07 22:11:41,974] [INFO] [axolotl.train.save_initial_configs:366] [PID:1336] [RANK:0] Pre-saving model config to ./outputs/qwen-sft-pirate-rrr...[39m
[2025-05-07 22:11:41,982] [INFO] [axolotl.train.execute_training:211] [PID:1336] [RANK:0] Starting trainer...[39m
[2025-05-07 22:11:45,047] [INFO] [axolotl.utils.samplers.multipack.calc_min_len:411] [PID:1336] [RANK:0] gather_len_batches: [1540][39m
```
--------------------------------
### Start vLLM with LoRA and Tool Calling
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/nemo_gym/README.md
Use this command to start the vLLM API server with LoRA support, tool calling enabled, and runtime loading capabilities. Ensure `VLLM_ALLOW_RUNTIME_LORA_UPDATING=1` is set for weight sync to function correctly. The `--enable-lora` flag is necessary for LoRA adapter support, and `--enable-auto-tool-choice --tool-call-parser hermes` are required for Qwen3 tool calling.
```bash
VLLM_ALLOW_RUNTIME_LORA_UPDATING=1 \
CUDA_VISIBLE_DEVICES=0 python -m vllm.entrypoints.openai.api_server \
--model Qwen/Qwen3-4B-Instruct-2507 \
--max-model-len 4096 \
--gpu-memory-utilization 0.7 \
--enable-lora --max-lora-rank 64 \
--enable-auto-tool-choice --tool-call-parser hermes
```
--------------------------------
### Install Axolotl from Main
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/arcee/README.md
Installs Axolotl from its main branch, including necessary dependencies like PyTorch and CCE. Ensure PyTorch version 2.9.1 or higher is installed before running.
```bash
# Ensure you have Pytorch installed (Pytorch 2.9.1 min)
git clone https://github.com/axolotl-ai-cloud/axolotl.git
cd axolotl
uv pip install --no-build-isolation -e '.'
# Install CCE https://docs.axolotl.ai/docs/custom_integrations.html#cut-cross-entropy
python scripts/cutcrossentropy_install.py | sh
```
--------------------------------
### Run Voxtral Finetuning Examples
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/voxtral/README.md
Executes the finetuning process for Voxtral models using Axolotl. Two examples are provided: one for text-only finetuning and another for text-audio multimodal finetuning. Both configurations utilize approximately 4.8 GB of VRAM.
```bash
# text only
axolotl train examples/voxtral/voxtral-mini-qlora.yml
# text + audio
axolotl train examples/voxtral/voxtral-mini-audio-qlora.yml
```
--------------------------------
### Run Gemma-3n Finetuning Examples
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/gemma3n/README.md
Executes fine-tuning scripts for Gemma-3n models using Axolotl. Supports text-only, text+vision, and text+vision+audio configurations.
```bash
# text only
axolotl train examples/gemma3n/gemma-3n-e2b-qlora.yml
# text + vision
axolotl train examples/gemma3n/gemma-3n-e2b-vision-qlora.yml
# text + vision + audio
axolotl train examples/gemma3n/gemma-3n-e2b-vision-audio-qlora.yml
```
--------------------------------
### Install Extra Dependency
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/smolvlm2/README.md
Install the 'num2words' library, which is an extra dependency for certain functionalities.
```bash
uv pip install num2words==0.5.14
```
--------------------------------
### Complete SwanLab Integration Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
A comprehensive configuration example demonstrating the integration of SwanLab with Axolotl for RVQ-Alpha training. This includes setting up plugins, project details, experiment naming, and training parameters.
```yaml
base_model: /path/to/your/model
model_type: Qwen2ForCausalLM
# SwanLab Integration
plugins:
- axolotl.integrations.swanlab.SwanLabPlugin
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
use_swanlab: true
swanlab_project: RVQ-Alpha-Training
swanlab_experiment_name: Qwen2.5-7B-MetaQA-Perturb-P020
swanlab_description: "Training on MetaQA and Perturbation datasets with NEW-RVQ encoding"
swanlab_mode: cloud
swanlab_workspace: single-cell-genomics
# Training configuration
sequence_len: 32768
micro_batch_size: 1
gradient_accumulation_steps: 1
num_epochs: 2
learning_rate: 2e-5
optimizer: adamw_torch_fused
# Datasets
datasets:
- path: /path/to/dataset
type: chat_template
# Output
output_dir: ./outputs
```
--------------------------------
### Download Example Dataset Image
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/magistral/vision/README.md
Download a sample image to be used with the vision fine-tuning dataset.
```bash
wget https://huggingface.co/datasets/Nanobit/text-vision-2k-test/resolve/main/African_elephant.jpg
```
--------------------------------
### Install XIELU CUDA
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/apertus/README.md
Installs the XIELU CUDA package from GitHub. This is recommended for reduced VRAM usage and faster speeds. Ensure CUDA toolkit is correctly pointed to by CUDA_HOME.
```bash
## Recommended for reduced VRAM and faster speeds
# Point to CUDA toolkit directory
# For those using our Docker image, use the below path.
export CUDA_HOME=/usr/local/cuda
uv pip install git+https://github.com/nickjbrowning/XIELU@59d6031 --no-build-isolation --no-deps
```
--------------------------------
### Quick Start LoRA with Performance Profiling
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/swanlab/README.md
Execute standard LoRA fine-tuning with SwanLab's automatic performance profiling. Set SWANLAB_API_KEY.
```bash
export SWANLAB_API_KEY=your-api-key
accelerate launch -m axolotl.cli.train examples/swanlab/lora-swanlab-profiling.yml
```
--------------------------------
### Launch GRPO Training with vLLM
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Commands to launch GRPO training using vLLM. Terminal 1 starts the vLLM server, and Terminal 2 starts the trainer.
```bash
# Terminal 1 — start vLLM server on GPU 0
CUDA_VISIBLE_DEVICES=0 axolotl vllm-serve config.yaml
# Terminal 2 — start trainer on GPU 1
CUDA_VISIBLE_DEVICES=1 axolotl train config.yaml
```
--------------------------------
### Basic Cloud Sync Configuration
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
Example YAML configuration for enabling basic cloud synchronization with SwanLab.
```yaml
plugins:
- axolotl.integrations.swanlab.SwanLabPlugin
use_swanlab: true
swanlab_project: llama-finetune
swanlab_experiment_name: llama-3-8b-instruct-v1
swanlab_mode: cloud
```
--------------------------------
### Install Axolotl with uv
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/README.md
Install Axolotl and its dependencies using uv. Ensure you have Python 3.12 and PyTorch 2.9.1 or newer. This example installs the deepspeed extra.
```bash
# install uv if you don't already have it installed (restart shell after)
curl -LsSf https://astral.sh/uv/install.sh | sh
# change depending on system
export UV_TORCH_BACKEND=cu128
# create a new virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv pip install torch==2.10.0 torchvision
uv pip install --no-build-isolation axolotl[deepspeed]
```
--------------------------------
### Run Trinity Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/trinity/README.md
Execute the finetuning process for the Trinity model using a specific QLoRA configuration. This command initiates the training process with the provided YAML configuration file.
```bash
axolotl train examples/trinity/trinity-nano-preview-qlora.yaml
```
--------------------------------
### Run MiMo Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/mimo/README.md
Execute the fine-tuning process for MiMo models using a specified configuration file. This command utilizes QLoRA for efficient fine-tuning and requires approximately 17.2 GiB of VRAM.
```bash
axolotl train examples/mimo/mimo-7b-qlora.yaml
```
--------------------------------
### Run Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/devstral/README.md
Executes the fine-tuning process using Axolotl with a specified configuration file. This command initiates the training job for the Devstral model.
```bash
axolotl train examples/devstral/devstral-small-qlora.yml
```
--------------------------------
### Run Qwen3-Next Finetuning
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/qwen3-next/README.md
Executes the fine-tuning process for Qwen3-Next using a specified configuration file. This command initiates the training with approximately 47 GiB of VRAM (or 71 GiB with target experts).
```bash
axolotl train examples/qwen3-next/qwen3-next-80b-a3b-qlora.yaml
```
--------------------------------
### Install Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/LiquidAI/README.md
Installs the Axolotl library using pip. Ensure a compatible PyTorch version is installed beforehand.
```bash
# Ensure you have a compatible version of Pytorch installed
uv pip install --no-build-isolation 'axolotl>=0.16.1'
```
--------------------------------
### Install Axolotl from Main
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/granite4/README.md
Installs Axolotl from its main branch using pip. Ensure PyTorch (v2.9.1 minimum) is installed beforehand. This also includes installing the Cut Cross Entropy (CCE) component.
```bash
git clone https://github.com/axolotl-ai-cloud/axolotl.git
cd axolotl
uv pip install --no-build-isolation -e '.'
python scripts/cutcrossentropy_install.py | sh
```
--------------------------------
### Install SwanLab Package
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
If you encounter an 'SwanLab is not installed' error, install the package using pip. Version 0.3.0 or higher is recommended.
```bash
pip install swanlab
# or
pip install swanlab>=0.3.0
```
--------------------------------
### Troubleshoot causal-conv1d installation
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/LiquidAI/README.md
Uninstalls the `causal-conv1d` package if installation errors like `ImportError` or `ModuleNotFoundError` occur, indicating an incorrect installation.
```bash
uv pip uninstall causal-conv1d
```
--------------------------------
### Run SmolVLM2 Finetuning Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/smolvlm2/README.md
Execute the fine-tuning process for a SmolVLM2 model using a LoRA SFT configuration. This command initiates the training job.
```bash
# LoRA SFT (1x48GB @ 6.8GiB)
axolotl train examples/smolvlm2/smolvlm2-2B-lora.yaml
```
--------------------------------
### Install Axolotl and Dependencies
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/seed-oss/README.md
Install Axolotl from pip and the Cut Cross Entropy script. Ensure a compatible PyTorch version is installed beforehand.
```bash
# Ensure you have a compatible version of Pytorch installed
uv pip install --no-build-isolation 'axolotl>=0.16.1'
# Install Cut Cross Entropy
python scripts/cutcrossentropy_install.py | sh
```
--------------------------------
### Run Text + Vision Finetuning
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/mistral-medium-3_5/README.md
Execute the finetuning process for models that handle both text and vision data, using the specified QLoRA configuration. Ensure the dataset includes image files.
```bash
# wget https://huggingface.co/datasets/Nanobit/text-vision-2k-test/resolve/main/African_elephant.jpg
axolotl train examples/mistral-medium-3_5/qlora-vision.yml # ~80.3 GiB
```
--------------------------------
### Install Cut Cross Entropy from Pip
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/cut_cross_entropy/README.md
Install the cut-cross-entropy package from pip, ensuring to uninstall any existing version first. This command installs from a specific Git commit.
```bash
pip3 uninstall -y cut-cross-entropy && pip3 install "cut-cross-entropy[transformers] @ git+https://github.com/axolotl-ai-cloud/ml-cross-entropy.git@fec1a88"
```
--------------------------------
### Install Audio and Custom Cross-Entropy Libraries
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/voxtral/README.md
Installs the librosa library for audio processing and the mistral_common package. It also includes instructions to install the Cut Cross-Entropy (CCE) module.
```bash
# audio
uv pip install librosa==0.11.0
uv pip install 'mistral_common[audio]==1.8.3'
# Install CCE https://docs.axolotl.ai/docs/custom_integrations.html#cut-cross-entropy
python scripts/cutcrossentropy_install.py | sh
```
--------------------------------
### Run Plano-4B QLoRA Finetuning
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/plano/README.md
Execute the fine-tuning process for the Plano-4B model using QLoRA. Ensure Axolotl and Cut Cross Entropy are installed prior to running.
```bash
axolotl train examples/plano/plano-4b-qlora.yaml
```
--------------------------------
### Run Kimi Linear Finetuning with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/kimi-linear/README.md
Execute the finetuning process for Kimi Linear using a specified Axolotl configuration file. This command requires Axolotl and CCE to be installed.
```bash
axolotl train examples/kimi-linear/kimi-48b-lora.yaml
```
--------------------------------
### Keep Only Wandb Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
This example demonstrates disabling SwanLab and other loggers to keep only Wandb active.
```yaml
# Option 2: Keep only Wandb
use_swanlab: false
use_wandb: true
wandb_project: my-project
```
--------------------------------
### Example YAML Configuration for Bradley Terry
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/prompt_strategies/bradley_terry/README.md
This YAML configuration demonstrates how to set up a dataset using the Bradley Terry prompt strategy. Specify the chat template and dataset path for preference learning.
```yaml
chat_template: gemma
datasets:
- path: argilla/distilabel-intel-orca-dpo-pairs
type: bradley_terry.chat_template
val_set_size: 0.0
output_dir: ./outputs/out
```
--------------------------------
### Install Vision Library
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/magistral/vision/README.md
Install the required vision library for Mistral-common. Ensure you are using the correct version.
```bash
uv pip install 'mistral-common[opencv]==1.8.5'
```
--------------------------------
### Debug Preprocessing Output Example
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Example output from the debug preprocessing command, indicating which tokens are masked from the loss (label=-100).
```text
# Output: (1, 1) Hello(22557, 22557) goodbye(-100, 1179) farewell(19111, 19111) (2, 2)
# Tokens with label=-100 are masked from the loss
```
--------------------------------
### Install Specific SwanLab Version
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
Install a specific version of SwanLab, ensuring it is version 0.3.0 or higher for Lark plugin support.
```bash
pip install 'swanlab>=0.3.0'
```
--------------------------------
### Run Text-Only Finetuning
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/mistral-medium-3_5/README.md
Execute the text-only finetuning process using the provided QLoRA configuration file. This command is suitable for models trained solely on text data.
```bash
axolotl train examples/mistral-medium-3_5/qlora-text.yml # ~83.1 GiB
```
--------------------------------
### Launch QLoRA Training for Llama-2
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/llama-2/README.md
Use this command to start training a Llama-2 model with QLoRA fine-tuning. Ensure you have the correct configuration file (e.g., qlora.yml) specified.
```shell
accelerate launch -m axolotl.cli.train examples/llama-2/qlora.yml
```
--------------------------------
### Install Axolotl with LLMCompressor Extras
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/llm_compressor/README.md
Install Axolotl with the necessary dependencies for LLMCompressor integration. Ensure you have llmcompressor version 0.5.1 or higher.
```bash
pip install "axolotl[llmcompressor]"
```
--------------------------------
### Install Flash Linear Attention
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/qwen3-next/README.md
Installs Flash Linear Attention, a dependency for improved performance. Ensure causal-conv1d is uninstalled first.
```bash
uv pip uninstall causal-conv1d && uv pip install flash-linear-attention==0.4.1
```
--------------------------------
### Run InternVL Finetuning with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/internvl3_5/README.md
Execute the fine-tuning process for InternVL 3.5 using a QLoRA configuration file. This command initiates the training job with specified parameters.
```bash
axolotl train examples/internvl3_5/internvl3_5-8b-qlora.yml
```
--------------------------------
### Install Mamba-SSM and Causal-Conv1D Kernels
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/nemotron-h/README.md
Install the necessary libraries for fast Mamba2 CUDA kernels. This is a prerequisite for using the Nemotron-H model.
```bash
pip install mamba-ssm causal-conv1d # fast Mamba2 CUDA kernels
```
--------------------------------
### Set Up NeMo Gym Environment
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/nemo_gym/README.md
Clone the NeMo Gym repository, create a virtual environment using uv, and install dependencies. Includes a fix for pycosat compilation issues with GCC 13+.
```bash
git clone https://github.com/NVIDIA-NeMo/Gym.git ~/Gym
cd ~/Gym
uv venv --python 3.12 && source .venv/bin/activate && uv sync
# Fix pycosat build (GCC 13+)
CFLAGS="" uv pip install pycosat --python .venv/bin/python --no-build-isolation
# Pre-build resource server venvs
for dir in resources_servers/reasoning_gym resources_servers/example_single_tool_call responses_api_models/vllm_model responses_api_agents/simple_agent; do
uv venv --seed --allow-existing --python 3.12 $dir/.venv
CFLAGS="" uv pip install --python $dir/.venv/bin/python pycosat --no-build-isolation 2>/dev/null
uv pip install --python $dir/.venv/bin/python -e . "ray[default]==2.52.1"
done
# Install extra deps for reasoning_gym
uv pip install --python resources_servers/reasoning_gym/.venv/bin/python \
reasoning-gym matplotlib pillow cycler contourpy kiwisolver
```
--------------------------------
### Install Vision Library
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/ministral3/vision/README.md
Install the required vision library for Mistral models using pip. Ensure you are using a virtual environment.
```bash
uv pip install 'mistral-common[opencv]==1.8.6'
```
--------------------------------
### Axolotl Training Configuration Example
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/AGENTS.md
A sample YAML configuration file for setting up an LLM training run. Specify the base model, adapter type, dataset, and output directory.
```yaml
base_model: meta-llama/Llama-3.1-8B-Instruct
adapter: lora # or qlora, or omit for full fine-tune
datasets:
- path: my_dataset
type: chat_template # prompt strategy (see docs/dataset-formats/)
output_dir: ./outputs/lora-out
```
--------------------------------
### Install timm for Vision Model Support
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/internvl3_5/README.md
Install the 'timm' library, version 1.0.19, which is required for vision model support in Axolotl.
```bash
uv pip install timm==1.0.19
```
--------------------------------
### Start vLLM Server with Axolotl
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Launch a vLLM inference server using `axolotl vllm-serve` for fast rollout generation, typically used with the GRPO trainer. Ensure the server runs on a separate GPU from the trainer.
```bash
# Start vLLM on GPU 0
CUDA_VISIBLE_DEVICES=0 axolotl vllm-serve config.yaml
```
```bash
# Trainer on GPU 1 (separate terminal)
CUDA_VISIBLE_DEVICES=1 axolotl train config.yaml
```
--------------------------------
### Start Local SwanLab Dashboard
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/swanlab/README.md
Command to start the local SwanLab dashboard for viewing experiments. It will typically be accessible at http://localhost:5092.
```bash
swanlab watch ./swanlog
# Open browser to http://localhost:5092
```
--------------------------------
### SonicMoE Installation Command
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/src/axolotl/integrations/kernels/README.md
Install SonicMoE and its dependencies using pip. This command is designed to bypass Python version checks for broader compatibility.
```bash
pip install --ignore-requires-python --no-deps "sonic-moe @ git+https://github.com/Dao-AILab/sonic-moe.git@116e2df0a41874f77fa0ad269ce7df3f0cfcb956" && pip install nvidia-cutlass-dsl==4.4.0 quack-kernels==0.2.5
```
--------------------------------
### Verify SwanLab Installation
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/swanlab/README.md
Check if SwanLab is installed in your current Python environment using `pip show`. This helps in troubleshooting initialization issues.
```bash
# Verify SwanLab is installed
pip show swanlab
```
--------------------------------
### Template-Free Dataset JSON Example
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Example JSONL format for template-free datasets, where each segment has a 'label' controlling loss masking and 'text' containing the content.
```json
{
"segments": [
{"label": true, "text": "Hello\n"},
{"label": true, "text": "hi there!. "},
{"label": false, "text": "goodbye "},
{"label": true, "text": "farewell"}
]
}
```
--------------------------------
### Run QLoRA Finetuning with Axolotl
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/glm47-flash/README.md
Execute QLoRA fine-tuning. Use 'target experts' for potentially higher VRAM usage but better performance. Without 'target experts', it requires less VRAM.
```bash
axolotl train examples/glm47-flash/qlora.yaml
```
```bash
axolotl train examples/glm47-flash/qlora_fsdp.yaml
```
--------------------------------
### Chat Template Dataset JSON Example
Source: https://context7.com/axolotl-ai-cloud/axolotl/llms.txt
Example JSONL format for chat template datasets, where each line represents a conversation with mapped roles and content.
```json
{
"conversations": [
{"from": "system", "value": "You are a helpful assistant."},
{"from": "human", "value": "What is 2+2?"},
{"from": "gpt", "value": "2+2 equals 4."}
]
}
```
--------------------------------
### Run Qwen3 8B with FSDP + TP + CP
Source: https://github.com/axolotl-ai-cloud/axolotl/blob/main/examples/distributed-parallel/README.md
Use this command to train Qwen3 8B with FSDP, Tensor Parallelism, and Context Parallelism on a single 8-GPU node.
```bash
axolotl train examples/distributed-parallel/qwen3-8b-fsdp-tp-cp.yaml
```