Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

LLaMA-Factory

$ llamafactory-cli Official Med Risk
LlamaFactory · AI & Media · Apache-2.0 · linux / macos / windows

LLaMA-Factory (llamafactory-cli) provides a unified CLI and Gradio LLaMA Board (webui) for pretraining, SFT, DPO/PPO alignment, LoRA merging (export), and serving 100+ LLMs and VLMs via YAML configs or inline flags.

FCRS-1.0 Score
71 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
pip install llamafactory
CLI vs MCP Decision CLI Only

llamafactory-cli executes local/cluster GPU fine-tuning and LoRA weight merging directly on model files.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 14 / 25

YAML/flag-driven train and export work headlessly, but webui/chat are interactive and there is no --json output.

  • Supports YAML configs for train and export; no --json output
  • webui and chat subcommands are interactive/blocking
Trust & Safety 19 / 25

Writes checkpoints locally to output_dir; optional push_to_hub in YAML can upload models to Hugging Face/ModelScope.

  • Local checkpoint output with opt-in push_to_hub
Setup & Portability 9 / 15

Available via pip install llamafactory across Linux, macOS, and Windows, though CUDA extras are required for GPU tuning.

  • PyPI package supporting PyTorch/CUDA/MPS environments
Utility & Efficiency 13 / 15

Covers 100+ LLMs/VLMs across SFT, RLHF/DPO/GRPO, LoRA export, and vLLM serving from one tool.

  • Unified train, export, eval, and api subcommands
Maintenance & Lineage 9 / 10

Widely adopted hiyouga/LlamaFactory repository under Apache-2.0.

  • Active hiyouga/LlamaFactory repository (Apache-2.0)
Docs & Verifiability 7 / 10

ReadTheDocs documentation and repo examples exist, though rapidly growing flags are best verified with --help.

  • Official docs at llamafactory.readthedocs.io and repo examples/

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

Reads HF_TOKEN or MODELSCOPE_API_TOKEN for gated checkpoints and optional WANDB_API_KEY for experiment tracking.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

Apache-2.0 open-source package; GPU hardware required for model training and quantization.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# LLaMA-Factory CLI Agent Rules
- Never run `llamafactory-cli webui` or `llamafactory-cli chat` in an agent shell—they launch blocking Gradio UIs or interactive REPLs.
- Prefer passing explicit `.yaml` configs to `llamafactory-cli train` or `export`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check LlamaFactory version and training flags
llamafactory-cli version && llamafactory-cli train --help

Prints installed version and supported SFT/DPO/LoRA flags without loading models.

Controlled Writes & Previews

Run fine-tuning from an explicit YAML config
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml

Executes a declarative YAML-configured LoRA training job into its configured output_dir.

Strengths for Agents

  • + Extensive model and algorithm matrix (SFT, DPO, PPO, LoRA/QLoRA, VLM tuning) behind one YAML schema.
  • + llamafactory-cli export cleanly merges LoRA adapters back into deployable base weights.

Caveats & Pitfalls

  • ! No --json output support; webui and chat are interactive/blocking.
  • ! Large flag surface across train requires checking --help or examples/.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI