Fine-tuning someone else's model teaches you the API, not what is happening inside it. MiniMind is a complete language model pipeline, pretraining, supervised fine-tuning, LoRA, RLHF and reinforcement learning, written from scratch in PyTorch with no high-level abstraction hiding the steps. The full pipeline needs real GPU time and money. One epoch of the fine-tuning stage alone is the part that runs in about two hours on a single 3090.
By Raj Singh · September 2026 · 60k stars · 64M to 198M params, your choice · 6 min read
The training loss curve dropping over a single run, next to the minimal Streamlit chat UI the finished model talks through. No managed platform, no hosted dashboard, both run on the machine that trained the model.

The two-hour figure is one stage. It is the measured time for one epoch of supervised fine-tuning on a single NVIDIA 3090, not the full pipeline from raw pretraining to a working chat model. Pretraining is separate GPU time on top of it.
You supply your own PyTorch. torch, torchvision and peft are commented out in requirements.txt on purpose. Install the build that matches your CUDA version yourself rather than taking whatever pip resolves.
Two model sizes ship today. minimind-3 at 64M dense parameters and minimind-3-moe at 198M total with 64M active, both released April 2026 and aligned to the Qwen3 architecture family.
It plugs into real inference engines. Trained checkpoints work with llama.cpp, vllm and ollama, plus an included OpenAI-API-compatible server, so the model you trained is not stuck in a research notebook.
Licence, in plain English: Apache-2.0. Free for commercial work, fine to embed in your own tools, no obligation beyond keeping the licence file.
Drop your email and unlock the rest: what you need, the pipeline in the order to run it, the config values that decide model size, and where the checkpoints land.
One email. No follow-up unless I ship something that fits.
The shallow clone skips the training history, which is large. Install PyTorch for your GPU before the rest of requirements.txt, since the file leaves it commented out on purpose.
The install
Pretraining scripts and datasets live under dataset/ and trainer/, staged so you can run pretrain, then SFT, then the alignment stages in sequence without rewriting paths.
Dense versus MoE and the parameter count are set before training starts, not after. Pick the size that matches the GPU memory you actually have.
| Setting | Default | Why I change it |
|---|---|---|
| model_type | dense | MoE gets more effective capacity from the same active-parameter compute, worth it once dense training runs cleanly. |
| wandb / swanlab logging | off | Turn one on before a multi-hour run. Watching the loss curve live catches a bad learning rate long before the run finishes. |
Each stage is a separate script and produces a checkpoint the next stage reads. Running them out of order is the most common way to waste GPU hours.
Serve the finished checkpoint with the included OpenAI-compatible server, or export it to llama.cpp or ollama for a lighter runtime.
A finished checkpoint is a plain PyTorch state file. Nothing about serving or exporting it depends on this repo staying installed.
Pretrain, fine-tune, align, all from scratch, all on one GPU. The two-hour, one-epoch fine-tuning run is the fast part. Understanding what happened in it is the actual point.
↑ Unlocks the moment you submit the form above.
I'm Raj Singh, founder of DebtOps.ai and a Claude certified partner. Over the last five years I've managed $25M in ads, built AI solutions for Fortune 100 companies, and installed AI operating systems and AI brains inside small businesses. Everything here is something I've shipped, debugged, or watched a client ship. My goal with AgileSingh is to make you irreplaceable in this AI age.
A model you trained yourself is a good teaching exercise. The AI infrastructure guide covers where a model like this actually earns its place in a real stack.