Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
PaperProf turns any course PDF into an interactive study session. Upload your lecture notes or textbook, receive auto-generated questions drawn directly from the material, type your answers, and get instant, constructive feedback powered by a local LLM (MiniCPM4-8B).
π Blog / Field Notes: https://paperprof-blog.vercel.app/
PDF upload
βββΊ core/parser.py β extract raw text with PyMuPDF
βββΊ core/chunker.py β split text into thematic chunks
βββΊ core/questioner.py β LLM generates a question from a chunk
βββΊ student answers
βββΊ core/evaluator.py β LLM evaluates & explains
The LLM (loaded once at startup via model/llm.py) handles both question
generation and answer evaluation. Everything runs locally β no API keys needed.
PaperProf/
βββ app.py # Gradio UI β entry point
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ core/
β βββ __init__.py
β βββ parser.py # PDF β plain text (PyMuPDF)
β βββ chunker.py # plain text β thematic chunks
β βββ questioner.py # chunk β study question (LLM)
β βββ evaluator.py # (question, chunk, answer) β feedback (LLM)
βββ model/
βββ __init__.py
βββ llm.py # singleton LLM wrapper (MiniCPM4-8B / Transformers)
| File | Role |
|---|---|
app.py | Builds the Gradio interface and wires the pipeline together. |
core/parser.py | Opens the PDF with PyMuPDF (fitz) and extracts plain text page by page. |
core/chunker.py | Splits the raw text on paragraph boundaries, merging short paragraphs and capping chunk size so the LLM isn't overloaded. |
core/questioner.py | Sends a chunk to the LLM with a professor-style prompt and returns one open-ended question. |
core/evaluator.py | Sends the question, source chunk, and student answer to the LLM, which returns a structured verdict + model answer. |
model/llm.py | Loads openbmb/MiniCPM4-8B once via Transformers, exposes a generate(prompt) method, and caches the instance as a singleton. |
requirements.txt | Pins all Python dependencies needed to run the project. |
# 1. Create a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. (Optional) override the model or device
export PAPERPROF_MODEL="openbmb/MiniCPM3-4B" # smaller model for testing
export PAPERPROF_DEVICE="cuda" # cuda | mps | cpu | auto
# 4. Launch
python app.py
The Gradio app will open at http://localhost:7860.
Repeat steps 3β5 as many times as you like to practice the full material.
PAPERPROF_MODEL to a 4B variant for
faster CPU runs.Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
PaperProf turns any course PDF into an interactive study session. Upload your lecture notes or textbook, receive auto-generated questions drawn directly from the material, type your answers, and get instant, constructive feedback powered by a local LLM (MiniCPM4-8B).
π Blog / Field Notes: https://paperprof-blog.vercel.app/
PDF upload
βββΊ core/parser.py β extract raw text with PyMuPDF
βββΊ core/chunker.py β split text into thematic chunks
βββΊ core/questioner.py β LLM generates a question from a chunk
βββΊ student answers
βββΊ core/evaluator.py β LLM evaluates & explains
The LLM (loaded once at startup via model/llm.py) handles both question
generation and answer evaluation. Everything runs locally β no API keys needed.
PaperProf/
βββ app.py # Gradio UI β entry point
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ core/
β βββ __init__.py
β βββ parser.py # PDF β plain text (PyMuPDF)
β βββ chunker.py # plain text β thematic chunks
β βββ questioner.py # chunk β study question (LLM)
β βββ evaluator.py # (question, chunk, answer) β feedback (LLM)
βββ model/
βββ __init__.py
βββ llm.py # singleton LLM wrapper (MiniCPM4-8B / Transformers)
| File | Role |
|---|---|
app.py | Builds the Gradio interface and wires the pipeline together. |
core/parser.py | Opens the PDF with PyMuPDF (fitz) and extracts plain text page by page. |
core/chunker.py | Splits the raw text on paragraph boundaries, merging short paragraphs and capping chunk size so the LLM isn't overloaded. |
core/questioner.py | Sends a chunk to the LLM with a professor-style prompt and returns one open-ended question. |
core/evaluator.py | Sends the question, source chunk, and student answer to the LLM, which returns a structured verdict + model answer. |
model/llm.py | Loads openbmb/MiniCPM4-8B once via Transformers, exposes a generate(prompt) method, and caches the instance as a singleton. |
requirements.txt | Pins all Python dependencies needed to run the project. |
# 1. Create a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. (Optional) override the model or device
export PAPERPROF_MODEL="openbmb/MiniCPM3-4B" # smaller model for testing
export PAPERPROF_DEVICE="cuda" # cuda | mps | cpu | auto
# 4. Launch
python app.py
The Gradio app will open at http://localhost:7860.
Repeat steps 3β5 as many times as you like to practice the full material.
PAPERPROF_MODEL to a 4B variant for
faster CPU runs.