Model or dataset
ymcui/Chinese-LLaMA-Alpaca avatar
ymcui/Chinese-LLaMA-Alpaca

ymcui/Chinese-LLaMA-Alpaca: the weights here are LoRA patches, and every tag is from 2023

Chinese LLaMA & Alpaca large language models, with local CPU/GPU training and deployment.

18,912 stars1,831 forksPythonApache-2.0

At a glance

What is it?
This repository is the first generation of a Chinese language model project, and two facts govern everything else. The published files are LoRA adapters rather than usable models, because the base LLaMA weights are not distributed here and the licence forbids commercial use, and every release tag dates from 2023 while the README's own headline points at a third generation project instead.
Who is it for?
Use this repository if you specifically need the first generation Chinese LLaMA or Alpaca models, their training and instruction tuning scripts, or a reference for how the Chinese vocabulary was expanded, because that is what it holds. Do not plan new work on it, since the newest release is v5.0 from 2023-07-19 and the README recommends moving to the third generation project, which shipped Llama-3-Chinese-8B and its instruct variant.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ymcui/Chinese-LLaMA-Alpaca18,912 ★ · -29
Star history
Repository2026-09-102026-11-14
ymcui/Chinese-LLaMA-Alpaca18.9k18.9k

-29 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What is published is a patch, and the model it patches is not here

The first thing the model download section does is tell you not to download anything yet. The notice is labelled as required reading.

It says the LLaMA model officially released by Facebook prohibits commercial use, and that the official release does not include model weights, although third party download addresses exist online. To comply with the relevant licence, what this project publishes is LoRA weights, which the text describes as a patch on the original LLaMA model, and merging the two yields the complete weights. It then states plainly that the Chinese LLaMA and Alpaca LoRA models cannot be used on their own and require the original LLaMA model.

So this repository is not a place to get a runnable model. It is a place to get an adapter, a merge procedure, and training code, and the table of contents marks the merge section as important, which tells you where the actual difficulty is.

The practical consequence for anyone evaluating the project is that the licence of the base model governs your use no matter what this repository's own Apache-2.0 licence says, because a merged model is a derivative of both.

All three recent tags are from 2023, and the headline points at a successor

The release list is v4.1 dated 2023-06-16, v4.2 dated 2023-07-05 and v5.0 dated 2023-07-19, so the newest published artefact is over three years old. The last push to the branch was 2026-04-19, so there have been commits since, but no tag.

The README's first line is not the project title. It announces that the Chinese-LLaMA-Alpaca-3 project has started, and links to it. The news list repeats the point: on 2024-04-30 the third generation was released with Llama-3-Chinese-8B and Llama-3-Chinese-8B-Instruct, and all users of the first and second generation are recommended to upgrade. The second generation is announced twice, once on 2023-07-31 for version 1.0 and again on 2023-08-14 for version 2.0 with the 13B models.

The history also records what each release added, which is the useful part if you are reading this repository as a record. Version 4.0 in June 2023 added the 33B models, a privateGPT usage example and C-Eval results. Version 4.1 added a new technical report, a C-Eval decoding script and a low resource model merge script. Version 5.0 added the Alpaca-Pro series and the Plus-33B series.

Alpaca's vocabulary is one token larger, so the two must not be mixed

The model selection guide is a comparison table between Chinese LLaMA and Chinese Alpaca, and the row that matters most for a pipeline is vocabulary size.

The third footnote explains the relationship rather than the number. After instruction tuning, Alpaca has one more pad token than LLaMA, and the instruction is therefore not to mix the LLaMA and Alpaca vocabularies. The table's other row says the same thing from the usage side: the base model needs no input template, while the instruction model requires one, and the first footnote says the template is already built into llama.cpp, into LlamaChat, into the Hugging Face inference code, into the web demo code and into the LangChain example, so there is nothing to add by hand.

The consequence is that these are not interchangeable checkpoints of one model. Swapping a base adapter for an instruction one changes the vocabulary by one entry, and the second footnote gives the diagnostic for the common version of this mistake: if the model's answers are of particularly low quality, or it produces nonsense, or it does not understand the question, check whether you used the correct model and the correct startup parameters. Both problems are silent, and neither produces an error.

The base model never stops, and that is listed as a known issue

The last row of the comparison table is called known issues, and the two columns describe two different problems.

For the base model the entry is that if you do not control termination, it will keep writing until it reaches the output length limit. That is the behaviour of a completion model asked to behave like a chat one, and the fix is not a repository setting. It is a prompt, a stopping condition, or a different model.

For the instruction model the entry is to use the Pro version to avoid the problem of replies from the Plus version being too short. That is a model choice, not a parameter.

