OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  代码  ›  Axolotl — LLM 微调框架

Axolotl — LLM 微调框架

 
  logging ·  2026-02-28 00:42:39 · 3 次点击  · 0 条评论  

Axolotl

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

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

🎉 最新动态

展开查看更多历史更新 - 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年06月:支持 mistral-common 分词器的 Magistral 已添加到 Axolotl。查看[文档](https://docs.axolotl.ai/docs/models/magistral.html),开始使用 Axolotl 训练你自己的 Magistral 模型! - 2025年04月:Axolotl 已添加 Llama 4 支持。查看[文档](https://docs.axolotl.ai/docs/models/llama-4.html),开始使用 Axolotl 的线性化版本训练你自己的 Llama 4 模型! - 2025年03月:(测试版)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,以及支持图像、视频和音频的音频模型,如 Voxtral。
  • 训练方法:全参数微调、LoRA、QLoRA、GPTQ、QAT、偏好调优(DPO、IPO、KTO、ORPO)、强化学习(GRPO)以及奖励建模(RM)/过程奖励建模(PRM)。
  • 简易配置:在完整的微调流程(数据集预处理、训练、评估、量化和推理)中复用单个 YAML 配置文件。
  • 性能优化多包处理Flash AttentionXformersFlex AttentionLiger KernelCut Cross Entropy序列并行(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)

你的第一次微调

# 获取 axolotl 示例
axolotl fetch examples

# 或者,指定自定义路径
axolotl fetch examples --dest path/to/folder

# 使用 LoRA 训练一个模型
axolotl train examples/llama-3/lora-1b.yml

就这么简单!查看我们的入门指南获取更详细的步骤说明。

📚 文档

🤝 获取帮助

🌟 贡献

欢迎贡献!请参阅我们的贡献指南了解详情。

📈 遥测

Axolotl 包含可选的遥测功能,帮助我们了解项目的使用情况并确定改进的优先级。我们收集基本的系统信息、模型类型和错误率——从不收集个人数据或文件路径。遥测功能默认启用。要禁用它,请设置 AXOLOTL_DO_NOT_TRACK=1。更多详情,

3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor