How catchthetornado/pdf-extract-api works
Main Components
a) Client Layer:
• CLI Client (in /client directory)
• HTTP API Endpoints
• Supported file formats (PDF, images)
b) Application Layer:
• FastAPI Application (main.py)
• Celery Task Queue System (tasks.py)
• OCR Processing Pipeline
• LLM Processing Pipeline
c) Storage Layer:
• Multiple Storage Strategies (shown in /storage_strategies)
• Redis Cache
• Storage Profiles System
d) Processing Components:
• OCR Strategies (shown in /ocr_strategies)
• Ollama LLM Integration
• Task Processing Workers
Component Relationships
[Client Layer] → [API Layer] → [Task Queue] → [Workers] → [Storage]
• ↕ ↕ ↕ ↕
• [Redis Cache] [OCR Strategies] [LLM] [Storage Strategies]
Specific Implementation Details
OCR Strategies:
• Marker
• LLama Vision
• Tesseract
Storage Strategies:
• Local Filesystem
• Google Drive
• AWS S3
Key Technical Elements
Components:
• Redis (for caching and Celery backend)
• Ollama (LLM processing)
• FastAPI (REST API)
• Celery (task processing)
Configuration Elements
Configuration sources:
• Environment variables
• Storage profiles
• Strategy selection
• The modular nature of the system (strategy pattern usage)
• Asynchronous processing capabilities
• Multiple storage options
• Caching mechanism
Deployment Context
Containers:
• FastAPI App container
• Celery Worker container
• Redis container
• Ollama container