Runs on your laptop Works with Wi-Fi off Gemma 4 E4B via Ollama Open source (Apache-2.0)

Kaagaz

"Your documents, ready for any form. Offline."

Kaagaz (Hindi: "paper") is a local, offline document assistant for Indian forms. Every scholarship, admission and exam portal wants the same documents in different formats ("photo 3.5 × 4.5 cm, JPG, 20–50 KB", "marksheet PDF under 200 KB"). Kaagaz reads your folders, recognises each document with Gemma 4 E4B running locally through Ollama, and when you paste a portal's upload instructions it builds a folder of files converted, cropped, compressed and renamed to the exact rules, then re-opens and measures every output (PASS / WARN / FAIL with real numbers). It flags missing and expired documents before you start the form.

PASS

Built for the DEV Hacktoberfest Open-Source AI Challenge, Week 3 ("Slow and Steady").

Demo

See Kaagaz Build a Real Scholarship Packet

Gemma 4 reads the portal's rules and labels your files. Plain Python picks, converts and measures every output. All on the laptop.

Kaagaz Library screen showing 4-column document cards and detail drawer
1. Library & Documents Every document labelled by Gemma 4, with a validity badge.
Kaagaz Review Queue screen verifying low-confidence signature scan
2. Review Queue Unsure labels wait for a one-click check from you.
Kaagaz Match screen highlighting matched, expired and missing files
3. Requirement Match Flags 1 expired certificate and 1 missing passbook early.
Kaagaz Build Results screen showing PASS, WARN, and measured KB limits
4. Measured Build Output Every output re-opened and measured. A file that fails is never saved.
The Friction

Every Indian Portal Has Strict, Arbitrary Document Rules

Applying for scholarships, college admissions, and competitive exams usually means an agonizing maze of rejected uploads.

Photo: 3.5 × 4.5 cm · JPG · 20–50 KB
The Pain: Rejected Uploads

Wrong aspect ratios & blurry faces

Phone photos are several MB and the wrong shape. Shrinking them by hand usually ends up too blurry, too small in KB, or the wrong size in cm.

Marksheet: PDF ≤ 200 KB · Front + Back
The Pain: Privacy Risks

Shady online PDF compressors

To hit a KB limit, people upload marksheets and ID documents to random online compressors.

Income Certificate: Issued on/after 01 Apr 2026
The Pain: Deadlines Blown

Expired certificates discovered late

An income certificate issued before the form's cutoff date can slip through the upload and only get caught later, at document verification.

Workflow Architecture

How Kaagaz Works

Five steps. The AI decides what; plain code does the work and checks it.

1

Scan

Read-only folder scan. Unmodified files indexed with SHA-256 caching to skip re-reading.

2

Label

Gemma 4 returns schema-checked JSON. Ambiguous files route to an interactive review queue.

3

Paste rules

Raw text from portal instructions is parsed offline into an editable checklist table.

4

Build

Plain Python converts, crops, compresses and renames each file to the exact rules.

5

Verify

Every output is re-opened and measured: format from its first bytes, KB, pixels, pages.

"AI decides what. Code does how. Code verifies."

The language model extracts semantic intent and document classification. Pure deterministic Python controls sizing, compression, and file creation.

Honest numbers

Measured, Not Claimed

Numbers from real runs on my laptop (RTX 4050 Laptop GPU, 6 GB).

Measurement Metric Observed Value / Verification Status
GPU memory during a vision call 4.5 GB of 6 GB (RTX 4050 Laptop) Measured
Time per document (warm) median 2.1 s, p95 3.0 s Measured
Building a 6-file packet 0.3 s Measured
Requirement parser on the specimen rules text 27 / 27 limits (v1 was 22 / 27) Smoke test
Dev set (13 specimen documents) 13 / 13 handled correctly (11 labelled, 2 sent to review) Smoke test

Specimen and dev-set numbers come from documents I made myself, so they are a smoke test, not a benchmark.

Privacy

Your documents stay on your laptop

Kaagaz only talks to the AI model running on your own machine. It never uploads anything.

Only connection: 127.0.0.1:11434

The only network connection is to Ollama on this laptop. If the model host is set to anything else, Kaagaz refuses to start.

No usage statistics

Kaagaz has no analytics code, and Streamlit's own usage statistics are turned off. The app only listens on 127.0.0.1.

Last 4 Digits Only For IDs

Aadhaar, PAN and account numbers are kept as the last 4 digits only (e.g. XXXX 9012). A scrubber masks them in every saved field.

Original Files Are Read-Only

Kaagaz never changes, moves or deletes your files. Outputs go to a separate Packets folder.

Quickstart

Set It Up on Your Laptop

Everything runs natively in Windows PowerShell. Follow these prerequisites and steps.

