项目文件夹

0
wehub-resource-sync 91b31eba41
Publish Docs / build-deploy (push) Has been cancelled
ci-cd / build-axolotl-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-no-tmux-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-no-tmux-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
docs: make Chinese README the default
2026-07-13 10:47:46 +00:00

Note

本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。

Axolotl

免费开源的 LLM 微调(Fine-tuning)框架

GitHub License tests codecov Releases
contributors GitHub Repo stars
discord twitter google-colab
docker-e2e-tests tests-nightly multigpu-semi-weekly tests

🎉 最新更新

展开更早的更新
  • 2026/02:
    • ScatterMoE LoRA 支持。使用自定义 Triton 内核直接在 MoE 专家权重上进行 LoRA 微调。
    • Axolotl 现已支持 SageAttention and GDPOGeneralized DPO)。
  • 2026/01:
    • 新增 EAFTEntropy-Aware Focal Training)集成,按 top-k logit 分布的熵对 loss 加权;Scalable Softmax, 可改善注意力机制中的长上下文表现。
  • 2025/12:
  • 2025/10: Axolotl 新增对以下模型的支持:Qwen3 Next, Qwen2.5-vl, Qwen3-vl, Qwen3, Qwen3MoE, Granite 4, HunYuan, Magistral 2509, Apertus, and Seed-OSS.
  • 2025/09: Axolotl 现已支持文本扩散(text diffusion)训练。了解更多请见此处.
  • 2025/08: QAT 已更新以包含 NVFP4 支持。参见 PR.
  • 2025/07:
    • ND Parallelism 支持已加入 Axolotl。在单节点及多节点上组合 Context Parallelism (CP)、Tensor Parallelism (TP) 和 Fully Sharded Data Parallelism (FSDP)。更多信息请查看博客文章
    • Axolotl 新增更多模型:GPT-OSS, Gemma 3n, Liquid Foundation Model 2 (LFM2), and Arcee Foundation Models (AFM).
    • 通过 torchao,Axolotl 现已支持带 fp8 gather op 的 FP8 微调。入门请见此处!
    • Voxtral, Magistral 1.1, and Devstral 已集成到 Axolotl,并支持 mistral-common tokenizer
    • 已添加 TiledMLP 支持,可在 DDP、DeepSpeed 和 FSDP 下实现单 GPU 到多 GPU 训练,以支持 Arctic Long Sequence Training (ALST)。使用 Axolotl 运行 ALST 的示例 请见此处!
  • 2025/06: Magistral 已加入 Axolotl,并支持 mistral-common tokenizer。参见文档,开始使用 Axolotl 训练你自己的 Magistral 模型!
  • 2025/05: Quantization Aware Training (QAT) 支持已加入 Axolotl。探索文档 了解更多!
  • 2025/04: Axolotl 已添加 Llama 4 支持。参见文档,开始使用 Axolotl 的 linearized 版本训练你自己的 Llama 4 模型!
  • 2025/03: Axolotl 已实现 Sequence Parallelism (SP) 支持。阅读博客 and docs 了解如何在微调时扩展上下文长度。
  • 2025/03:BetaAxolotl 现已支持多模态模型微调。查看文档 开始微调你自己的模型!
  • 2025/02: Axolotl 已添加 LoRA 优化,可在单 GPU 和多 GPU 训练(DDP 和 DeepSpeed)中降低 LoRA 与 QLoRA 的显存占用并提升训练速度。前往文档 试用。
  • 2025/02: Axolotl 已添加 GRPO 支持。阅读我们的博客 and GRPO example 开始体验!
  • 2025/01: Axolotl 已添加 Reward Modelling / Process Reward Modelling 微调支持。参见文档.

概览

Axolotl 是一款免费开源工具,旨在简化最新大语言模型(LLM)的后训练与微调流程。

功能特性:

  • 多模型支持:可训练 GPT-OSS、LLaMA、Mistral、Mixtral、Pythia 等多种模型,以及 Hugging Face Hub 上的众多其他模型。
  • 多模态训练:可微调视觉语言模型(VLM),包括 LLaMA-Vision、Qwen2-VL、Pixtral、LLaVA、SmolVLM2、GLM-4.6V、InternVL 3.5、Gemma 3n,以及 Voxtral 等支持图像、视频和音频的音频模型。
  • 训练方法:全量微调、LoRA、QLoRA、GPTQ、QATint8/int4/FP8/NVFP4/MXFP4)、FP8 混合精度训练、NVFP4/MXFP4 MoE LoRA、偏好调优(DPO、IPO、KTO、ORPO)、强化学习(GRPO、GDPO),以及奖励建模(RM)/ 过程奖励建模(PRM)。
  • 便捷配置:在整个微调流水线中复用单个 YAML 配置文件:数据集预处理、训练、评估、量化与推理。
  • 性能优化Multipacking, Flash Attention 2/3/4, Xformers, Flex Attention, SageAttention, Liger Kernel, Cut Cross Entropy, ScatterMoE, Sequence Parallelism (SP), LoRA optimizations, Multi-GPU training (FSDP1, FSDP2, DeepSpeed), Multi-node training (Torchrun, Ray), and many more!
  • 灵活的数据集处理:从本地、HuggingFace 及云端(S3、Azure、GCP、OCI)数据集加载。
  • 云就绪:提供 Docker 镜像 以及 PyPI 包,可在云平台与本地硬件上使用。

🚀 快速入门 - 数分钟内完成 LLM 微调

环境要求

  • NVIDIA GPUAmpere 或更新架构,用于 bf16 和 Flash Attention)或 AMD GPU
  • Python >=3.11(推荐 3.12
  • PyTorch ≥2.11.0

Google Colab

Open In Colab

安装

# 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 安装通常比在本机环境中安装更少出错。

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

就这么简单!请参阅我们的入门指南 获取更详细的教程。

📚 文档

AI Agent 支持

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

如果你在研究或项目中使用了 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 文件。