Skip to content

RealWorldApplications/legible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document Helper

A privacy-first tool that lets immigrants photograph any official document — tax notice, school letter, lease, utility bill, benefits letter — and get a plain-language explanation in their native language, plus urgency detection and concrete next steps.

Everything runs locally. Nothing leaves your machine.


Features

  • Upload or photograph any official document
  • Plain-language explanation in 11 languages
  • Document type classification (Tax Notice, Eviction Warning, etc.)
  • Urgency countdown — "You have 23 days to respond"
  • Numbered next steps
  • Key terms glossary with simple definitions
  • Encrypted local history — past scans stored on-device only, encrypted with a key that never leaves your machine

Prerequisites

1. Install Ollama

Download and run the installer from https://ollama.ai

After installation, Ollama runs automatically in the background.

2. Pull the model

Open a terminal and run:

ollama pull gemma4:latest

This downloads ~3 GB. Only needed once.


Setup

# Clone / download this project, then:
pip install -r requirements.txt

Run

Terminal 1 — start Ollama (skip if it's already running):

ollama serve

Terminal 2 — start the app:

uvicorn main:app --reload

Open your browser at http://localhost:8000


Usage

  1. Click the upload area or tap "Tap to photograph or upload" on mobile
  2. Select your document image (or take a photo directly on a phone)
  3. Choose the language you want the explanation in
  4. Click Analyze Document
  5. Wait ~30–60 seconds for the local model to process

Environment variables

Variable Default Description
OLLAMA_MODEL gemma4:4b Ollama model name
OLLAMA_URL http://localhost:11434/api/generate Ollama API endpoint

Supported languages

Spanish · Chinese (Simplified) · Tagalog · Vietnamese · Arabic · Hindi · Korean · French · Portuguese · Russian · English


History storage

Past scans are saved automatically to .history/records/ as Fernet-encrypted files. The encryption key lives in .history/key.bin and never leaves your machine. Both paths are in .gitignore so they won't be accidentally committed.

To clear all history, delete the .history/ directory. A new key is generated automatically on the next run.


Privacy

This tool uses Gemma 4 E4B running fully on-device via Ollama. Your document images and their contents are never uploaded to any server or third-party API. All processing — including history storage — happens locally on your machine.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors