Skip to content

Latest commit

 

History

History
291 lines (234 loc) · 20.6 KB

File metadata and controls

291 lines (234 loc) · 20.6 KB

Open Source Large Model Usage Guide

中文 | English

  This project is a Chinese baby's exclusive large model tutorial based on the Linux platform, focusing on open source large models for domestic beginners. It provides full-process guidance including environment configuration, local deployment, and efficient fine-tuning for various open source large models. It simplifies the deployment, usage, and application processes of open source large models, enabling more ordinary students and researchers to better use open source large models, and helping open source and free large models to integrate into the lives of ordinary learners faster.

  The main contents of this project include:

  1. Open source LLM environment configuration guide based on Linux platform, providing different detailed environment configuration steps according to different model requirements;
  2. Deployment and usage tutorials for mainstream open source LLMs at home and abroad, including LLaMA, ChatGLM, InternLM, etc.;
  3. Open source LLM deployment and application guidance, including command-line invocation, online Demo deployment, LangChain framework integration, etc.;
  4. Full fine-tuning and efficient fine-tuning methods for open source LLMs, including distributed full fine-tuning, LoRA, ptuning, etc.

  The main content of this project is tutorials, letting more students and future practitioners understand and become familiar with the usage methods of open source large models! Anyone can raise issues or submit PRs to jointly build and maintain this project.

  Students who want to participate deeply can contact us, and we will add you to the project maintainers.

  Learning suggestions: The learning suggestion for this project is to first learn environment configuration, then learn model deployment and usage, and finally learn fine-tuning. Because environment configuration is the foundation, model deployment and usage are the basics, and fine-tuning is advanced. Beginners can choose models like Qwen1.5, InternLM2, MiniCPM, etc. for priority learning.

  Advanced Learning Recommendation: After studying this project, if you wish to understand the core principles of large language models more deeply and desire to train your own large model from scratch, we highly recommend focusing on another open source project from Datawhale — Happy-LLM: A Beginner's Guide to Large Language Model Principles and Practice from Scratch. This project will take you deep into exploring the underlying mechanisms of large models and mastering the complete training process.

Note: If some students want to understand the model composition of large models and write RAG, Agent, and Eval tasks from scratch, they can learn from another Datawhale project Tiny-Universe. Large models are currently a hot topic in the deep learning field, but most existing large model tutorials only teach how to call APIs to complete large model applications. Few people can clearly explain model structures, RAG, Agent, and Eval from a principled perspective. Therefore, this repository will provide all handwritten content without using API calls to complete RAG, Agent, and Eval tasks for large models.

Note: Considering that some students hope to learn the theoretical part of large models before studying this project, if they want to further learn the theoretical foundation of LLM and further understand and apply LLM based on theory, they can refer to Datawhale's so-large-llm course.

Note: If students want to develop large model applications themselves after studying this course. Students can refer to Datawhale's Hands-on Large Model Application Development course. This project is a large model application development tutorial for novice developers, aiming to present the complete large model application development process to students based on Alibaba Cloud servers combined with a personal knowledge base assistant project.

Project Significance

  What are large models?

Large models (LLM) narrowly refer to natural language processing (NLP) models trained based on deep learning algorithms, mainly applied in fields such as natural language understanding and generation. Broadly, they also include computer vision (CV) large models, multimodal large models, and scientific computing large models.

  The "Hundred Models Battle" is in full swing, and open source LLMs are emerging endlessly. Today, many excellent open source LLMs have emerged both domestically and internationally, such as LLaMA and Alpaca abroad, and ChatGLM, BaiChuan, InternLM (Shusheng·Puyu) domestically. Open source LLMs support local deployment and private fine-tuning, allowing everyone to create their own unique large model based on open source LLMs.

  However, for ordinary students and users to use these large models, certain technical capabilities are required to complete model deployment and usage. For the numerous and distinctive open source LLMs, it is a challenging task to quickly master the application methods of an open source LLM.

  This project aims to first implement deployment, usage, and fine-tuning tutorials for mainstream open source LLMs at home and abroad based on the experience of core contributors. After implementing relevant parts for mainstream LLMs, we hope to fully gather co-creators to enrich this open source LLM world and create more comprehensive tutorials for characteristic LLMs. Sparks gather to form a sea.

  We hope to become a ladder between LLMs and the general public, embracing a more magnificent and vast LLM world with a spirit of freedom and equality in open source.

