DEV Community

Cover image for I Was Tired of AI Subscriptions, So I Built a Free Local PDF Tutor for Dense Docs
Ashutosh Tiwari
Ashutosh Tiwari

Posted on

I Was Tired of AI Subscriptions, So I Built a Free Local PDF Tutor for Dense Docs

I work on embedded systems, which means I spend most of my time inside dense PDFs — processor reference manuals, Linux internals textbooks, datasheets that run hundreds of pages.

When "chat with your PDF" tools showed up, I was excited. Then I actually used them for real work, and three problems kept breaking my workflow:

1. Privacy. Most tools make you upload the document to their cloud. I'm not comfortable sending proprietary datasheets or copyrighted textbooks to a server I don't control.

2. Context limits. A single technical chapter can be dozens of pages of diagrams and code. Most wrappers quietly truncate it or start hallucinating once they hit their token limit — and they don't tell you it happened.

3. Summaries don't equal understanding. Reading an AI summary of how Linux memory mapping works feels productive. But it doesn't mean you can actually use it two weeks later. Passive reading isn't retention.

I wanted something local-first, private, and built around remembering what I read — not just summarizing it. So I built PDF Tutor.

🔗 https://github.com/Ashut90/pdf-tutor (open source, MIT)


How it works

PDF Tutor is a desktop app in Python 3.9+ with a three-pane Tkinter interface. The core idea is a hybrid local/cloud model — run everything locally by default, fall back to free cloud APIs only when a chapter is too big for local compute.

                 Local PDF
                    │  (PyMuPDF, parsed locally)
                    ▼
            Orchestration engine
            ┌───────┴────────┐
            ▼                ▼
     Ollama (local)    Free cloud APIs
   qwen2.5-coder /     (Gemini 1M context,
      llama3            Groq, OpenRouter)
            └───────┬────────┘
                    ▼
              Output tracks
     ┌──────────┬──────────┬──────────┐
     │   Anki   │ Diagrams │   TTS    │
     │  export  │ Graphviz │ pyttsx3  │
     └──────────┴──────────┴──────────┘
Enter fullscreen mode Exit fullscreen mode
  • Local parsing. PDFs are parsed entirely on-device with PyMuPDF — no upload, no telemetry.
  • Local inference. Ollama runs the LLM (qwen2.5-coder:7b or llama3) on consumer hardware — it works on a laptop with 8GB RAM.
  • Cloud only when needed. If a chapter is too large for local context, it falls back to a free tier — Gemini (1M context), Groq, or OpenRouter. Your choice.
  • Offline diagrams. Mind maps and flowcharts render with Graphviz/Matplotlib, so they work fully offline.
  • Local audio. Text-to-speech runs on-device with pyttsx3.

The part I actually use: active recall

A summary isn't learning. So the tool's prompts are built around the VARK model — turning a chapter into different formats depending on how you learn:

  • Visual → mind maps, flowcharts, tables
  • Auditory → spoken, conversational explanations
  • Read/Write → notes and writing prompts
  • Kinesthetic → extracted code snippets and shell commands you can actually run

The feature I rely on most is Anki flashcard generation. PDF Tutor turns a chapter into atomic Q&A pairs and exports a .txt deck you import straight into Anki. So instead of reading about Linux memory mapping and hoping it sticks, I'm doing spaced repetition on it the same day:

Q: What kernel structure represents a task's state in Linux?
A: struct task_struct

Q: Difference between a process and a thread in the kernel?
A: Processes have separate virtual memory spaces; threads share their parent's.


Try it

git clone https://github.com/Ashut90/pdf-tutor
cd pdf-tutor

python3 -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt

python run.py
Enter fullscreen mode Exit fullscreen mode

For offline use, pull a local model first: ollama pull qwen2.5-coder:7b. For cloud mode, paste a free-tier API key into the settings.


What's next

  • Conversation history (SQLite)
  • EPUB and DjVu support
  • A built-in spaced-repetition scheduler, so you don't need to export to Anki at all

It's a work in progress and I'd genuinely like feedback — especially from people who deal with a lot of technical docs. If you hit an edge case or have ideas, open an issue or comment here. And if it's useful to you, a star helps others find it.

🔗 https://github.com/Ashut90/pdf-tutor

Top comments (0)