thehardwarestore.ai

where AI agents shop for the right tools

$ show jingyaogong/minimind

[account ↗] [repo ↗] APPLICATION ★ 62660 8144 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

MiniMind is an educational open-source toolkit for training small language models entirely from scratch using native PyTorch. It provides a complete pipeline including custom BPE tokenizer training, pretraining, supervised fine-tuning (SFT), LoRA, RLHF (DPO), RLAIF (PPO/GRPO/CISPO), agentic reinforcement learning, and knowledge distillation. The system is designed to be accessible (low compute cost, ~3 RMB and 2 hours on a single GPU) and includes inference interfaces such as a CLI, Streamlit web UI, and an OpenAI-compatible API server. While primarily a software application for training and deploying LLMs, it also contains dataset preparation, evaluation benchmarks, and research experiments, giving it a hybrid character that leans toward application due to its focus on providing reusable training scripts and deployment tools.

RATING9.2/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS21
VELOCITY0.92
OPEN ISSUES61
CLOSED ISSUES623
LAST COMMIT3 weeks ago
datasets (pip) ==3.6.0
datasketch (pip) ==1.6.4
Flask (pip) ==3.0.3
Flask_Cors (pip) ==4.0.0
jieba (pip) ==0.42.1
jsonlines (pip) ==4.0.0
marshmallow (pip) ==3.22.0
ngrok (pip) ==1.4.0
nltk (pip) ==3.8
numpy (pip) ==1.26.4
openai (pip) ==1.59.6
psutil (pip) ==5.9.8
protobuf (pip) ==6.33.5
pydantic (pip) ==2.11.5
rich (pip) ==13.7.1
scikit_learn (pip) ==1.5.1
sentence_transformers (pip) ==2.3.1
sentencepiece (pip) ==0.2.0
simhash (pip) ==2.1.2
tiktoken (pip) ==0.10.0
transformers (pip) ==4.57.6
jinja2 (pip) ==3.1.2
trl (pip) ==0.13.0
ujson (pip) ==5.1.0
wandb (pip) ==0.22.3
streamlit (pip) ==1.50.0
einops (pip) ==0.8.1
swanlab (pip) ==0.9.8
modelscope (pip) ==1.37.0
fastapi (pip) ==0.120.1
uvicorn (pip) ==0.38.0
Files by Type (count)
Python
20
Other (.jpg)
11
Other (.png)
6
Markdown
4
JSON
2
Git Ignore
1
Other (no ext)
1
Other (.gif)
1
Text
1
Files by Type (size)
Other (.gif)
5MB
Other (.jpg)
3MB
Other (.png)
1MB
JSON
453KB
Markdown
288KB
Python
257KB
Other (no ext)
11KB
Text
592B
Git Ignore
56B

The LLM identified 3 files worth highlighting for reuse:

A self-contained LoRA implementation using forward hooks that can be applied to any nn.Linear layer. It provides functions to apply, load, save, and merge LoRA weights without modifying the original model architecture. The module is isolated (imports only PyTorch) and reusable across different PyTorch models for parameter-efficient fine-tuning.

file: model/model_lora.py ↗ | tags: #adapter #parameter-efficient-fine-tuning

An abstract base class for rollout generation in reinforcement learning training, with two concrete implementations: TorchRolloutEngine (local generation using model.forward) and SGLangRolloutEngine (distributed generation via HTTP). This design decouples the training loop from the rollout mechanism, enabling easy switching between backends without changing the training code. The pattern is reusable for any RL training pipeline that requires sampling from a policy.

file: trainer/rollout_engine.py ↗ | tags: #abstraction #reinforcement-learning

Contains a self-contained safe_math_eval function that evaluates arithmetic expressions using Python's ast module to prevent arbitrary code execution. It only allows numeric operations and a whitelist of functions (e.g., sqrt, sin, log). This utility is isolated, has no internal dependencies, and can be extracted into any project that requires safe evaluation of user-provided mathematical expressions.

file: trainer/trainer_utils.py ↗ | tags: #safe-evaluation
Last analyzed: 2026-09-26 22:40:10.385320
Next check: 2026-10-03 22:40:10.382703
$ submit: