Large language models feel like black boxes — you type a prompt, an answer appears, and everything in between stays hidden. MiniMind opens the box. It is a free, open-source project that trains a complete 64-million-parameter language model from scratch — its README says the supervised fine-tuning stage takes about 2 hours on a single GPU for roughly ¥3 (about $0.40) of GPU rental.
As of 4 December 2026 it has more than 75,000 GitHub stars. It is not a chatbot you install and forget — it is a full, readable LLM training pipeline for anyone who wants to understand how a language model is built.
What Is MiniMind?
MiniMind is an end-to-end project for building a small language model from zero in pure PyTorch. It covers the whole journey — pretraining, SFT, LoRA, RLHF (DPO), RLAIF (PPO/GRPO/CISPO), tool use, Agentic RL, Adaptive Thinking and distillation — every algorithm written from scratch, with no high-level framework hiding the details.
The smallest model, minimind-3, has just 64 million parameters — about 1/2700 the size of GPT-3 — so training runs on an ordinary personal GPU. Ready-made models minimind-3 (64M) and minimind-3-moe (198M total, 64M active) are free from Hugging Face or ModelScope, so you can chat before you train your own. The architecture comes in Dense and MoE versions aligned with Qwen3, plus experimental extensions for vision, multimodal Omni, diffusion modelling and linear attention.
Key Features
- Complete pipeline from scratch: Pretraining, SFT, LoRA, RLHF (DPO), RLAIF (PPO/GRPO/CISPO), tool use, Agentic RL, Adaptive Thinking and distillation — all in one repo.
- Ultra-lightweight: The 64M model is about 1/2700 the size of GPT-3, so training works on one personal GPU — measured on a single RTX 3090.
- Pre-trained models included: minimind-3 and minimind-3-moe are free on Hugging Face and ModelScope — download one and chat right away, no training needed.
- Pure PyTorch, built to be read: Every core algorithm is written from zero in native PyTorch. The code is the tutorial — follow each line and understand what it does.
- Works with real inference stacks: Transformers, vLLM, llama.cpp, SGLang, Ollama and MNN, plus a Streamlit chat WebUI and an OpenAI-compatible API server.
How It Works
Training runs in three stages. First, pretraining: the model learns language from the dataset, using the project's custom BPE + ByteLevel tokenizer. Second, supervised fine-tuning teaches it to follow instructions and hold a conversation. Third, optional reinforcement learning (DPO, PPO, GRPO or CISPO) refines it with human or AI feedback, and Agentic RL teaches multi-turn tool use.
Plain Python scripts drive everything, with datasets in simple JSONL files. Checkpoints save automatically, and --from_resume 1 resumes from the last one. The README is honest: "2 hours" is one SFT epoch on a single RTX 3090 and "¥3" is that window's GPU rental — the full pretrain takes longer, but the small datasets let you reproduce a working chat model quickly.
How to Install and Use MiniMind
Step 1 — Clone the repo and install dependencies. You need Python 3.10 and, for GPU training, CUDA 12.2:
git clone --depth 1 https://github.com/jingyaogong/minimind cd minimind && pip install -r requirements.txt
Step 2 — Download a pre-trained model. Grab minimind-3:
modelscope download --model gongjy/minimind-3 --local_dir ./minimind-3
Or clone it directly:
git clone https://huggingface.co/jingyaogong/minimind-3
Step 3 — Chat with it right away. No training needed for this step:
python eval_llm.py --load_from ./minimind-3
You can also run it with ollama run jingyaogong/minimind-3.
Step 4 — Train your own model. Download the datasets from ModelScope into ./dataset — the small pretrain_t2t_mini.jsonl and sft_t2t_mini.jsonl files are enough for a quick run — then run the two required stages:
cd trainer && python train_pretrain.py python train_full_sft.py
Step 5 — Test what you trained. Check the result:
python eval_llm.py --weight full_sft
System Requirements
- Python 3.10 — the version used in the author's setup.
- CUDA 12.2 with an NVIDIA GPU — the author used a single RTX 3090 (24GB). CPU training is possible but far slower.
- Ubuntu 20.04 — the author's tested setup.
- Git and pip.
- Optional: ModelScope or Hugging Face access, and Ollama for one-command chat.
Honest Notes and Limitations
MiniMind is a learning project, so set expectations first. A 64M-parameter model will not answer like ChatGPT — expect short, simple replies, and treat it as proof you built a working LLM, not a production chatbot. "2 hours" covers one SFT epoch, not the whole pretrain, so a full run still takes real GPU time. The main README is in Chinese, with the English version in README_en.md — keep that file open. Finally, this is a research repo with no hosted service or support desk, so results depend on your hardware and how carefully you follow each stage.
Download MiniMind Free
MiniMind is completely free and open source under the Apache 2.0 licence. Download the full source code below.
Download link: https://github.com/jingyaogong/minimind/archive/refs/heads/master.zip
GitHub repository: https://github.com/jingyaogong/minimind
Final Verdict
If you have ever wondered how a language model actually works, MiniMind is the shortest honest path to finding out. It does not hand you a black box — it hands you the whole factory, small enough to run on one GPU and clear enough to read line by line. Download a pre-trained model, chat with it in five minutes, then train your own and watch a model you built answer back. That is why this little 64M model keeps trending.



Post a Comment