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 Exported mind map
Main window Mind map

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.1.0.tar.gz (44.0 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.1.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kritrim_smriti-1.1.0.tar.gz
  • Upload date:
  • Size: 44.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 4ca7e720bc0009287d6ec258a9dd3a35b85847c9184a0828d602975e3e8f29d1
MD5 c69638eddd8462a776101b072250f101
BLAKE2b-256 bffbbebcf17a9870eea86ea3c06d40df7e7469833111f04780ebe3928721443a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: kritrim_smriti-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc03f97f9eb48b4baeabe8602ee25eec5b7815dcafd2e556347f7bf8353cd6d4
MD5 7ed15675f8a19fea5013c789c0aa3a59
BLAKE2b-256 c2c8b52191a17b6d26089811020d365e4da33d09cb31c0fb3ad67d05604a4024

See more details on using hashes here.

Provenance

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