A private, offline document reader for people with low vision. Take a photo of a paper, bill, or medicine leaflet. Basira reads it aloud and explains it in simple words, all on your own computer, with no cloud and no subscription.
- What Basira Does
- Why Open Source
- How It Works
- Tech Stack
- Requirements
- Step-by-Step Setup
- Project Structure
- Run It
- Use It From a Phone
- Troubleshooting
- Safety Notes
- Future Ideas
- License
| Step | What happens |
|---|---|
| 1. Capture | The user uploads or photographs a document. |
| 2. Read | OCR (text recognition) turns the image into text. |
| 3. Explain | A small local AI model rewrites the text in simple, clear language and highlights key information: amounts, dates, deadlines, and required actions. |
| 4. Speak | A local text-to-speech voice reads the text or explanation aloud. |
Main features
- Works in Arabic and English
- Very large text and high-contrast interface
- Option to read the original verbatim text or the AI simplified explanation
- Runs fully offline after initial setup
- Free to run, with no accounts or API keys required
- Privacy: Bills, medical papers, and ID documents are sensitive. With local models, nothing ever leaves your device.
- Offline: Works without internet connection.
- Free forever: No per-page fees, subscriptions, or API rate limits.
- Modular components: Easily change the AI model, voice, or OCR language.
- Customizable behavior: Fine-tune prompts to tailor explanation detail.
+----------+ +-----------+ +----------------+ +-----------+ +----------+
| Photo | -> | Tesseract | -> | Local LLM | -> | Piper | -> | Audio |
| (image) | | (OCR) | | (Ollama) | | (TTS) | | + Text |
+----------+ +-----------+ +----------------+ +-----------+ +----------+
+--------------- Gradio web interface ---------------+
| Job | Tool | Why |
|---|---|---|
| Language | Python 3.10+ | Versatile and ecosystem-rich |
| Web interface | Gradio | Fast, high-contrast, accessible UI |
| OCR | Tesseract (pytesseract) |
Open-source OCR with Arabic support |
| Image cleanup | Pillow | Preprocessing to improve OCR accuracy |
| Local AI model | Ollama (qwen2.5:3b) |
Efficient local LLM inference |
| Text to speech | Piper (piper-tts) |
Fast, local neural TTS with Arabic and English voices |
Model tip: 3B models run on most laptops. If your system has 16 GB+ RAM, 7B/8B models provide higher explanation accuracy.
- PC or laptop with 8 GB RAM minimum (16 GB recommended)
- About 10 GB free disk space
- Internet connection for initial setup and model downloads only
- No dedicated GPU required
Install Python 3.10 or newer from https://www.python.org/downloads/ On Windows, ensure you check "Add Python to PATH".
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate- Windows: Download the installer from UB Mannheim. During setup, select the Arabic language data.
- macOS:
brew install tesseract tesseract-lang
- Linux (Ubuntu/Debian):
sudo apt install tesseract-ocr tesseract-ocr-ara tesseract-ocr-eng
- Download Ollama from https://ollama.com/download
- Pull the default model:
ollama pull qwen2.5:3b
pip install -r requirements.txtDownload English and Arabic voice models into the voices/ folder:
python -m piper.download_voices --download-dir voices en_US-lessac-medium ar_JO-kareem-mediumBasira/
├── src/
│ ├── config.py # Settings, paths, and language definitions
│ ├── services/
│ │ ├── ocr.py # Image preprocessing & Tesseract OCR
│ │ ├── llm.py # Ollama text explanation
│ │ └── tts.py # Piper TTS voice synthesis & caching
│ ├── core/
│ │ └── processor.py # Core document processing pipeline
│ └── ui/
│ └── app_ui.py # Gradio user interface layout & styling
├── voices/ # Downloaded Piper ONNX models (gitignored)
├── app.py # Application entry point
├── requirements.txt
├── README.md
└── .gitignore
- Ensure Ollama is running (
ollama serveif not started as a service). - Start the application:
python app.py
- Open http://localhost:7860 in your browser.
- Upload or capture a document, choose language and read mode, and click Read it to me.
- Connect your phone and computer to the same Wi-Fi network.
- Find your computer's local IP address (
ipconfigon Windows orifconfig/ip aon Linux/macOS). - On your phone's browser, navigate to
http://<local-ip>:7860(e.g.,http://192.168.1.50:7860). - Tap the image box and take a photo directly from your phone camera.
| Problem | Fix |
|---|---|
TesseractNotFoundError |
Verify Tesseract is installed. src/config.py checks default Windows paths automatically. |
| Arabic OCR outputs incorrect characters | Run tesseract --list-langs to ensure ara is installed. |
Connection refused from Ollama |
Start Ollama service (ollama serve). |
| TTS audio errors | Ensure voice models are downloaded into voices/. |
| Phone cannot access the UI | Ensure both devices are on the same Wi-Fi and firewall allows port 7860. |
Basira is an assistant tool, not a certified legal or medical authority:
- OCR and language models can make mistakes, especially with low-quality or blurry photos.
- For medical prescriptions or critical legal papers, always verify with a professional or trusted person.
- All processing occurs completely offline on your local machine.
- Voice commands for hands-free scanning (Whisper integration)
- Expanded language support
- Local document reading history
- Local vision models (VLM) for complex layouts
- Progressive Web App (PWA) packaging
Released under the MIT License. Free to use, copy, modify, and distribute.