Skip to main content

About the project

Small AI models run free, offline and privately on an ordinary laptop, but they’re unreliable. When I asked Gemma 3 1B for the EMI on a “5 lakh” loan, it wrote principal: “5 lakh” where a number was needed and failed. The people who’d benefit most from an offline helper, those with poor connectivity and regional languages, get the least reliable model.

What it does
Hisaab-Kitaab answers everyday money-maths questions (EMI, GST, discounts, interest, percentages, unit conversion) in English, Hinglish, Hindi and Punjabi, using a 1B open-weight model on a CPU-only laptop with no internet. The model never does the maths. It picks a tool and extracts the numbers, and Python does the exact calculation.

How I built it
The project is the harness around the model: a number normaliser (so “5 lakh” becomes 500000), a keyword shortlist that narrows 7 tools to 1 or 2, and a grammar that forces valid output. I benchmarked four modes plus one experiment. There’s a terminal-style web UI that runs the model alone next to the harness, and a recorded replay hosted online (labelled as a replay).

Results and honesty
On 10 questions written after the modes were built, the model alone got 1 right and the harness got 5. On my 20 development tasks it reached 17/20, but I tuned it on those, so that overstates it. The YES/NO experiment never finished because my local server hung, so I report it as inconclusive.

Challenges
The most dangerous failure was a confident wrong answer: a shop discount became an interest calculation and printed Rs 200 instead of Rs 600. I also found that Python’s localhost lookup was adding about 2 seconds per call on Windows, and fixing it cut latency from about 3 s to about 1 s.

What’s next
Better number reading, a larger independent test set, and fuller Hindi and Punjabi coverage.

Built with
Python (standard library), llama.cpp, Gemma 3 1B, GBNF grammars, Vercel. Developed with an AI assistant (Claude), as disclosed in the README.

Built with

pythonllamagemmaGBNF grammar-constrained decoding

Prize Categories Entered

  • DigitalOcean

    Best Open-Source AI Project

    Submitted