OA0
OA0 是一个探索 AI 的社区
现在注册
已注册用户请  登录
OA0  ›  代码  ›  Axolotl — 适合指令微调与 LoRA 训练的轻量工具链

Axolotl — 适合指令微调与 LoRA 训练的轻量工具链

 
  container ·  2026-02-20 11:18:20 · 6 次点击  · 0 条评论  

Axolotl

一个免费开源的大语言模型微调框架

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

🎉 最新动态

展开查看更早的更新 - 2025年09月:Axolotl 现已支持文本扩散训练。详情请见[此处](https://github.com/axolotl-ai-cloud/axolotl/tree/main/src/axolotl/integrations/diffusion)。 - 2025年08月:QAT 已更新,包含 NVFP4 支持。参见 [PR](https://github.com/axolotl-ai-cloud/axolotl/pull/3107)。 - 2025年07月: - Axolotl 新增 ND 并行支持。可在单节点和多节点内组合使用上下文并行(CP)、张量并行(TP)和全分片数据并行(FSDP)。查看[博客文章](https://huggingface.co/blog/accelerate-nd-parallel)了解更多信息。 - Axolotl 新增更多模型:[GPT-OSS](https://docs.axolotl.ai/docs/models/gpt-oss.html)、[Gemma 3n](https://docs.axolotl.ai/docs/models/gemma3n.html)、[Liquid Foundation Model 2 (LFM2)](https://docs.axolotl.ai/docs/models/LiquidAI.html) 和 [Arcee Foundation Models (AFM)](https://docs.axolotl.ai/docs/models/arcee.html)。 - 现在可以通过 `torchao` 在 Axolotl 中进行 FP8 微调(使用 fp8 gather 操作)。[从这里开始](https://docs.axolotl.ai/docs/mixed_precision.html#sec-fp8)! - Axolotl 已集成 [Voxtral](https://docs.axolotl.ai/docs/models/voxtral.html)、[Magistral 1.1](https://docs.axolotl.ai/docs/models/magistral.html) 和 [Devstral](https://docs.axolotl.ai/docs/models/devstral.html)(支持 mistral-common 分词器)! - 新增 TiledMLP 支持,用于单 GPU 到多 GPU 训练(支持 DDP、DeepSpeed 和 FSDP),以支持 Arctic 长序列训练(ALST)。查看[示例](https://github.com/axolotl-ai-cloud/axolotl/tree/main/examples/alst),了解如何在 Axolotl 中使用 ALST! - 2025年06月:Axolotl 新增支持 mistral-common 分词器的 Magistral 模型。查看[文档](https://docs.axolotl.ai/docs/models/magistral.html),开始使用 Axolotl 训练你自己的 Magistral 模型! - 2025年05月:Axolotl 新增量化感知训练(QAT)支持。探索[文档](https://docs.axolotl.ai/docs/qat.html)了解更多! - 2025年04月:Axolotl 新增 Llama 4 支持。查看[文档](https://docs.axolotl.ai/docs/models/llama-4.html),开始使用 Axolotl 的线性化版本训练你自己的 Llama 4 模型! - 2025年03月:Axolotl 已实现序列并行(SP)支持。阅读[博客](https://huggingface.co/blog/axolotl-ai-co/long-context-with-sequence-parallelism-in-axolotl)和[文档](https://docs.axolotl.ai/docs/sequence_parallelism.html),了解如何在微调时扩展上下文长度。 - 2025年03月:(Beta 版)Axolotl 现已支持多模态模型微调。查看[文档](https://docs.axolotl.ai/docs/multimodal.html),微调你自己的模型! - 2025年02月:Axolotl 新增 LoRA 优化,以降低内存使用并提升单 GPU 和多 GPU 训练(DDP 和 DeepSpeed)中 LoRA 和 QLoRA 的训练速度。跳转至[文档](https://docs.axolotl.ai/docs/lora_optims.html)尝试一下。 - 2025年02月:Axolotl 新增 GRPO 支持。深入阅读我们的[博客](https://huggingface.co/blog/axolotl-ai-co/training-llms-w-interpreter-feedback-wasm)和 [GRPO 示例](https://github.com/axolotl-ai-cloud/grpo_code),体验乐趣! - 2025年01月:Axolotl 新增奖励建模 / 过程奖励建模微调支持。参见[文档](https://docs.axolotl.ai/docs/reward_modelling.html)。

✨ 概述

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、QAT、偏好调优(DPO、IPO、KTO、ORPO)、强化学习(GRPO、GDPO)以及奖励建模(RM)/过程奖励建模(PRM)。
  • 简易配置:在整个微调流程(数据集预处理、训练、评估、量化和推理)中复用单个 YAML 配置文件。
  • 性能优化多包处理Flash AttentionXformersFlex AttentionSageAttentionLiger KernelCut Cross EntropyScatterMoE序列并行(SP)LoRA 优化多 GPU 训练(FSDP1、FSDP2、DeepSpeed)多节点训练(Torchrun、Ray) 以及更多!
  • 灵活的数据集处理:从本地、HuggingFace 以及云端(S3、Azure、GCP、OCI)数据集加载。
  • 云就绪:我们提供 Docker 镜像PyPI 包,便于在云平台和本地硬件上使用。

🚀 快速开始 - 几分钟内开始 LLM 微调

要求

  • NVIDIA GPU(Ampere 或更新架构以支持 bf16 和 Flash Attention)或 AMD GPU
  • Python 3.11
  • PyTorch ≥2.8.0

Google Colab

Open In Colab

安装

使用 pip

pip3 install -U packaging==26.0 setuptools==75.8.0 wheel ninja
pip3 install --no-build-isolation axolotl[flash-attn,deepspeed]

# 下载示例 axolotl 配置和 deepspeed 配置
axolotl fetch examples
axolotl fetch deepspeed_configs  # 可选

使用 Docker

使用 Docker 安装比在自有环境中安装更不易出错。

docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest

其他安装方法详见此处

云服务提供商

- [RunPod](https://runpod.io/gsc?template=v2ickqhz9s&ref=6i7fkpdz) - [Vast.ai](https://cloud.vast.ai?ref_id=62897&template_id=bdd4a49fa8bce926defc99471864cace&utm_source=github&utm_medium=developer_community&utm_campaign=template_launch_axolotl&utm_content=readme) - [PRIME Intellect](https://app.primeintellect.ai/dashboard/create-cluster?image=axolotl&location=Cheapest&security=Cheapest&show_spot=true) - [Modal](https://www.modal.com?utm_source=github&utm_medium=github&utm_campaign=axolotl) - [Novita](https://novita.ai/gpus-console?templateId=311) - [JarvisLabs.ai](https://jarvislabs.ai/templates/axolotl) - [Latitude.sh](https://latitude.sh/blueprint/989e0e79-3bf6-41ea-a46b-1f246e309d5c)
6 次点击  ∙  0 人收藏  
登录后收藏  
0 条回复
关于 ·  帮助 ·  PING ·  隐私政策 ·  服务条款   
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
耗时 47 ms
Developed with Cursor