Skip to main content

About the project

BillSaathi helps Pakistani households understand their electricity bill. Upload a photo of the bill: open-source Gemma 4 reads the numbers, plain Python checks them, and Gemma 4 explains the result in English, Roman Urdu or Urdu with next steps and a polite draft request to the sub-division office. The app never says a bill is wrong; it only says what is worth verifying.

How it works: (1) Read: Gemma 4 (vision) extracts units, readings, billing days, protected status, unit history and total from the photo. It only copies numbers and never calculates. (2) Check: plain Python (checks.py) runs repeatable rules: readings vs. billed units, billing cycle length, usage vs. the household’s own average, and protected status. No AI is used here, so the same bill always gives the same result. (3) Explain: Gemma 4 writes the explanation in the chosen language, with a draft request and a copy button. (4) Save: results are stored in a local SQLite database.

How Gemma 4 is used: it reads the bill photo and writes the explanation in three languages. I use gemma-4-31b-it and gemma-4-26b-a4b-it through the Gemini API (Google AI Studio). Open source: code is public on GitHub under the MIT License; Gemma 4 is open-weight under Apache 2.0. No closed models are used.

Privacy: the photo is never saved; the model is told not to read names, addresses, CNIC, reference or meter numbers; the database stores only numbers, checks and explanations.

Limits: not an official tool of any electricity company; users should compare numbers with their paper bill. The 200-unit protected-consumer limit is an assumption to be confirmed with the distribution company or NEPRA. I tested the reading and explanation steps on a real bill during the event.

Next: measure accuracy on more real bills, try a local Gemma 4 model for privacy, and add a WhatsApp flow.

Demo video note: the video was recorded in the app’s built-in demo mode (sample data) because the Gemini API returned a temporary 500 INTERNAL error at recording time. The code calls Gemma 4 through the Gemini API (see analyzer.py).

Built with

pythonstreamlitGemma 4Gemini API sqlitepillowgemma

AI tools

Coded withClaude CodeClaude Sonnet 5.5

Prize Categories Entered

  • Deepmind Google

    Best Use of Gemma 4

    Submitted
  • DigitalOcean

    Best Open-Source AI Project

    Submitted