Skip to content
CAI
Software that uses CAICheck a score

jingyaogong/minimind

43.9

Weak · 26 September 2026

4.1k

lines of production code

Python

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a lightweight language model framework named MiniMind, built on a Mixture-of-Experts architecture with support for low-rank adaptation. It provides a complete pipeline for training and alignment, including supervised fine-tuning, direct preference optimization, and group relative policy optimization. The project includes utilities for model conversion, API serving, and evaluation, along with a web-based demo interface.

Features

Initial project scaffolding and documentation

The repository is initialized with essential project infrastructure, including a \.gitignore\ file to exclude build artifacts and local directories, a \CODE\_OF\_CONDUCT.md\ establishing community standards, and an \Apache 2.0\ license file defining usage terms. Comprehensive project documentation is added via \README.md\ (Chinese) and \README\_en.md\ (English), detailing the MiniMind lightweight language model architecture, training pipelines, and model versions. Additionally, \eval\_llm.py\ is introduced as a command-line tool for model inference and evaluation, supporting features like LoRA weight loading, RoPE scaling, and speed monitoring.

(repo-wide) · high confidence

Introduce MiniMind model with LoRA support and MoE capabilities

This change adds the MiniMind model architecture, including a configuration class, attention and feed-forward layers, and a Mixture-of-Experts (MoE) implementation. It also introduces a new LoRA module that allows applying low-rank adaptation to linear layers, with functions to save, load, and merge LoRA weights. Additionally, a tokenizer configuration and vocabulary file are included to support text processing for the model.

model · high confidence

New MiniMind utility scripts for model conversion, API serving, and evaluation

Added several new scripts to the \scripts/\ directory: \chat\_api.py\ provides a simple CLI client for the OpenAI-compatible API; \serve\_openai\_api.py\ implements a FastAPI-based server supporting streaming, tool calls, and reasoning content; \convert\_model.py\ handles conversion between MiniMind, Transformers, and PyTorch formats, including LoRA merging and compatibility fixes for Transformers 5.0; \eval\_toolcall.py\ offers a tool-use evaluation harness with mock tools and local/API backends; and \web\_demo.py\ adds a Streamlit-based web interface with multi-language support, tool selection, and thinking mode visualization.

scripts · high confidence

New RL training scripts and SGLang-accelerated rollout engine

The trainer module now includes new scripts for RL training (train\_grpo.py, train\_agent.py) and alignment (train\_dpo.py, train\_distillation.py), alongside a new rollout\_engine.py that supports high-performance generation via an SGLang HTTP API in addition to native PyTorch inference. This enables users to perform Group Relative Policy Optimization (GRPO) and Direct Preference Optimization (DPO) with tool-use capabilities and distributed training support.

trainer · high confidence

New dataset loaders for pretraining, SFT, and DPO with reasoning-content support

The dataset module now includes dedicated PyTorch Dataset classes for pretraining, supervised fine-tuning (SFT), and direct preference optimization (DPO). The SFT and DPO loaders support conversations containing explicit reasoning content (reasoning\_content field) and tool-use metadata, applying configurable probability-based system prompt injection and optional removal of empty thinking tags during preprocessing. The DPO loader aligns chosen and rejected responses and generates loss masks that weight only the assistant's output tokens for training.

dataset · high confidence

Dependencies

Initial dependency specification for Python environment

The project now includes a requirements.txt file that defines the Python package dependencies, including libraries for data processing (datasets, datasketch, nltk), model serving and APIs (Flask, FastAPI, uvicorn), machine learning frameworks (transformers, sentence\_transformers, scikit\_learn), and monitoring/tracking (wandb, swanlab, modelscope). Several packages are pinned to specific versions, while others such as torch, torchvision, peft, and matplotlib are currently commented out.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 44 → 44 (-0.1)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 91 → 84 (-6.7)
  • Architecture 94 → 98 (+3.4)
  • Maturity 51 → 38 (-13.1)
  • Readiness 17 → 22 (+5.4)
  • Security 80 → 91 (+10.9)

Resolved (5)

  • Dimension evaluation failed
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API

