# qibin0506/Cortex

从零构建大模型：从预训练到RLHF的完整实践

Repository: https://github.com/qibin0506/Cortex
Canonical: https://ross.abutalabs.com/products/qibin0506-cortex
Homepage: https://www.modelscope.cn/studios/qibin0506/Cortex
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2026-08-21T01:59:07+00:00

## Health v2 (maintenance only)
Score: 63/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 35, longevity 31
- inputs: {"age_days": 436, "days_push": 13, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2689, forks 209 (observed 2026-08-28T04:07:10.892235+00:00)

## What it is
Cortex is an open-source educational project that walks through building a large language model from scratch, covering the full training lifecycle: pretraining, midtraining, SFT, DPO, and PPO-based RLHF. It features a lightweight 0.1B-parameter MoE model, thinking-mode control via /think and /no think tags, and has been validated on domestic Chinese MLU370 chips.

## Use cases
- learn how to pretrain an LLM from scratch
- understand the full RLHF pipeline with DPO and PPO
- train a small MoE model on limited hardware
- study instruction tuning and preference alignment code
- run a tiny chat model locally with a web UI
- adapt LLM training to domestic accelerators like MLU370

## When to choose
- you want a complete, decoupled, end-to-end LLM training codebase to learn from
- you need an extremely lightweight MoE reference implementation
- you want runnable examples of pretrain, SFT, DPO, and PPO stages
- you are exploring LLM-as-Judge reward signals for PPO

## When to avoid
- you need a production-grade LLM or state-of-the-art model quality
- you want a turnkey fine-tuning framework rather than educational code
- you require large-scale multi-node training support out of the box
- you need broad model architecture compatibility

## Facets
- artifact type: learning-resource
- maturity: active
- function: llm-training, machine-learning, deep-learning, rag, chatbot
- domain: large-language-models, deep-learning, machine-learning, education, tutorials
- platform: python
- tags: llm-from-scratch, pretraining, sft, dpo, ppo, rlhf, moe, deepspeed, chinese, modelscope, linux, gpu, docker

## Member repositories
- qibin0506/Cortex (main) score 63

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:10.892235+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-30T02:17:43.002448+00:00, confidence not recorded.
  - readme: https://github.com/qibin0506/Cortex (fetched 2026-08-28T04:07:10.892235+00:00, sha b536a52984db)
  - homepage: https://www.modelscope.cn/studios/qibin0506/Cortex (fetched 2026-08-29T09:59:44.559139+00:00, sha 15200e4f5d18)
- Data as of 2026-08-30T08:39:29.467469+00:00.
