Skip to content

Quick Start

This guide will get you up and running with LEGIONHETO in minutes.

Basic Training Example

from legionheto import LegionHetoModel, SFTTrainer
from datasets import load_dataset

model = LegionHetoModel("unsloth/tinyllama-bnb-4bit")
model.setup_lora(r=16, alpha=32)

dataset = load_dataset("yahma/alpaca-cleaned", split="train[:1000]")

trainer = SFTTrainer(
    model=model,
    dataset=dataset,
    output_dir="./output",
    num_train_epochs=3,
    per_device_train_batch_size=4,
)

trainer.train()

Using the CLI

Train from command line:

legionheto train \
    --model unsloth/tinyllama-bnb-4bit \
    --dataset yahma/alpaca-cleaned \
    --output ./output \
    --epochs 3 \
    --batch-size 4

Export to GGUF

After training, export to GGUF format:

legionheto export \
    --model ./output \
    --output ./model.gguf \
    --format gguf \
    --quantization Q4_K_M

Next Steps

  • Read the full Training Guide
  • Learn about Model Merging
  • Explore the API Reference