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.2.tar.gz (48.9 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.2-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kritrim_smriti-1.3.2.tar.gz
  • Upload date:
  • Size: 48.9 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.2.tar.gz
Algorithm Hash digest
SHA256 4aa068b472597129390b6681352d5262b2e80a45220d4d12b1ed24ab2c6016f0
MD5 9cbe9842485bea47961cde3df9ef325a
BLAKE2b-256 bd619b543f5a60ccbe40d872a205133311a8f6bee2206df26371d9c492cae90f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kritrim_smriti-1.3.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: kritrim_smriti-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 50.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 86aea248cda6d55500a045f8e51ea5d7c6b063c775902d9ad5243c23ce6c338f
MD5 03f3936030ea47125d64ad39188fbb0a
BLAKE2b-256 a34a4c4b8b305a80199db400df6274233bf540614ac3bb256a33a9b2d130d36a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kritrim_smriti-1.3.2-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