Skip to main content

An offline-capable, multi-provider AI study assistant for PDF books with VARK learning modes

Project description

PDF Tutor

Python License: MIT CI Platform PRs Welcome

PDF Tutor demo


I read a lot of technical PDFs — textbooks, research papers, course materials. The problem is that reading them passively doesn't really work for me. I'd finish a chapter and retain almost nothing.

I tried highlighting, re-reading, watching videos on the same topic — still slow. What actually helped was having someone explain it to me in different ways. A diagram here, a quick quiz there, hearing it out loud.

So I built this. You drop a PDF in, pick a chapter, and it explains it to you — using whichever style actually works for your brain. Diagrams if you're visual, audio if you're auditory, structured notes, or hands-on commands if you learn by doing. It can also run completely offline if you don't want your study material leaving your machine.


Screenshots

Main window Mind map in the diagram viewer (zoom · copy · save)
Main window Mind map

Any AI-generated diagram opens in a built-in viewer where you can zoom, fit, save as PNG, or copy to the clipboard — and mind maps render offline via a local graphviz fallback when there's no internet.


How it works

The app reads the table of contents from your PDF and lets you pick a chapter. It sends that chapter's text to whichever AI you've set up and asks it to explain things in the style you want.

The learning modes are based on VARK — Visual, Auditory, Read/Write, Kinesthetic. There's also a quiz that figures out which style fits you, and an Omni mode that does all four at once.

Visual — mind maps, flowcharts, comparison tables Auditory — conversational explanation + reads it out loud (TTS) Read/Write — structured notes, definitions, writing prompts Kinesthetic — terminal commands and code experiments you can actually run

You can export notes as Markdown or HTML, generate Anki flashcards, or save interactive mindmaps as HTML files.


AI providers

It supports four providers — use whichever you already have access to:

Provider Cost Where it runs
Ollama Free Your machine (fully offline)
Google Gemini Free tier Cloud
Groq Free tier Cloud
OpenRouter Free tier Cloud

I mostly use Gemini because its 1M token context window handles entire chapters without truncation. Ollama is great when I'm on a plane or don't want data leaving my machine.


Installation

git clone https://github.com/Ashut90/pdf-tutor.git
cd pdf-tutor
pip install -r requirements.txt
python -m pdf_tutor

That's enough to get started. Two optional system packages unlock extra features:

sudo apt install graphviz   # diagram fallback when offline
sudo apt install espeak-ng  # offline TTS (otherwise falls back to gTTS)

On macOS, replace apt with brew. On Windows, graphviz has an installer at graphviz.org/download and TTS uses SAPI5 built-in.


Setting up a provider

Ollama (offline):

# Install from https://ollama.com, then:
ollama pull qwen2.5-coder:7b
ollama serve

Select Ollama in the app — no key needed.

Gemini / Groq / OpenRouter: Get a free key from aistudio.google.com/apikey, console.groq.com, or openrouter.ai, paste it into the app, done.


Architecture

Architecture flow

The UI loads a chapter via core/pdf.py, sends the text with a mode-specific prompt (learning/modes.py) to the selected provider (ai/client.py), and renders any diagrams or charts the AI produces (rendering/visuals.py).


Project structure

pdf-tutor/
├── pdf_tutor/
│   ├── __main__.py          # entry point
│   ├── config.py            # theme, fonts, providers
│   ├── core/pdf.py          # TOC extraction, text/page rendering
│   ├── ai/client.py         # unified client for all 4 providers
│   ├── rendering/visuals.py # diagram / chart rendering
│   ├── learning/modes.py    # VARK prompts and teaching modes
│   └── ui/app.py            # Tkinter GUI
├── tests/
├── requirements.txt
└── pyproject.toml

Running tests

pip install pytest
pytest -v

What's next

Things I want to add but haven't gotten to yet:

  • Conversation history that persists across sessions
  • Multi-PDF library with search
  • EPUB and DjVu support
  • Configurable prompt templates per subject

If any of these interest you, feel free to open a PR.


Contributing

Open an issue first if it's a bigger change — happy to discuss direction before you spend time on it. For small fixes, just open a PR directly.


License

MIT — see LICENSE.


Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kritrim_smriti-1.3.1.tar.gz (48.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kritrim_smriti-1.3.1-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file kritrim_smriti-1.3.1.tar.gz.

File metadata

  • Download URL: kritrim_smriti-1.3.1.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kritrim_smriti-1.3.1.tar.gz
Algorithm Hash digest
SHA256 59d163c2b8b66d832d0a5e143f82b5998208586fdfab91e7046f9aec5b4eb9b9
MD5 4d49aa2a54b86d8f2752106997adcfe5
BLAKE2b-256 809ad173cbc1aaf9384bc41a435194382a2fe5f32f32b45d087f8154aebe909a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kritrim_smriti-1.3.1.tar.gz:

Publisher: release.yml on Ashut90/pdf-tutor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kritrim_smriti-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: kritrim_smriti-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kritrim_smriti-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c075f9799d4fdab2a9171afc42530eb0818ff36456fb83b66d2d666370736b9
MD5 5a55d78b6a1114990d9deb96e898cf51
BLAKE2b-256 d430b2665098e412b1c58edd292f65abc53fd86cbd477538d2113af865378a39

See more details on using hashes here.

Provenance

The following attestation bundles were made for kritrim_smriti-1.3.1-py3-none-any.whl:

Publisher: release.yml on Ashut90/pdf-tutor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page