| Crates.io | axolotl-rs |
| lib.rs | axolotl-rs |
| version | 1.1.1 |
| created_at | 2026-01-24 06:30:09.98526+00 |
| updated_at | 2026-01-25 03:03:38.675351+00 |
| description | YAML-driven configurable fine-tuning toolkit for LLMs in Rust with VSA acceleration |
| homepage | https://github.com/tzervas/axolotl-rs |
| repository | https://github.com/tzervas/axolotl-rs |
| max_upload_size | |
| id | 2066304 |
| size | 732,328 |
YAML-driven configurable fine-tuning toolkit for LLMs in Rust.
axolotl-rs is a Rust port of the Python Axolotl project, providing a framework for fine-tuning language models.
Features:
validate, train, merge, init# From crates.io
cargo install axolotl-rs
# Or from source
git clone https://github.com/tzervas/axolotl-rs
cd axolotl-rs
cargo build --release
# Create a config for LLaMA-2 7B with QLoRA
axolotl init config.yaml --preset llama2-7b
Create a JSONL file in Alpaca format:
{"instruction": "Explain quantum computing", "input": "", "output": "Quantum computing uses..."}
{"instruction": "Write a haiku about Rust", "input": "", "output": "Memory safe code\n..."}
axolotl validate config.yaml
axolotl train config.yaml
axolotl merge --config config.yaml --output ./merged-model
# config.yaml
base_model: meta-llama/Llama-2-7b-hf
adapter: qlora
# LoRA settings
lora:
r: 64
alpha: 16
dropout: 0.05
target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
# Quantization (for QLoRA)
quantization:
bits: 4
quant_type: nf4
double_quant: true
# Dataset
dataset:
path: ./data/train.jsonl
format: alpaca
max_length: 2048
val_split: 0.05
# Training
training:
epochs: 3
batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 2.0e-4
lr_scheduler: cosine
warmup_ratio: 0.03
save_steps: 500
gradient_checkpointing: true
output_dir: ./outputs/my-model
seed: 42
| Format | Description | Fields |
|---|---|---|
alpaca |
Standard Alpaca | instruction, input, output |
sharegpt |
Conversation format | conversations[{from, value}] |
completion |
Raw text | text |
custom |
User-defined | Configure input_field, output_field |
llama2-7b - LLaMA-2 7B with QLoRAmistral-7b - Mistral 7B with QLoRAphi3-mini - Phi-3 Mini with LoRA# Validate configuration
axolotl validate <config.yaml>
# Start training
axolotl train <config.yaml>
axolotl train <config.yaml> --resume ./checkpoint-1000
# Merge adapter into base model
axolotl merge --config <config.yaml> --output <path>
# Generate sample config
axolotl init <output.yaml> --preset <preset>
axolotl-rs
├── config - YAML parsing & validation
├── dataset - Data loading & preprocessing
├── model - Model loading & adapter management
└── trainer - Training loop & optimization
Dependencies:
├── candle-* - Tensor operations and transformer models
├── tokenizers - HuggingFace tokenizer bindings
├── peft-rs - LoRA/DoRA adapter support (optional)
├── qlora-rs - 4-bit quantization (optional)
└── unsloth-rs - Optimized kernels (optional)
| Flag | Description |
|---|---|
download |
Enable model downloading from HF Hub (default) |
peft |
Enable peft-rs for LoRA/DoRA adapters |
qlora |
Enable qlora-rs for 4-bit quantization |
unsloth |
Enable unsloth-rs optimized kernels |
cuda |
Enable CUDA GPU acceleration |
Porting from Python: This is a Rust port of the Python Axolotl project, designed for better performance and efficiency.
Contributions welcome! See CONTRIBUTING.md for guidelines.
Licensed under the MIT License.