ai-agent

LlamaFactory: Fine-Tune AI Models

Fine-tune 100+ AI models with LlamaFactory.
74,055 stars9,060 forksPythonGuide quality 8/10Updated 8/10/2026100% free · open source
What it does

LlamaFactory allows founders to fine-tune over 100 pre-trained AI models for their specific use cases, enabling more accurate and efficient AI-powered solutions.

When to use it
  • When you need to adapt a pre-trained AI model to your specific industry or task
  • When you want to improve the performance of an AI model on a custom dataset
  • When you need to deploy AI models in a production environment with minimal expertise
Ready-to-paste prompt
Fine-tune a T5-base model on your custom dataset with `python train.py --model_name t5-base --dataset your_dataset --batch_size 16 --epochs 5`
Heads up: Make sure you have the correct version of Python (>=3.8) and the necessary GPU resources to run the model fine-tuning process, as specified in the README
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

🛠️ Technical setup

Expect 20–40 minutes in a terminal — or let your AI agent drive it.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/llamafactory && curl -fsSL https://workflowstacks.com/api/skills/llamafactory/claude-skill -o ~/.claude/skills/llamafactory/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How LlamaFactory: Fine-Tune AI Models works
Codeflow
Free to inspect

LlamaFactory: Fine-Tune AI Models is a large Python project (~55k lines across 267 code files, plus 37 test files). It is a full software project: use it through its install path rather than reading it end to end. Last commit this month, Apache-2.0 license, has a test suite.

Size
Large codebase
~55k lines · 267 code files · ~8 h to skim
Setup
Developer setup
A real software project. Use it via its install path; don't expect to read it all.
Runs on
Python
No API keys detected
Python 100%
What happens, step by step

Fine-tune AI models easily

You give
Model data
1Install Tool
Install required packages
2Prepare Data
Prepare model data
3Fine-Tune Model
Fine-tune the model
src/llamafactory/__init__.py
4Deploy Model
Deploy the model
You get
Trained model
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    CLAUDE.md
    The instructions the AI actually follows
  3. 3
    pyproject.toml
    Dependencies and the commands it exposes
  4. 4
    src/llamafactory/__init__.py
    Inside src/ — the main logic begins here
  5. 5
    examples/README.md
    A worked example — copy this to get going
What's in each folder
src/Core code — the actual logic218 files
examples/Examples you can copy107 files
docs/Documentation66 files
data/Data files35 files
requirements/Folder25 files
scripts/Helper scripts21 files
tests_v1/Folder20 files
docker/Deployment / infrastructure12 files
READMEHas testsDocumentedCI checksExamples includedApache-2.0 licenseUpdated this month
Quick Actions
Details
Creator
hiyouga
Language
Python
Category
ai-agent
Published
5/28/2023

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.