A Chinese-language step-by-step guide and demo code for learning LLMs, from calling APIs to local deployment and fine-tuning, with Kaggle/Colab versions.
datawhalechina/self-llm
A Chinese-language tutorial collection for deploying, using and fine-tuning open-source LLMs and multimodal models on Linux, with full, LoRA and P-tuning guides.
- Stars
- 32,533
- Forks
- 3,136
- Open issues
- 163
- Last commit
- last month
What is it?
self-llm is a Chinese-language tutorial project for beginners who want to run open-source large language models on their own Linux machines. It walks through environment setup, local deployment, command-line and online demo usage, LangChain integration, and fine-tuning for a wide range of models including Qwen, InternLM, ChatGLM, Llama 3, MiniCPM and Gemma.
The content is organized by model, with each supported model getting its own step-by-step guide covering deployment, fine-tuning and usage. Fine-tuning methods covered include distributed full-parameter training, LoRA and P-tuning. Separate sections address AMD GPUs with ROCm, Huawei Ascend NPUs and Apple M-series chips.
The project is maintained by Datawhale and accepts issues and pull requests from contributors. It also includes example projects such as a character-style chat model and a math-focused model built on InternLM2-Math.
Key features
- 01Step-by-step deployment and usage guides for dozens of open-source LLMs and multimodal models.
- 02Covers full-parameter fine-tuning, LoRA and P-tuning methods.
- 03Includes environment setup guides for Linux, ROCm, Ascend NPU and Apple M chips.
- 04Shows command-line calls, online demo deployment and LangChain integration.
- 05Written in Chinese with Jupyter Notebook-based examples.
Use cases
- A student who wants to run Qwen or InternLM locally without paid API access.
- A developer learning how to LoRA fine-tune an open model on a domain-specific dataset.
- A researcher setting up an open LLM on AMD or Ascend hardware.
- A team building a private knowledge assistant with LangChain on a local model.
Quick start
- 1
Clone the repository
git clone https://github.com/datawhalechina/self-llm.git - 2
Open the tutorial index for supported models and follow the general environment setup guide
Things to know
- Tutorials are written in Chinese and target Linux, with separate guides for AMD, Ascend NPU and Apple M hardware.
- Most guides need a GPU with substantial VRAM to run or fine-tune the models.
Topics
FAQ
- What is self-llm?
- A Chinese-language tutorial collection for deploying, using and fine-tuning open-source LLMs and multimodal models on Linux, with full, LoRA and P-tuning guides. self-llm is a Chinese-language tutorial project for beginners who want to run open-source large language models on their own Linux machines. It walks through environment setup, local deployment, command-line and online demo usage, LangChain integration, and fine-tuning for a wide range of models including Qwen, InternLM, ChatGLM, Llama 3, MiniCPM and Gemma.
- Is self-llm free to use? What license does it have?
- self-llm is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is self-llm still maintained?
- Updated within 6 months. The last commit to self-llm was on Sep 12, 2026.
- What can I use self-llm for?
- A student who wants to run Qwen or InternLM locally without paid API access. A developer learning how to LoRA fine-tune an open model on a domain-specific dataset. A researcher setting up an open LLM on AMD or Ascend hardware. A team building a private knowledge assistant with LangChain on a local model.
- How do I install self-llm?
- Clone the repository: git clone https://github.com/datawhalechina/self-llm.git Open the tutorial index for supported models and follow the general environment setup guide
- Where can I get self-llm?
- The source code and installation instructions are on GitHub: https://github.com/datawhalechina/self-llm
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Turns your exported chat history into a fine-tuned LLM that mimics your style, then deploys it as a chatbot on Telegram, Discord, Slack or WeChat.
A Chinese-language open tutorial that teaches LLM principles by building a small LLaMA2-style model from scratch, covering Transformer, pretraining, fine-tuning, RAG and agents.
Unified framework for efficiently fine-tuning 100+ LLMs and VLMs with a zero-code CLI and Web UI.
Python library that runs large language models layer by layer so 70B-class models can infer on a single 4GB GPU, without quantization.
Open-source large language models fine-tuned for financial tasks such as sentiment analysis, forecasting and financial NLP benchmarks.