Axolotl Skill for Hermes Agent: YAML LLM Fine-Tuning (LoRA, DPO, GRPO)
Axolotl: YAML LLM fine-tuning (LoRA, DPO, GRPO).
Written by Neura Market from the official Hermes Agent documentation for Axolotl. Commands, paths, and version numbers are reproduced from the source unchanged.
Read the official documentationThe Axolotl skill gives Hermes Agent the ability to guide you through fine-tuning large language models with Axolotl. You would reach for this when you need to configure LoRA, QLoRA, or preference tuning (DPO, KTO, ORPO, GRPO) and want expert-level advice on YAML configs, dataset formatting, and distributed training setup.
What it does
This skill turns Hermes Agent into a fine-tuning assistant. It can answer questions about Axolotl features, help you debug training code, explain best practices, and provide ready-to-use configuration patterns. The skill was generated from the official Axolotl documentation, so the advice it gives stays close to what the upstream project recommends.
Before you start
- The skill is optional and installed on demand. It lives at
optional-skills/mlops/training/axolotl. - It runs on Linux and macOS. Windows is not listed as a supported platform.
- You need a working Python environment where Axolotl and its dependencies (PyTorch, Hugging Face Transformers, DeepSpeed, etc.) are installed. The skill does not install these for you.
- For multi-GPU training, NCCL tests are recommended to validate data transfer speeds before starting a job.
Quick reference patterns
These are the common patterns the skill knows. Each one addresses a specific configuration or debugging need.
Pattern 1: Validate inter-node bandwidth with NCCL tests
Before you run a distributed training job, check that your GPUs can communicate efficiently. The NCCL all-reduce performance test is the standard way to find bottlenecks:
./build/all_reduce_perf -b 8 -e 128M -f 2 -g 3
Pattern 2: Configure FSDP in your Axolotl YAML
Fully Sharded Data Parallelism (FSDP) is the recommended strategy for training large models. Add this block to your config:
fsdp_version: 2
fsdp_config:
offload_params: true
state_dict_type: FULL_STATE_DICT
auto_wrap_policy: TRANSFORMER_BASED_WRAP
transformer_layer_cls_to_wrap: LlamaDecoderLayer
reshard_after_forward: true
Pattern 3: Context parallel size must divide GPU count
When using context parallelism, the value you set must be a divisor of the total number of GPUs available. The config key is:
context_parallel_size
Pattern 4: How context parallelism affects batch size
With 8 GPUs and no sequence parallelism, each step processes 8 different batches. With context_parallel_size=4, only 2 different batches are processed per step because each batch is split across 4 GPUs. If your per-GPU micro_batch_size is 2, the global batch size drops from 16 to 4.
context_parallel_size=4
Pattern 5: Compress saved models
Enable compression to reduce disk usage by roughly 40% while keeping compatibility with vLLM and llmcompressor:
save_compressed: true
Pattern 6: Custom integrations can live anywhere
You do not have to place a custom integration inside the integrations folder. Any Python package installed in your environment works. See the diff-transformer repo for an example: https://github.com/axolotl-ai-cloud/diff-transformer
integrations
Pattern 7: Handling sequence length in custom datasets
The helper function drop_long_seq handles both single-example and batched data. For a single example, sample['input_ids'] is a list of ints. For batched data, it is a list of lists.
utils.trainer.drop_long_seq(sample, sequence_len=2048, min_sequence_len=2)
Example code patterns
These Python snippets show how to instantiate key Axolotl classes from code. They are useful when you are writing custom training scripts or extending the framework.
Example 1 (python):
cli.cloud.modal_.ModalCloud(config, app=None)
Example 2 (python):
cli.cloud.modal_.run_cmd(cmd, run_folder, volumes=None)
Example 3 (python):
core.trainers.base.AxolotlTrainer(
*_args,
bench_data_collator=None,
eval_data_collator=None,
dataset_tags=None,
**kwargs,
)
Example 4 (python):
core.trainers.base.AxolotlTrainer.log(logs, start_time=None)
Example 5 (python):
prompt_strategies.input_output.RawInputOutputPrompter()
Reference files
The skill ships with three reference documents inside the references/ directory:
- api.md, API documentation
- dataset-formats.md, Dataset format specifications
- other.md, Miscellaneous documentation
Use the view command to read these files when you need detailed information beyond what the quick reference provides.
Working with this skill
For beginners
Start with the getting_started or tutorials reference files. They cover the foundational concepts you need before writing your first config.
For specific features
Pick the appropriate category reference file (api, guides, etc.) for detailed explanations and examples.
For code examples
The quick reference section above contains common patterns extracted from the official docs. Use them as starting points for your own configs.
Resources
references/
Organized documentation extracted from official sources. These files contain detailed explanations, code examples with language annotations, links to original documentation, and a table of contents for quick navigation.
scripts/
A directory where you can add helper scripts for common automation tasks.
assets/
A directory for templates, boilerplate, or example projects.
Notes
- This skill was automatically generated from official documentation.
- Reference files preserve the structure and examples from source docs.
- Code examples include language detection for better syntax highlighting.
- Quick reference patterns are extracted from common usage examples in the docs.
Updating
To refresh this skill with updated documentation:
- Re-run the scraper with the same configuration.
- The skill will be rebuilt with the latest information.
When not to use it
The source does not list explicit alternatives or exclusions. However, if you are not working with Axolotl specifically (for example, you are using a different fine-tuning framework like Hugging Face Trainer directly, or you need inference-only capabilities), this skill will not be relevant.
Limits and gotchas
- The skill is generated from documentation, not from live code. It cannot inspect your environment or validate your configs against actual hardware.
- The reference files are snapshots. If Axolotl releases a new version, the skill may be out of date until you re-run the scraper.
- The patterns shown assume you already have Axolotl and its dependencies installed. The skill does not handle installation.
What pairs with this
This skill lives under the MLOps category in Hermes Agent. It works well alongside other MLOps skills that handle dataset preparation, model evaluation, or deployment. Check the Hermes Agent documentation for related skills in the same category.