jingyaogong / minimind

An open-source project that lets you train a small 64M-parameter AI language model from scratch in about two hours on a single GPU.

Python · ★ 699 today★ 72,126 stars9,403 forksPythonApache-2.0 licenseUpdated Nov 26, 2026

What it does

MiniMind is a teaching and experimentation project that builds a tiny large language model (LLM) from the ground up, the same type of technology behind chatbots like ChatGPT. Most people only ever fine-tune existing big models, which hides how they actually work. This project shows the full training pipeline in readable code, so anyone with a personal GPU can see every step. The README says the smallest main version is roughly 1/2700 the size of GPT-3.

How it works

  1. 1Clone the GitHub repository and install the Python requirements.
  2. 2Download the small pretraining and instruction datasets listed in the project.
  3. 3Run the pretraining script to teach the model general language patterns.
  4. 4Run the supervised fine-tuning script to teach it to follow instructions and chat.
  5. 5Test the trained model with the included evaluation script or web demo.

Who it's for

  • Developers and students who want to learn how large language models work by building one
  • Hobbyists with a personal GPU who want to experiment without expensive cloud costs
  • Small teams or founders exploring whether custom AI models are feasible at small scale

Highlights

  • Trains a 64M-parameter model; the README cites about 2 hours and roughly 3 yuan of GPU rental cost on an RTX 3090
  • Core algorithms are implemented from scratch in native PyTorch rather than hidden behind high-level libraries
  • Covers pretraining, fine-tuning, LoRA, DPO, PPO/GRPO, tool use, and distillation
  • Offers an OpenAI-compatible API server and works with tools like Ollama and vLLM
  • Released under the permissive Apache 2.0 license and free to use

Getting started

Clone the repository with git clone --depth 1 https://github.com/jingyaogong/minimind, then run pip install -r requirements.txt. You can also try a pre-trained model with ollama run jingyaogong/minimind-3, or use the online demo linked in the README.

$ git clone https://github.com/jingyaogong/minimind.git

Why it matters for business

The project signals growing interest in small, cheap, custom models that run on consumer hardware, a trend relevant to founders building niche AI products and to investors watching lower-cost AI training. Its popularity (about 72,000 GitHub stars) suggests strong developer demand for hands-on AI education.

Keep in mind: The model is very small and is meant for learning, so its answers will be far weaker than commercial chatbots, and the README's cost and timing figures come from the author's own hardware and setup.

Explainer written by AI from the project's public page. Details may change; check the source before you install or buy.