LLaMA-Factory
$ llamafactory-cli Official Med RiskLLaMA-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.
pip install llamafactory llamafactory-cli executes local/cluster GPU fine-tuning and LoRA weight merging directly on model files.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
YAML/flag-driven train and export work headlessly, but webui/chat are interactive and there is no --json output.
- Supports YAML configs for
trainandexport; no--jsonoutput webuiandchatsubcommands are interactive/blocking
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
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
Covers 100+ LLMs/VLMs across SFT, RLHF/DPO/GRPO, LoRA export, and vLLM serving from one tool.
- Unified
train,export,eval, andapisubcommands
Widely adopted hiyouga/LlamaFactory repository under Apache-2.0.
- Active
hiyouga/LlamaFactoryrepository (Apache-2.0)
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
Reads HF_TOKEN or MODELSCOPE_API_TOKEN for gated checkpoints and optional WANDB_API_KEY for experiment tracking.
Apache-2.0 open-source package; GPU hardware required for model training and quantization.
# 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
llamafactory-cli version && llamafactory-cli train --help
Prints installed version and supported SFT/DPO/LoRA flags without loading models.
Controlled Writes & Previews
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 exportcleanly merges LoRA adapters back into deployable base weights.
Caveats & Pitfalls
- ! No
--jsonoutput support;webuiandchatare interactive/blocking. - ! Large flag surface across
trainrequires checking--helporexamples/.