An offline-capable, multi-provider AI study assistant for PDF books with VARK learning modes
Project description
๐ PDF Tutor
Study any PDF the way you learn best โ locally, privately, with diagrams, audio, flashcards, and hands-on commands.
PDF Tutor reads the table of contents of any PDF, lets you pick a chapter, and explains it through your preferred AI model โ fully offline on your own machine, or via free cloud APIs for higher quality. It adapts to how you learn using the VARK model: Visual diagrams, Auditory TTS, Read/Write notes, or Kinesthetic hands-on commands.
โก Try it in 30 seconds
git clone https://github.com/Ashut90/pdf-tutor.git
cd pdf-tutor
pip install -r requirements.txt
python -m pdf_tutor
Drop any PDF onto the app, pick a chapter, pick a learning mode โ that's it.
โจ Features
๐ Smart PDF handling
- Auto-detects chapters from the PDF's table of contents
- Dual viewer โ read extracted text or view actual rendered pages
- Page-range control โ load a full chapter or a single section
๐ค Four AI providers (use whichever fits)
| Provider | Cost | Runs | Best for |
|---|---|---|---|
| Ollama | Free | Locally (offline) | Privacy, no limits, no internet |
| Google Gemini | Free tier | Cloud | Whole chapters (1M token context) |
| Groq | Free tier | Cloud | Fast inference |
| OpenRouter | Free tier | Cloud | Model variety |
๐ง VARK learning system
Built around the VARK model (Visual, Auditory, Read/Write, Kinesthetic):
- ๐ฏ Style detector โ a short quiz that recommends your learning style
- ๐จ Visual mode โ mind maps, flowcharts, comparison tables
- ๐ง Auditory mode โ conversational explanations + text-to-speech playback
- ๐ Read/Write mode โ definitions, structured notes, writing prompts
- ๐ ๏ธ Kinesthetic mode โ hands-on terminal commands and code experiments
- ๐ Omni mode โ all four styles in a single response
๐จ Rich visual output
- Mermaid diagrams rendered via online APIs with a local graphviz fallback (works offline)
- Charts generated locally with matplotlib
- ASCII diagrams for reliable inline visuals
๐พ Export & study tools
- Save notes as Markdown, HTML, or plain text
- Anki flashcard export โ auto-generates spaced-repetition cards
- Mindmap export โ interactive HTML mindmaps
- Text-to-speech โ listen to any explanation
๐ผ๏ธ Screenshots
| Main window | VARK learning modes |
|---|---|
| coming soon | coming soon |
๐ Quick Start
Prerequisites
- Python 3.9+
- (Optional) Ollama for offline local models
- (Optional)
graphvizandespeak-ngsystem packages for diagram fallback and TTS
Installation
PDF Tutor runs on Linux, Windows, and macOS โ anywhere Python 3.9+ works.
1. Clone and enter the project:
git clone https://github.com/Ashut90/pdf-tutor.git
cd pdf-tutor
2. Create a virtual environment and install Python dependencies:
Linux / macOS
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Windows (PowerShell)
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
3. (Optional) install system packages for full features:
| Feature | Linux (Debian/Ubuntu) | macOS (Homebrew) | Windows |
|---|---|---|---|
| Diagram fallback | sudo apt install graphviz |
brew install graphviz |
graphviz.org/download |
| Offline TTS | sudo apt install espeak-ng |
built-in (uses say) |
built-in (SAPI5) |
These are optional. Without graphviz, diagrams still render via online services. Without espeak-ng, TTS falls back to the online voice (gTTS).
Run
Same command on every OS:
python -m pdf_tutor
# or
python run.py
๐ง Setting up AI providers
Option 1 โ Ollama (free, local, offline)
# Install Ollama from https://ollama.com, then pull a model:
ollama pull qwen2.5-coder:7b # great for technical content
ollama serve # starts the local server
In the app: select Ollama, no API key needed.
Option 2 โ Google Gemini (free, best for whole chapters)
- Get a free key at aistudio.google.com/apikey
- In the app: select Google Gemini, paste your key
- Gemini's 1M-token context handles entire chapters without truncation
Option 3 โ Groq / OpenRouter
Get free keys from console.groq.com or openrouter.ai and paste into the app.
๐ Project Structure
pdf-tutor/
โโโ pdf_tutor/
โ โโโ __init__.py
โ โโโ __main__.py # entry point: python -m pdf_tutor
โ โโโ config.py # theme, fonts, providers, limits
โ โโโ core/
โ โ โโโ pdf.py # TOC extraction, text/page rendering
โ โโโ ai/
โ โ โโโ client.py # unified client for all 4 providers
โ โโโ rendering/
โ โ โโโ visuals.py # mermaid / chart / graphviz rendering
โ โโโ learning/
โ โ โโโ modes.py # teaching modes + VARK prompts
โ โโโ ui/
โ โโโ app.py # Tkinter GUI (3-pane layout)
โโโ tests/ # pytest suite
โโโ requirements.txt
โโโ pyproject.toml
โโโ LICENSE
โโโ README.md
๐๏ธ Architecture
The UI loads a chapter via core/pdf.py, sends its text plus a mode-specific
prompt (learning/modes.py) to the selected provider (ai/client.py), and
renders any diagrams the AI produces (rendering/visuals.py).
๐งช Running tests
pip install -r requirements-dev.txt
pytest -v
๐บ๏ธ Roadmap
- Conversation history persistence across sessions
- Multi-PDF library with search
- Spaced-repetition scheduler built in (beyond Anki export)
- Support for EPUB and DjVu formats
- Configurable prompt templates per subject
๐ค Contributing
Contributions are welcome. Please open an issue to discuss major changes first.
- Fork the repo
- Create a feature branch (
git checkout -b feature/my-feature) - Run the tests (
pytest) - Commit and open a pull request
๐ License
MIT โ see LICENSE.
๐ Acknowledgments
- PyMuPDF for PDF parsing
- Ollama, Groq, Google AI Studio, OpenRouter for model access
- The VARK model by Neil Fleming for the learning-styles framework
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kritrim_smriti-1.0.0.tar.gz.
File metadata
- Download URL: kritrim_smriti-1.0.0.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bad98e307febc3a1d14175ee87ae6fcdc8e811c1e116c5c55fe93cda8a2b05e
|
|
| MD5 |
6b8f12b8d264043134378433fd16d3c9
|
|
| BLAKE2b-256 |
eb76ff406edc6993a92e2381b74e41b75b008a9b61bafe7a9de6a4c765ede1c6
|
Provenance
The following attestation bundles were made for kritrim_smriti-1.0.0.tar.gz:
Publisher:
release.yml on Ashut90/pdf-tutor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kritrim_smriti-1.0.0.tar.gz -
Subject digest:
5bad98e307febc3a1d14175ee87ae6fcdc8e811c1e116c5c55fe93cda8a2b05e - Sigstore transparency entry: 1723804297
- Sigstore integration time:
-
Permalink:
Ashut90/pdf-tutor@372ed5d1c1507b8a9760476c1056181b62f0f0fd -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Ashut90
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@372ed5d1c1507b8a9760476c1056181b62f0f0fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file kritrim_smriti-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kritrim_smriti-1.0.0-py3-none-any.whl
- Upload date:
- Size: 43.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
788645006969fca24444e70b5da76c7c763c21da6654f6eb17dbf8006d2051eb
|
|
| MD5 |
4096191664ec357e856e94d79a38dc36
|
|
| BLAKE2b-256 |
09f03d131dd5a12c68a993c698edc52323166b559457a3a0611e29659c635ae7
|
Provenance
The following attestation bundles were made for kritrim_smriti-1.0.0-py3-none-any.whl:
Publisher:
release.yml on Ashut90/pdf-tutor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kritrim_smriti-1.0.0-py3-none-any.whl -
Subject digest:
788645006969fca24444e70b5da76c7c763c21da6654f6eb17dbf8006d2051eb - Sigstore transparency entry: 1723804490
- Sigstore integration time:
-
Permalink:
Ashut90/pdf-tutor@372ed5d1c1507b8a9760476c1056181b62f0f0fd -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Ashut90
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@372ed5d1c1507b8a9760476c1056181b62f0f0fd -
Trigger Event:
push
-
Statement type: