An offline AI-powered application that automatically generates educational questions from study materials using a locally hosted Large Language Model (LLM). The application supports multiple document formats and performs OCR on scanned documents, allowing students to generate questions while keeping their documents completely private.
Built for OSDHack 2026 – On-Device AI
- Supports PDF, DOCX, PPTX and TXT documents.
- OCR support for scanned documents using Tesseract OCR.
- Offline AI-powered question generation using Ollama.
- Generates:
- Multiple Choice Questions (MCQs)
- Short Answer Questions
- Long Answer Questions
- Document Summaries
- Difficulty Selection
- Easy
- Medium
- Hard
- Streamlit-based web application.
- Runs completely on-device without sending user documents to cloud AI services.
Most AI-powered educational tools require users to upload their study material to cloud-based services, raising privacy concerns and requiring a stable internet connection.
AI Question Generator addresses these limitations by leveraging locally hosted Large Language Models through Ollama. Every stage—from document processing to AI-powered question generation—runs entirely on the user's machine.
This provides:
- Complete document privacy
- Offline functionality
- No cloud dependency
- Faster local inference
- Better control over user data
-
Upload a document in PDF, DOCX, PPTX or TXT format.
-
The application extracts text from the uploaded document.
-
If the uploaded document contains scanned content, Tesseract OCR is used to recover the text.
-
The extracted text is processed locally and sent to a Large Language Model running through Ollama.
-
Based on the selected question type and difficulty level, the AI generates:
- Multiple Choice Questions
- Short Answer Questions
- Long Answer Questions
- Document Summaries
-
The generated content is displayed through the Streamlit web interface.
Throughout the entire workflow, user documents remain on the local machine.
- DOCX
- PPTX
- TXT
- Scanned PDFs (OCR)
- Python
- Streamlit
- Ollama
- Local Large Language Models
- PyMuPDF
- python-docx
- python-pptx
- pytesseract
Clone the repository
git clone https://github.com/YOUR_USERNAME/AI-Question-Generator.gitMove into the project directory
cd AI-Question-GeneratorInstall dependencies
pip install -r requirements.txtInstall Ollama
Download the required model
ollama pull qwen2.5:3bStart Ollama
ollama serveRun the application
streamlit run app.py- Launch the Streamlit application.
- Upload a supported document.
- Select the desired question type.
- Choose the difficulty level.
- Enter the number of questions.
- Click Generate.
- View the generated questions.
- Interactive Practice Mode
- AI-based Answer Evaluation
- PDF Export
- Question History
- Progress Tracking
- Additional Local LLM Support
Screenshots will be added after the hackathon submission.
This project is licensed under the MIT License.
Sanjay Viswaq M
- GitHub: https://github.com/sanjay3941
- LinkedIn: https://www.linkedin.com/in/sanjay-viswaq/