Registry / ai-ml / llamafactory

llamafactory

JSON →
library0.9.5pypypiunverified

LLaMA-Factory is a unified framework for efficient fine-tuning of 100+ large language models (LLMs) including LLaMA, Mistral, Qwen, and more. Current version 0.9.5, released with frequent updates (weekly/biweekly). It supports LoRA, QLoRA, full-parameter tuning, and provides a web UI (chatbot). Requires Python >=3.11.

pip install llamafactory[torch]
INSTALL
IMPORT
SIG · LLAMAFACTORY
L
llamafactory
ai-mlpythonv0.9.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LLaMAFactory
from llamafactory import LLaMAFactory
from llamafactory import LLaMAFactory

Minimal fine-tuning with LLaMA-Factory using the modern high-level API.

import os from llamafactory import LLaMAFactory # Initialize with a minimal config factory = LLaMAFactory( model_name="llama3.2-1b", # or any supported model dataset_path="data/train.jsonl", lora_rank=8, lora_alpha=16, ) # Train (will use token from env if any) factory.train() # Save adapter factory.save_adapter("output_adapter")
Debug
Known issues
breakingIn v0.9.0, the `LLaMAFactory` class replaced the old `Trainer` object. Old code using `from llamafactory import Trainer` will break.
fix
Replace `Trainer` with `LLaMAFactory` and update method calls accordingly.
affects: >=0.9.0
gotchaThe default dataset format changed from JSON to JSONL in v0.8.5. Existing JSON datasets will not be parsed correctly.
fix
Convert your dataset to JSONL: each line is a JSON object with 'instruction', 'input' (optional), and 'output' fields.
affects: >=0.8.5
deprecatedSupport for Python 3.9 and 3.10 is deprecated since v0.9.0. Future versions will require Python >=3.11.
fix
Upgrade to Python 3.11 or higher. Check your Python version with `python --version`.
affects: >=0.9.0
gotchaLLaMA-Factory expects a `token` environment variable or huggingface token for gated models. Without it, downloads will fail silently.
fix
Set `HF_TOKEN` environment variable: `export HF_TOKEN='your_token'` or pass `token='...'` in config.
affects: all
Upgrade
Version history
0.9.5latest on PyPI · released May 30, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Resources
llamafactory — pip install llamafactory · libregistry