New (97)

  • Change coupling: train_grpo.py ↔ train_ppo.py (trainer/train_grpo.py)
  • Critical CVE: [GHSA redacted] (requirements.txt)
  • DPODataset.generate_loss_mask (cognitive 17) (dataset/lm_dataset.py)
  • Duplicated block (10 lines × 2) (dataset/lm_dataset.py)
  • Duplicated block (11 lines × 2) (trainer/train_grpo.py)
  • Duplicated block (12–14 lines × 4) (trainer/train_distillation.py)
  • Duplicated block (15 lines × 3) (trainer/train_full_sft.py)
  • Duplicated block (2–11 lines × 5) (trainer/train_distillation.py)
  • Duplicated block (5 lines × 2) (eval_llm.py)
  • Duplicated block (5 lines × 2) (eval_llm.py)
  • Duplicated block (5 lines × 2) (scripts/convert_model.py)
  • Duplicated block (5 lines × 2) (trainer/train_agent.py)
  • Duplicated block (5 lines × 2) (trainer/train_agent.py)
  • Duplicated block (5 lines × 2) (trainer/train_grpo.py)
  • Duplicated block (5 lines × 3) (trainer/train_full_sft.py)
  • Duplicated block (5–7 lines × 2) (trainer/train_agent.py)
  • Duplicated block (6 lines × 2) (dataset/lm_dataset.py)
  • Duplicated block (6 lines × 2) (scripts/web_demo.py)
  • Duplicated block (7 lines × 2) (scripts/web_demo.py)
  • Duplicated block (7 lines × 2) (trainer/train_agent.py)
  • …and 77 more

Changes since last survey

  • 46 commits — 19 feature/other, 27 fixes

By area

  • (repo) — 16 commits
  • (root) — 13 commits
  • trainer/train_agent.py — 5 commits
  • model/model_minimind.py — 4 commits
  • dataset/lm_dataset.py — 1 commit
  • scripts/eval_toolcall.py — 1 commit
  • scripts/serve_openai_api.py — 1 commit
  • trainer/rollout_engine.py — 1 commit
  • trainer/train_full_sft.py — 1 commit
  • trainer/train_grpo.py — 1 commit
  • trainer/train_tokenizer.py — 1 commit
  • trainer/trainer_utils.py — 1 commit

Notable commits

  • fix: Merge pull request #769 from qizwiz/fix/llm-response-unguarded
  • fix: Merge pull request #829 from DaoyuanLi2816/fix/dpo-paired-think-format
  • fix: Merge pull request #847 from a0917-cell/fix/safe-math-eval
  • fix: Merge pull request #854 from basil-k-aji-dev/fix/rl-ddp-grad-sync
  • fix: Merge pull request #857 from wbbeyourself/fix-ctrl-c-exception
  • fix: Merge pull request #859 from basil-k-aji-dev/fix/moe-router-gradient-topk1
  • fix: Merge pull request #860 from Linxiushen/fix-tokenizer-pretrain-format
  • fix: Merge pull request #863 from Linxiushen/fix-fp16-attention-mask-nan
  • fix: Merge pull request #864 from Linxiushen/fix-nonstream-max-tokens
  • fix: Merge pull request #865 from Linxiushen/fix-requirements-missing-fastapi
  • fix: Merge pull request #867 from DaoyuanLi2816/fix/lora-inference-paths
  • fix: Merge pull request #868 from DaoyuanLi2816/fix/final-accumulation-checkpoint
  • fix: [fix] float16 下 attention mask 的 -1e9 溢出成 -inf,导致整条序列输出 NaN
  • fix: [fix] keep DPO preference pair think formatting aligned
  • fix: [fix] keep agent rollout token-aligned #850
  • fix: [fix] keep the MoE router trainable at num_experts_per_tok=1
  • fix: [fix] replace tool eval() with an AST math evaluator
  • fix: [fix] requirements.txt 缺 fastapi/uvicorn,按 README 跑 serve_openai_api.py 直接崩
  • fix: [fix] residual step order
  • fix: [fix] restore top-1 router gradient #858
  • …and 26 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

jingyaogong/minimind was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f659b55761b754d306bd140573493a6543cafd7f — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-09659c52afae.