Target Audience

  This project is suitable for the following learners:

  • Students who want to use or experience LLMs but have no conditions to obtain or use relevant APIs;
  • Students who hope to apply LLMs long-term, low-cost, and in large quantities;
  • Students interested in open source LLMs and want to personally work with open source LLMs;
  • NLP students who hope to further study LLMs;
  • Students who hope to combine open source LLMs to create domain-specific private LLMs;
  • And the largest and most ordinary student population.

Project Planning and Progress

  This project is organized around the entire process of open source LLM application, including environment configuration and usage, deployment applications, fine-tuning, etc. Each part covers mainstream and characteristic open source LLMs:

Example Series

  • Chat-Huanhuan: Chat-Zhenhuan is a chat language model that imitates Zhenhuan's tone, obtained by LoRA fine-tuning based on LLM using all lines and dialogues about Zhenhuan from the "Legend of Zhenhuan" script.

  • Tianji: Tianji is a comprehensive large language model system application tutorial covering social scenarios based on interpersonal relationships, including prompt engineering, intelligent agent creation, data acquisition and model fine-tuning, RAG data cleaning and usage, etc.

  • AMChat: AM (Advanced Mathematics) chat is a large language model that integrates mathematical knowledge and advanced mathematics exercises and their solutions. This model uses a dataset fused with mathematics and advanced mathematics exercises and their analysis, based on the InternLM2-Math-7B model, fine-tuned through xtuner, specifically designed to answer advanced mathematics problems.

  • Digital Life: This project will use me as a prototype, utilizing a specially crafted dataset to fine-tune a large language model, dedicated to creating an AI digital persona that can truly reflect my personality traits—including but not limited to my tone, expression patterns, and thinking modes. Therefore, whether it's daily chat or sharing emotions, it communicates in a familiar and comfortable way, as if I were right there with them. The entire process is transferable and replicable, with dataset creation as the highlight.

Supported Models

✨ 50+ Mainstream Large Language Models Supported ✨
Each model provides complete deployment, fine-tuning, and usage tutorials
📖 View complete model list and tutorials | 🎯 Quick Start

Gemma3
MiniMax-M2
Qwen3
Qwen3-VL
SpatialLM
Hunyuan3D-2
Qwen2-VL
MiniCPM-o
Qwen2.5-Coder
DeepSeek-Coder-V2
gpt-oss-20b
GLM-4.1-Thinking
DeepSeek-R1
InternLM3
phi4
GLM-4.5-Air
Hunyuan-A13B
DeepSeek
Baichuan
InternLM
Kimi
ERNIE-4.5
Llama4
Apple OpenELM
Llama3.1
Gemma-2
Qwen2.5
Qwen2
GLM-4
Qwen 1.5
phi-3
MiniCPM
Yi 零一万物
Yuan2.0
Yuan2.0-M32
Bilibili Index
CharacterGLM
BlueLM
Qwen-Audio
TransNormerLLM
Atom
ChatGLM3
Qwen2-57B-A14B-Instruct
Qwen2-72B-Instruct
Qwen2-7B-Instruct
InternLM2-20B
Tele-Chat
XVERSE2

AMD GPU Section

🚀 AMD GPU Platform Supported Models
Each model provides complete AMD environment configuration and deployment tutorials
Thanks to AMD University Program for supporting this project
📖 View complete AMD platform model list and tutorials

Google Gemma3
• AMD Environment Preparation and Configuration
• NPU Inference Acceleration Support
Qwen3
• lemonade-server SDK Deployment
• Ryzen AI 300 Series Optimization

Ascend NPU Section

🚀 Ascend NPU Platform Supported Models
Each model provides complete Ascend NPU environment configuration and deployment tutorials
📖 View Complete Ascend NPU Platform Model List and Tutorials

Qwen3
• Ascend NPU Environment Configuration General Guide
• MindIE Service Deployment and Invocation
• vLLM-ascend Deployment and Invocation
• sglang-ascend Deployment and Invocation
LLM Service Performance and Accuracy Testing
• AISBench Testing Tool Environment Configuration
• Ascend LLM Service Performance Testing
• Ascend LLM Service Accuracy Testing

Apple M Section

📖 Click to go to Apple M Section

Other Platforms ...

  • 🚀 Coming soon: Support for more platforms (such as Apple M-series chips, etc.) environment configuration and model deployment tutorials, stay tuned!
  • 🤝 We warmly welcome developers from all walks of life to contribute environment configuration and model deployment tutorials for different platforms, enabling large model technology to thrive on more hardware platforms!

Acknowledgments

