# jingyaogong/minimind

🧠 Train a 64M-parameter LLM from scratch in just 2h!

Repository: https://github.com/jingyaogong/minimind
Canonical: https://ross.abutalabs.com/products/minimind
Homepage: https://jingyaogong.github.io/minimind
Language: Python
License: Apache-2.0
License Family: permissive
Topics: artificial-intelligence, large-language-model
Last push: 2026-08-21T08:49:07+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 21, longevity 54
- inputs: {"age_days": 767, "days_push": 12, "days_rel": 316, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 55036, forks 7180 (observed 2026-08-28T04:12:18.355217+00:00)

## What it is
MiniMind is an open-source project that trains tiny (64M-parameter) large language models completely from scratch in pure PyTorch, covering the full pipeline from tokenizer to pretraining, SFT, LoRA, RLHF/DPO, RLAIF (PPO/GRPO/CISPO), tool use, and distillation. It doubles as a hands-on tutorial for understanding LLM internals, with models deployable via vLLM, ollama, llama.cpp, or an OpenAI-compatible API.

## Use cases
- train a small LLM from scratch on a single consumer GPU
- learn how LLM pretraining and SFT work internally
- experiment with RLHF, DPO, PPO, and GRPO implementations
- understand MoE architectures with readable code
- build a tiny chatbot with tool calling and reasoning
- teach an LLM course with a reproducible codebase
- fine-tune and distill a lightweight language model
- serve a custom-trained model with an OpenAI-compatible API

## When to choose
- you want to understand every step of LLM training without black-box abstractions
- you have limited GPU budget and want to train a model from zero cheaply
- you need an educational, reproducible reference implementation of modern LLM training techniques
- you want a tiny model compatible with vLLM, ollama, or llama.cpp

## When to avoid
- you need a production-grade, high-capability LLM for real applications
- you only want to fine-tune an existing large model with LoRA
- you need multimodal, speech, or vision capabilities out of the box (see MiniMind-V/O instead)
- you require enterprise support, scaling, or extensive evaluation benchmarks

## Facets
- artifact type: learning-resource
- maturity: active
- function: llm-training, machine-learning, deep-learning, llm-inference, chatbot, rag, agent-framework
- domain: large-language-models, artificial-intelligence, deep-learning, education
- platform: python, cross-platform
- tags: train-from-scratch, pytorch, moe, rlhf, dpo, grpo, lora, sft, pretraining, model-distillation, tool-calling, tutorial, small-language-model, openai-api-compatible, natural-language-processing, gpu

## Member repositories
- jingyaogong/minimind (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:12:18.355217+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-29T16:18:59.549933+00:00, confidence not recorded.
  - readme: https://github.com/jingyaogong/minimind (fetched 2026-08-28T04:12:18.355217+00:00, sha 19385d2819db)
  - homepage: https://jingyaogong.github.io/minimind (fetched 2026-08-28T18:05:30.571412+00:00, sha e62203af6f60)
- Data as of 2026-08-30T08:39:29.467469+00:00.