System Requirements

  • OS: Windows 11
  • GPU: NVIDIA GPU 6 GB+ VRAM with current driver
  • Runtime: Python 3.12
  • Model Host: Ollama installed & running
Important Tip: Your PowerShell terminal prompt must start with (.venv) before executing any kaagaz commands.
1. Pull the Gemma 4 vision model in Ollama
ollama pull gemma4:e4b
2. Clone Kaagaz repository
git clone https://github.com/kashyapanand21/kaagaz.git
cd kaagaz
3. Create and activate virtual environment
py -3.12 -m venv .venv
.venv\Scripts\Activate.ps1
4. Install Kaagaz package
pip install -e ".[ui,dev]"
5. Run system diagnostics & launch UI
kaagaz doctor
kaagaz ui
User Guide

How to Use Kaagaz

Six screens. Here's what each one is for.

Onboarding

1. First Run

Check the local AI status, select your monitored folders (e.g. Scans, WhatsApp downloads), input your candidate name and roll number, then click Start.

Archive

2. Library

Scan and index your documents. Search by name like "12th marksheet", apply filters, and open any card to see what Gemma read and how sure it was.

Verification

3. Review Queue

Quickly confirm or fix low-confidence labels with speedy keyboard shortcuts: Ctrl+Enter to confirm label or Ctrl+→ to skip.

Core Engine

4. New Packet

Four-step guided pipeline: Paste portal instructions → Checklist review → Match files against rules → Build verified outputs.

History

5. Packets

Every packet you've built (e.g. NSP Scholarship 2026). Open its folder, or rebuild it with today's library.

Sovereignty

6. Settings & Privacy

Choose folders, set your name and roll number, check the local model, or delete all of Kaagaz's own data.

Command Line Interface (CLI Commands) Expand to view headless terminal tools

Everything the app does is also a command:

kaagaz scan kaagaz classify kaagaz parse FILE --save x.json kaagaz match x.json kaagaz build x.json --name "NSP 2026"
Diagnose

Troubleshooting & Known Issues

Fast fixes for common local runtime and configuration hurdles.

kaagaz is not recognized as an internal or external command
You must activate the Python virtual environment in your active PowerShell window first. Run:
.venv\Scripts\Activate.ps1
Verify that your command prompt begins with (.venv) before re-running kaagaz.
"The local AI isn't running"
Start the desktop Ollama application or start the daemon from your terminal. Ensure the Gemma 4 vision model has finished downloading by running:
ollama pull gemma4:e4b
Is Kaagaz really running on the GPU?
Open a PowerShell window while Kaagaz is processing a document and run:
ollama ps
The terminal output should explicitly state 100% GPU offload.
OneDrive files are being skipped
Cloud-only placeholder files (Files On-Demand) cannot be read while offline. In Windows File Explorer, right-click your monitored documents folder and choose "Always keep on this device".
Model fails to load with "CUDA error: shared object initialization failed"
Ollama's model runner crashed while loading Gemma on my RTX 4050 after Ollama auto-updated (0.40.11, CUDA 13 backend). Kaagaz retries 3 times, then pauses without losing work. Workaround: quit Ollama from the system tray, run setx OLLAMA_LLM_LIBRARY cuda_v12, start Ollama again and open a new terminal. If that doesn't help, reinstall an earlier Ollama release.
Roadmap

Honest Limitations & Next Steps

What Kaagaz does not yet do. No overpromising—clear, factual transparency.

Hindi Name Transliteration

Hindi names on certificates (e.g. रिया शर्मा) do not yet automatically cross-match against an English profile name (Riya Sharma). For now Kaagaz shows a “name differs” note instead.

Photo Background Verification

Photo backgrounds are strictly checked for compliance (e.g. verifying white backdrop), but are not replaced. Retake the photo if the check fails.

Front & Back Photo Stitching

Separate phone photos of the front and back of ID cards or marksheets are not merged into a single multi-page PDF automatically yet. For now, combine them into one PDF before scanning.

Windows-First Support

The initial release is tuned and tested specifically for Windows 11 with NVIDIA hardware. macOS and Linux are untested.

Questions & Answers

Frequently Asked Questions

Does Kaagaz upload my documents to any server?
No. Nothing leaves your laptop. Kaagaz never uploads anything; you upload the final prepared files to the respective government or academic portal yourself.
Do I need an active internet connection?
Only during initial installation to download Ollama, the model weights, and Python packages. Once setup is complete, Kaagaz works completely with Wi-Fi switched off.
Which document types does Kaagaz recognize?
Kaagaz recognizes 28 standard document types commonly requested in Indian portals, including secondary marksheets, caste & income certificates, domicile papers, bank passbooks, passport photographs and signatures. Anything else is labelled “other” and sent to review.
Can I edit the extracted checklist rules?
Yes. Every single cell in the generated checklist table (file size bounds, allowed extensions, dimensions, naming tokens) is completely editable before matching and building.