Core Contributors

  • Song Zhixue (KMnO4-zx) - Project Leader (Datawhale Member)
  • Zou Yuheng - Project Leader (Datawhale Member - University of International Business and Economics)
  • Jiang Shufan (Content Creator - Datawhale Member)
  • Guo Xuanbo (Content Creator - Beihang University)
  • Lin Zeyi (Content Creator - SwanLab Product Manager)
  • Lin Hengyu (Content Creator - Guangdong Neusoft Institute - Whale Elite Teaching Assistant)
  • Wang Zeyu (Content Creator - Taiyuan University of Technology - Whale Elite Teaching Assistant)
  • Guo Zhihang (Content Creator)
  • Chen Yu (Content Creator - Google Developer Machine Learning Technical Expert)
  • Xiao Hongru (Datawhale Member - Tongji University)
  • Zhang Fan (Content Creator - Datawhale Member)
  • Li Jiaojiao (Datawhale Member)
  • Gao Liye (Content Creator - DataWhale Member)
  • Kailigithub (Datawhale Member)
  • Ding Yue (Datawhale - Whale Elite Teaching Assistant)
  • Hui Jiahao (Datawhale - Ambassador)
  • Wang Maolin (Content Creator - Datawhale Member)
  • Sun Jianzhuang (Content Creator - University of International Business and Economics)
  • Zheng Haohua (Content Creator)
  • Qiaomai (Content Creator - Datawhale Member)
  • Luo Xiutao (Content Creator - Datawhale Member - Likelihood Lab)
  • Li Kechen (Datawhale Member)
  • Cheng Hong (Content Creator - Datawhale Prospective Member)
  • Xie Haoran (Content Creator - Whale Elite Teaching Assistant)
  • Li Xiuqi (Content Creator - DataWhale Prospective Member)
  • Chen Sizhou (Datawhale Member)
  • Yan Xin (Datawhale Member)
  • Du Sen (Content Creator - Datawhale Member - Nanyang Institute of Technology)
  • Sanbu (Datawhale Member)
  • Swiftie (Xiaomi NLP Algorithm Engineer)
  • Zhang Youdong (Content Creator - Datawhale Member)
  • Zhang Jin (Content Creator - Datawhale Member)
  • Lou Tian'ao (Content Creator - University of Chinese Academy of Sciences - Whale Elite Teaching Assistant)
  • Xiao Luo (Content Creator - Datawhale Member)
  • Deng Kaijun (Content Creator - Datawhale Member)
  • Zhao Wenkai (Content Creator - Taiyuan University of Technology - Whale Elite Teaching Assistant)
  • Wang Yiming (Content Creator - Datawhale Member)
  • Huang Baite (Content Creator - Xidian University)
  • Yu Yang (Content Creator - Datawhale Member)
  • Zuo Chunsheng (Content Creator - Datawhale Member)
  • Yang Zhuo (Content Creator - Xidian University - Whale Elite Teaching Assistant)
  • Fu Zhiyuan (Content Creator - Hainan University)
  • Zheng Yuanjing (Content Creator - Whale Elite Teaching Assistant - Fuzhou University)
  • Tan Yike (Content Creator - University of International Business and Economics)
  • He Zhixuan (Content Creator - Whale Elite Teaching Assistant)
  • Kang Jingqi (Content Creator - Datawhale Member)
  • Sanshui (Content Creator - Whale Elite Teaching Assistant)
  • Yang Chenxu (Content Creator - Taiyuan University of Technology - Whale Elite Teaching Assistant)
  • Zhao Wei (Content Creator - Whale Elite Teaching Assistant)
  • Su Xiangbiao (Content Creator - Guangzhou University - Whale Elite Teaching Assistant)
  • Chen Rui (Content Creator - Xi'an Jiaotong-Liverpool University - Whale Elite Teaching Assistant)
  • Zhang Longfei (Content Creator - Whale Elite Teaching Assistant)
  • Sun Chao (Content Creator - Datawhale Member)
  • Fan Qi (Content Creator - Shanghai Jiao Tong University)
  • Zhuo Tangyue (Content Creator - Whale Elite Teaching Assistant)
  • fancy (Content Creator - Whale Elite Teaching Assistant)

Note: Ranking is based on contribution level

Others

  • Special thanks to @Sm1les for their help and support for this project
  • Thanks to AMD University Program for supporting this project
  • Some lora code and explanations reference repository: https://github.com/zyds/transformers-code.git
  • If you have any ideas, you can contact DataWhale. We also welcome everyone to raise more issues
  • Special thanks to the following students who contributed to the tutorials!

Star History