PDF GPT is a PyQt5-based desktop application that extracts text from PDF files and translates it to any target language using locally running Ollama language models. The application features a modern, intuitive interface with drag-and-drop functionality, real-time progress tracking, and seamless background processing.
Before running the application, ensure you have:
- Python 3.6 or higher installed on your system
- Ollama installed and at least one model downloaded (see installation steps below)
- Required Python packages:
PyPDF2,ollama,PyQt5,requests(see installation steps)
- Visit https://ollama.ai and download Ollama for your operating system
- Install Ollama following the instructions for your platform
- Verify installation by opening a terminal and running:
ollama --version
Before using the application, you need to download at least one Ollama model. Recommended models:
# Small, fast model (good for testing)
ollama pull gemma3:1b
# Medium-sized, balanced model
ollama pull llama2
# Larger, more capable model
ollama pull mistralYou can browse all available models at https://ollama.ai/library.
-
Clone the repository:
git clone https://github.com/loyft/pdf-gpt.git cd pdf-gpt -
Install required Python libraries:
pip install -r requirements.txt
Or install manually:
pip install PyPDF2 ollama PyQt5 requests
Important: Ollama must be running before you start the PDF GPT application.
Option 1: Desktop Application (Recommended)
- macOS: Launch Ollama from Applications folder. It will start automatically in the background.
- Windows: Launch Ollama from the Start menu. The app runs in the system tray.
- Linux: Launch the Ollama desktop app if installed.
Option 2: Command Line
- Open a terminal and run:
Keep this terminal window open while using the PDF GPT.
ollama serve
To verify Ollama is running correctly, open a terminal and run:
curl http://localhost:11434/api/tagsYou should see a JSON response listing your installed models. If you get a connection error, Ollama is not running.
Note: The Ollama desktop application typically starts automatically when you log in. The PDF GPT connects to Ollama at http://localhost:11434 by default.
-
Ensure Ollama is running (see Starting Ollama section above)
-
Launch the PDF GPT:
python main.py
-
Drag and drop a PDF file into the "PDF File" area at the top of the window
-
Enter the target language (e.g.,
english,spanish,german,french) -
Enter the Ollama model name (e.g.,
llama2,mistral,gemma3:1b)- Must be a model you've downloaded with
ollama pull - The application will verify the model exists before starting translation
- Must be a model you've downloaded with
-
Click "Translate Text"
-
When done you can open the translated file in the same directory as the original file:
originalname_targetlanguage.txt
- Improved UI/UX
- Background threading to prevent freezing issues
- Improved output file naming
- Custom model input instead of predefined (limited) dropdown menu
- Real-time progress tracking
- Improved error handling and connection verification
- Added drag-and-drop PDF functionality
- Added model selection dropdown
- File output with option to open translated file
- Basic error handling
- Initial release
- Basic PDF text extraction
- Translation using OpenAI GPT models
- Command-line interface with basic translation functionality
Contributions are welcome, please raise an issue or create a pull request. :)
This project is licensed under the MIT License - see the LICENSE file for details.