Note
本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
免费开源的 LLM 微调(Fine-tuning)框架
quantize_moe_experts: true)可在训练 MoE 模型时大幅降低 VRAM(兼容 FSDP2)。torchao,Axolotl 现已支持带 fp8 gather op 的 FP8 微调。入门请见此处!Axolotl 是一款免费开源工具,旨在简化最新大语言模型(LLM)的后训练与微调流程。
功能特性:
环境要求:
bf16 和 Flash Attention)或 AMD GPU# install uv if you don't already have it installed (restart shell after)
curl -LsSf https://astral.sh/uv/install.sh | sh
# change depending on system
export UV_TORCH_BACKEND=cu130
# create a new virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv pip install torch==2.12.0 torchvision
uv pip install --no-build-isolation axolotl[deepspeed]
# Download example axolotl configs, deepspeed configs
axolotl fetch examples
axolotl fetch deepspeed_configs # OPTIONAL
使用 Docker 安装通常比在本机环境中安装更少出错。
docker run --gpus '"all"' --ipc=host --rm -it axolotlai/axolotl:main-latest
其他安装方式见此处.
# Fetch axolotl examples
axolotl fetch examples
# Or, specify a custom path
axolotl fetch examples --dest path/to/folder
# Train a model using LoRA
axolotl train examples/llama-3/lora-1b.yml
就这么简单!请参阅我们的入门指南 获取更详细的教程。
Axolotl 内置面向 AI 编程助手(Claude Code、Cursor、Copilot 等)优化的文档。这些文档随 pip 包一并提供,无需克隆仓库。
# Show overview and available training methods
axolotl agent-docs
# Topic-specific references
axolotl agent-docs sft # supervised fine-tuning
axolotl agent-docs grpo # GRPO online RL
axolotl agent-docs preference_tuning # DPO, KTO, ORPO, SimPO
axolotl agent-docs reward_modelling # outcome and process reward models
axolotl agent-docs pretraining # continual pretraining
axolotl agent-docs --list # list all topics
# Dump config schema for programmatic use
axolotl config-schema
axolotl config-schema --field adapter
如果你在使用源码仓库,agent 文档也可在 docs/agents/ 找到,项目概览见 AGENTS.md。
欢迎贡献!详情请参阅我们的贡献指南。
Axolotl 提供可退出的遥测功能,帮助我们了解项目使用情况并确定改进优先级。我们收集基本系统信息、模型类型和错误率,绝不收集个人数据或文件路径。遥测默认开启。要禁用,请设置 AXOLOTL_DO_NOT_TRACK=1。更多详情请参阅我们的遥测文档.
有兴趣赞助?请联系 wing@axolotl.ai
如果你在研究或项目中使用了 Axolotl,请按如下方式引用:
@software{axolotl,
title = {Axolotl: Open Source LLM Post-Training},
author = {{Axolotl maintainers and contributors}},
url = {https://github.com/axolotl-ai-cloud/axolotl},
license = {Apache-2.0},
year = {2023}
}
本项目采用 Apache 2.0 许可证 — 详见 LICENSE 文件。