# DLLXW/baby-llama2-chinese

用于从头预训练+SFT一个小参数量的中文LLaMa2的仓库；24G单卡即可运行得到一个具备简单中文问答能力的chat-llama2.

Repository: https://github.com/DLLXW/baby-llama2-chinese
Canonical: https://ross.abutalabs.com/products/baby-llama2-chinese
Language: Python
License: MIT
License Family: permissive
Last push: 2026-08-13T16:21:56+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 35, longevity 79
- inputs: {"age_days": 1117, "days_push": 20, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2923, forks 354 (observed 2026-08-28T04:07:30.277582+00:00)

## What it is
An educational Python repository for pretraining and SFT fine-tuning a small (92M-218M parameter) Chinese Llama2 model from scratch, runnable on a single 24GB GPU. It also curates a complete set of LLM learning materials covering the full pipeline from pretraining to instruction tuning.

## Use cases
- pretrain a small chinese llama2 model from scratch
- learn how llm pretraining and sft work
- fine-tune a chinese chat model on a single gpu
- train a domain-specific chinese chatbot like medical qa
- clean and deduplicate chinese pretraining corpora
- run inference with a trained llama2 checkpoint

## When to choose
- you want to learn the full LLM training pipeline hands-on
- you have limited compute (one 24GB GPU) and want a small Chinese chat model
- you need an educational codebase with Chinese pretraining and SFT data recipes

## When to avoid
- you need a production-grade large Chinese LLM with strong general capabilities
- you want ready-made inference without training
- you require the full RLHF/reward-model pipeline, which is not yet implemented

## Facets
- artifact type: learning-resource
- maturity: active
- function: llm-training, llm-inference, machine-learning, deep-learning, data-science
- domain: large-language-models, machine-learning, education, tutorials
- platform: python, cross-platform
- tags: llama2, chinese-llm, pretraining, sft, from-scratch, single-gpu, educational, chatglm-tokenizer, reinforcement-learning, natural-language-processing, gpu, linux

## Member repositories
- DLLXW/baby-llama2-chinese (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:30.277582+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:33:44.188990+00:00, confidence not recorded.
  - readme: https://github.com/DLLXW/baby-llama2-chinese (fetched 2026-08-28T04:07:30.277582+00:00, sha c2d00dbb336f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
