Skip to main content

SnapAssist AI – real-time clipboard-to-hints assistant

Project description

Hintify Logo

SnapAssist AI – Real-time Study Assistant


SnapAssist AI is a real-time AI-powered study assistant that helps students solve problems independently by giving progressive hints instead of direct answers.

Take a screenshot of a question (assignments, PDFs, exams, etc.). SnapAssist will:

  • Detect the screenshot from the clipboard
  • Extract text via OCR (Tesseract)
  • Classify the question (MCQ or Descriptive) and estimate difficulty
  • Query an AI model (Ollama locally, or Gemini via API) to generate stepwise hints
  • Show hints in a simple GUI, or print them in headless mode

✨ Features

  • 📸 Cross-platform screenshot detection – Uses clipboard on macOS, Windows, and Linux
  • 🔎 OCR with Tesseract – Robust text extraction via pytesseract
  • 🧩 Question classification – MCQ vs. descriptive
  • ⚖️ Difficulty estimation – Easy / Medium / Hard
  • 🤖 LLM provider selection – Local via Ollama, or cloud via Gemini
  • ⬇️ Auto-pull Ollama model – Ensures the selected model is available before first use
  • 🔐 Keychain storage – Saves Gemini API key securely via keyring (one-time setup)
  • 🖥️ GUI or headless – Tkinter GUI if available, otherwise prints to console
  • Beautiful, distraction-free UI with styled hints (bold labels, soft colors)

🛠 Tech Stack

Languages & Libraries

  • Python
  • pillow (Image handling, clipboard grab)
  • pytesseract (OCR)
  • tkinter (optional GUI)
  • keyring (secure credential storage)
  • google-generativeai (Gemini API)

External Tools

  • Tesseract OCR → Text recognition
  • Ollama → Local AI inference (default model granite3.2-vision:2b)

📦 Installation

  1. Python deps
pip install -r requirements.txt
  1. Install Tesseract (required)
  • macOS: brew install tesseract
  • Windows: choco install tesseract (or download from the UB Mannheim builds)
  • Linux: sudo apt-get install tesseract-ocr (or your distro equivalent)
  1. Option A: Local via Ollama (recommended for offline)
  • Install Ollama from: https://ollama.com/download
  • The app will auto-pull the model on first run

Packaging / PyPI

This project is ready for publishing to PyPI with pyproject.toml metadata and a console script entry (hintify).

Steps:

  1. Build artifacts:
python -m pip install --upgrade build twine
python -m build
  1. Upload:
python -m twine upload 'dist/*'
  1. Install:
pip install hintify
  1. Option B: Gemini API (cloud)

🚀 Quickstart

Run with GUI (default):

python hintify.py

Install via pip (once published on PyPI):

pip install hintify
hintify

Hotkeys:

  • macOS (global): Cmd+Shift+H to capture (may require Accessibility permission)
  • Windows (global): Ctrl+Shift+H to capture (opens Snipping Tool)
  • In-app: press 'c' while the window is focused, or click Capture

Headless mode (no tkinter installed):

python hintify.py --no-gui

Take a screenshot and copy it to the clipboard. Hints will appear automatically.

  • GUI extras:
    • Click the "Capture (press 'c')" button or press 'c' while the window is focused to select an area and process it immediately (macOS).

⚙️ Configuration

CLI options:

python hintify.py \
  --provider {ollama|gemini} \
  --ollama-model granite3.2-vision:2b \
  --gemini-model gemini-2.0-flash \
  --poll-interval 1.5 \
  --no-gui

Environment variables:

  • HINTIFY_PROVIDER – Force provider (ollama or gemini)
  • HINTIFY_OLLAMA_MODEL – Ollama model ID (default granite3.2-vision:2b)
  • GEMINI_API_KEY – Gemini API key
  • GEMINI_MODEL – Gemini model ID (default gemini-2.0-flash; auto-fallback to gemini-1.5-flash)

Provider behavior:

  • If Ollama is installed, the app uses Ollama and auto-pulls the model if missing
  • If Ollama is not installed, the app offers Gemini setup, opens the API key page, and saves the key in the system keychain
  • If both are available, you can select via --provider or HINTIFY_PROVIDER

Key storage:

  • Gemini key is stored securely with keyring (service = hintify, username = gemini_api_key)
  • To clear the saved key:
python -c "import keyring; keyring.delete_password('hintify','gemini_api_key')"

🔄 How it Works

  1. Monitor clipboard for images
  2. OCR with Tesseract
  3. Classify question type and difficulty
  4. Build a “hints-only” prompt
  5. Query Ollama or Gemini
  6. Show 3–5 progressive hints (concept → formula → setup → approach → nudge)

🧰 Troubleshooting

  • Tesseract not found: install it and ensure tesseract is on PATH (see Installation)
  • Clipboard returns None on Linux: ensure a desktop environment/clipboard manager is running
  • Ollama not found: install from https://ollama.com/download
  • Gemini 2.5 model not available to your account: the app auto-falls back to gemini-1.5-flash

📌 Project Highlights

  • 🔄 Real-time monitoring without user clicks
  • 🖼 Optional GUI that doesn’t interrupt workflow
  • 📚 Learning-first – Encourages solving, not spoon-feeding
  • 🔗 Cross-cutting design – OCR, LLMs, GUI/headless
  • 🛠 Extensible – Swap models, add features, redesign UI easily

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hintify-0.1.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hintify-0.1.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file hintify-0.1.1.tar.gz.

File metadata

  • Download URL: hintify-0.1.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hintify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3669a02c469052e1a0419681e2f701ae40d9d5375a7703486db1115b7e51c5b8
MD5 b6bbf174a3f3e631da62d4a9ae5e3127
BLAKE2b-256 6880d3d9bc8b1d38e98935b2ac09b1a9b8fa337185dd45f80846ff5742e98544

See more details on using hashes here.

File details

Details for the file hintify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hintify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hintify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d31068bc7909dbe3103f57b6052e4408d2d3855003892cc41262d758960f188b
MD5 f222f9301fa938dd7f028d38e63c51c3
BLAKE2b-256 8f1cc69188e0fa6ba791d0f230393b9b01d13ec6d5e90bf568883779f3d939a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page