What makes the row worth reading is that the two failure modes are opposites and both are quiet. Too much output and too little output look like different bugs and are actually the same instruction, use the right model, and the footnote below the table points at the same checklist.

The recommendation paragraph above it says the same in plain terms: if you want a ChatGPT style conversation, use an Alpaca model rather than a LLaMA model. For Alpaca, the Pro version was improved for the too-short reply problem with a noticeable gain in output quality, and if you prefer short replies, choose the Plus series.

The same weights are a completion engine or a chat engine depending on the flag

The middle of the comparison table is a per tool matrix, and it is the most operational part of the README.

For llama.cpp, the base model is driven by the `-p` parameter for the preceding text, while the instruction model is started with `-ins` to enter instruction following plus chat mode. For text-generation-webui, the base model is marked as unsuitable for chat mode, while the instruction model can run on a machine with no graphics card by using `--cpu`. For LlamaChat, you choose LLaMA or Alpaca at load time. For the Hugging Face inference script, the base model needs no extra startup argument while the instruction model needs `--with_prompt` added at launch. For the web demo code and for the LangChain and privateGPT examples, the base model is marked not applicable and the instruction model just takes the model path, with multi turn dialogue supported.

So the distinction between the two families is not a different file format. It is three or four switches in three or four different tools, and the failure mode when you get one wrong is output that looks like an answer and is not one.

Training runs on torch 1.13.1 and a peft commit rather than a release

The project open sources its pretraining and instruction tuning scripts, so the environment they need is a real part of the repository. The requirements file is four lines:

code
torch==1.13.1
git+https://github.com/huggingface/peft.git@13e53fc
transformers==4.30.0
sentencepiece==0.1.97

Three of those are exact pins, and one is not a release at all. The peft dependency is a git URL with a specific commit hash appended, so the adapter training code is tied to one commit of that library rather than to a version anyone can resolve from an index.

The consequence is that the training path is reproducible only against that combination, and torch 1.13.1 is old enough that the Python it installs on is itself a constraint. The inference path does not share the problem, because llama.cpp needs none of these packages, and the quantized example directories in the tree, covering four bit, eight bit and sixteen bit variants for 7B, 13B and 33B, are the route the documentation steers a laptop user toward.

The repository also carries SHA256.md at the root for verifying downloads, a CITATION.cff, notebooks, a data directory, and a scripts directory holding the inference, web demo and LangChain examples the table refers to.

Editorial conclusion

Use this repository if you specifically need the first generation Chinese LLaMA or Alpaca models, their training and instruction tuning scripts, or a reference for how the Chinese vocabulary was expanded, because that is what it holds. Do not plan new work on it, since the newest release is v5.0 from 2023-07-19 and the README recommends moving to the third generation project, which shipped Llama-3-Chinese-8B and its instruct variant. Check four things before you download anything: that you already have the original LLaMA weights, since the files here are adapters that cannot run alone; that you read the merge step, which the table of contents marks as important; that you pick LLaMA or Alpaca deliberately, because the Alpaca vocabulary carries one extra pad token and the two must not be mixed; and that you set the right startup switch, since the base model keeps writing until it hits the length limit while the instruction model needs a template and a flag. The license is Apache-2.0 and the last push was 2026-04-19.

Frequently asked questions

Can alpacas and llamas crossbreed?

Nothing in this repository concerns animals. It is a Chinese language model project: Chinese LLaMA is the base model and Chinese Alpaca is the instruction tuned version, both built on the original LLaMA with an expanded Chinese vocabulary, and both published here as LoRA weights.

Is there a difference between a llama and an alpaca?

In this project the difference is the training method. Chinese LLaMA is a base model trained with traditional causal language modelling on unlabelled general text, meant for continuing a given passage, while Chinese Alpaca is instruction tuned on labelled instruction data for question answering, writing, suggestions and multi turn chat.

What is a llama and alpaca mix called?

The repository does not use that phrase. What it describes is a merge: the published LoRA weights are a patch applied to the original LLaMA model, and merging the two produces the complete weights, which is why the merge step is a required part of getting these models to run.

What are the four types of llamas?

No such taxonomy appears here. The published sizes are 7B, 13B and 33B, and each has a base, a Plus and a Pro variant, where Pro exists to fix replies that are too short and Plus is the choice if shorter replies are wanted.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. ymcui/Chinese-LLaMA-Alpaca on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ymcui-chinese-llama-alpaca.svg)](https://hysenlabs.com/projects/ymcui-chinese-llama-alpaca)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/ymcui-chinese-llama-alpaca.svg)](https://hysenlabs.com/projects/ymcui-chinese-llama-alpaca)

Was this useful?