whatisgithub

What is fun-rec?

datawhalechina/fun-rec — explained in plain English

Analysis updated 2026-06-22

7,097PythonAudience · researcherComplexity · 4/5Setup · hard

In one sentence

A Chinese-language textbook on recommendation systems covering classic multi-stage pipelines, modern LLM-driven approaches, and a final chapter on building a full production system from scratch.

Mindmap

mindmap
  root((fun-rec))
    What it does
      Recsys textbook
      Classic and LLM methods
      Chinese language
    Topics
      Retrieval and ranking
      LLM-driven recsys
      Production systems
    Audience
      ML practitioners
      Researchers
    Tech Stack
      Python examples
      Offline and online
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Learn how collaborative filtering and vector retrieval work in the fast candidate-retrieval stage of a large recommendation pipeline.

USE CASE 2

Study ranking and re-ranking algorithms that decide which few items from thousands of candidates to actually show a user.

USE CASE 3

Understand how large language models and diffusion models are being applied to replace parts of the classic recommendation stack.

USE CASE 4

Follow the end-to-end chapter to build an offline feature pipeline, online serving layer, and deployed recommendation system.

What is it built with?

Python

How does it compare?

datawhalechina/fun-rechome-assistant/operating-systemtraceloop/openllmetry
Stars7,0977,0977,100
LanguagePythonPythonPython
Setup difficultyhardhardmoderate
Complexity4/55/52/5
Audienceresearcherops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

This is a reading resource, not a runnable package, effort depends on which chapter's code examples you implement.

So what is it?

Fun-Rec is a Chinese-language textbook and learning resource about recommendation systems, published by Datawhale, a Chinese AI learning community. A recommendation system is the kind of software that decides which videos, products, or articles to show you based on your past behavior. This project covers both the foundational techniques and more recent approaches driven by large AI models. The content is split into two main sections. The first covers the traditional multi-stage pipeline that most large platforms use: an initial candidate retrieval step that quickly narrows millions of items to a few thousand, followed by ranking and re-ranking steps that order those candidates more carefully. Topics include collaborative filtering, vector-based retrieval, feature crossing, sequential modeling, and multi-objective ranking. The second section focuses on generative recommendation, a newer direction where large language models and diffusion models take a more direct role in producing recommendations. Chapters cover scaling laws for recommendation models, end-to-end generative modeling, and reasoning-based approaches where the model thinks through item selection step by step. The final chapter walks through building a production-grade recommendation system from scratch, including offline pipelines, online serving, and deployment. The project is still actively being updated. It is primarily written for readers who already have a machine learning background and want to understand how recommendation algorithms work in real products. The README and all content are in Chinese, with a link to an English version of the README.

Copy-paste prompts

Prompt 1
Explain collaborative filtering as used in recommendation systems and show me a Python code example for user-based CF.
Prompt 2
I want to build a two-stage recommendation system with fast retrieval then re-ranking. What models should I use for each stage and why?
Prompt 3
How are large language models being used to improve recommendation quality compared to classical matrix factorization methods?
Prompt 4
Walk me through building the offline feature engineering pipeline for a recommendation system using the approach described in Fun-Rec.
Prompt 5
What is sequential modeling in recommendation systems and how does it capture a user's recent interests better than static embeddings?

Frequently asked questions

What is fun-rec?

A Chinese-language textbook on recommendation systems covering classic multi-stage pipelines, modern LLM-driven approaches, and a final chapter on building a full production system from scratch.

What language is fun-rec written in?

Mainly Python. The stack also includes Python.

How hard is fun-rec to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is fun-rec for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.