# akalroop/llm_pdfparser architecture

> Architecture diagram of the GitHub repository akalroop/llm_pdfparser, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akalroop/llm_pdfparser
- Repository: https://github.com/akalroop/llm_pdfparser

## Overview

This repository contains local-LLM PDF question-answering scripts plus a minimal `codespace` greeting command. The PDF workflow extracts page text, submits it with a question to an Ollama-compatible chat endpoint, and prints the response; one script uses stricter medical-document instructions. The two scripts implement parallel variants, not a shared pipeline. The package command is separate. The README describes the project broadly, so the workflow shown comes from the sampled scripts; no notebook behavior is inferred.

Main entry points: [`pdf-reader.py`](https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py) (Medical Q&A), [`pdfReader-claude.py`](https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py) (Document Q&A), [`pyproject.toml`](https://github.com/akalroop/llm_pdfparser/blob/main/pyproject.toml) (Codespace command), [`src/codespace/__init__.py`](https://github.com/akalroop/llm_pdfparser/blob/main/src/codespace/__init__.py) (Greeting)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_pdf_input["PDF input"]
node_reader_cli["PDF reader CLI<br/>[pdf-reader.py]"]
node_reader_extract["Text extraction<br/>[pdf-reader.py]"]
node_reader_qa["Medical Q&amp;A<br/>[pdf-reader.py]"]
node_claude_cli["Alternate reader CLI"]
node_claude_extract["Text extraction"]
node_claude_qa["Document Q&amp;A"]
node_ollama["Ollama endpoint"]
node_codespace_command["Codespace command<br/>[pyproject.toml]"]
node_greeting["Greeting<br/>[__init__.py]"]

node_user -->|"runs with"| node_reader_cli
node_user -->|"runs with"| node_claude_cli
node_pdf_input -->|"reads pages"| node_reader_extract
node_reader_cli -->|"calls"| node_reader_qa
node_reader_qa -->|"calls"| node_reader_extract
node_reader_qa -->|"requests answer"| node_ollama
node_reader_qa -->|"prints answer"| node_user
node_pdf_input -->|"reads pages"| node_claude_extract
node_claude_cli -->|"calls"| node_claude_qa
node_claude_qa -->|"calls"| node_claude_extract
node_claude_qa -->|"requests answer"| node_ollama
node_claude_qa -->|"prints answer"| node_user
node_user -->|"runs"| node_codespace_command
node_codespace_command -->|"dispatches to"| node_greeting

click node_reader_cli "https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py"
click node_reader_extract "https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py"
click node_reader_qa "https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py"
click node_claude_cli "https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py"
click node_claude_extract "https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py"
click node_claude_qa "https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py"
click node_codespace_command "https://github.com/akalroop/llm_pdfparser/blob/main/pyproject.toml"
click node_greeting "https://github.com/akalroop/llm_pdfparser/blob/main/src/codespace/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_pdf_input,node_ollama toneIndigo
class node_reader_cli,node_reader_extract,node_reader_qa,node_claude_cli,node_claude_extract,node_claude_qa,node_codespace_command,node_greeting toneTeal
```

## Components

### Other components

- **User**
- **PDF input**
- [PDF reader CLI](https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py): `pdf-reader.py`
- [Text extraction](https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py): `pdf-reader.py`
- [Medical Q&A](https://github.com/akalroop/llm_pdfparser/blob/main/pdf-reader.py): `pdf-reader.py`
- [Alternate reader CLI](https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py): `pdfReader-claude.py`
- [Text extraction](https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py): `pdfReader-claude.py`
- [Document Q&A](https://github.com/akalroop/llm_pdfparser/blob/main/pdfReader-claude.py): `pdfReader-claude.py`
- **Ollama endpoint**
- [Codespace command](https://github.com/akalroop/llm_pdfparser/blob/main/pyproject.toml): `pyproject.toml`
- [Greeting](https://github.com/akalroop/llm_pdfparser/blob/main/src/codespace/__init__.py): `src/codespace/__init__.py`

## Connections

- User → PDF reader CLI: runs with (evidence: `pdf-reader.py`)
- User → Alternate reader CLI: runs with (evidence: `pdfReader-claude.py`)
- PDF input → Text extraction: reads pages (evidence: `pdf-reader.py`)
- PDF reader CLI → Medical Q&A: calls (evidence: `pdf-reader.py`)
- Medical Q&A → Text extraction: calls (evidence: `pdf-reader.py`)
- Medical Q&A → Ollama endpoint: requests answer (evidence: `pdf-reader.py`)
- Medical Q&A → User: prints answer (evidence: `pdf-reader.py`)
- PDF input → Text extraction: reads pages (evidence: `pdfReader-claude.py`)
- Alternate reader CLI → Document Q&A: calls (evidence: `pdfReader-claude.py`)
- Document Q&A → Text extraction: calls (evidence: `pdfReader-claude.py`)
- Document Q&A → Ollama endpoint: requests answer (evidence: `pdfReader-claude.py`)
- Document Q&A → User: prints answer (evidence: `pdfReader-claude.py`)
- User → Codespace command: runs (evidence: `pyproject.toml`)
- Codespace command → Greeting: dispatches to (evidence: `pyproject.toml`)
