alpaca-lora

Fine-tune LLaMA on consumer hardware with alpaca-lora and its LoRA training approach.

github.com/tloen/alpaca-lora
alpaca-lora homepage screenshot

About alpaca-lora

alpaca-lora is an open-source repository with code to instruct-tune LLaMA models using low-rank adaptation (LoRA). It includes finetune.py for training, generate.py for inference with a Gradio interface, and export scripts that merge LoRA weights into the base model for Hugging Face format or PyTorch state_dicts. Training is described as running within hours on a single RTX 4090, and inference loads the base model from the Hugging Face hub with adapter weights from tloen/alpaca-lora-7b. The inference script is presented as example code to modify, and Dockerfile and docker-compose files are included for container use.

Key features

  • Fine-tune LLaMA models with LoRA via finetune.py
  • Run inference via Gradio using base model and LoRA weights
  • Merge LoRA weights back into base model
  • Export to Hugging Face format and PyTorch state_dicts
  • Run training and inference inside Docker container
  • Adjust training hyperparameters including LoRA rank and dropout
Best for: Researchers and developers who want to train and test Alpaca-style instruction tuning on LLaMA models.
Good for
  • Includes training code, inference script, and published LoRA weights
  • Training runs within hours on a single RTX 4090
  • Includes Docker and Docker Compose setup for training and inference
Watch out for
  • Inference script is example code users are expected to modify
  • bitsandbytes may require installation from source if standard install fails

alpaca-lora at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

alpaca-lora alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in ML Training & Optimization

Well-known listings from the same topic.

All 75

alpaca-lora FAQ

What hardware is described for training?
The training code is described as running within hours on a single RTX 4090.
Where does generate.py get models for inference?
It reads the foundation model from the Hugging Face model hub and the LoRA weights from tloen/alpaca-lora-7b.
How can LoRA weights be used in other projects?
Use the export scripts to merge LoRA weights into the base model for Hugging Face format or PyTorch state_dicts, for use in projects like llama.cpp or alpaca.cpp.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing