This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
My parents take several medicines every day. Every strip is printed in tiny English text, and every prescription is in a doctor's handwriting. So I often get the same question, usually with a strip held up close to the light:
"यह गोली किसलिए है?" — "What is this tablet for?"
It's a simple question, and they shouldn't have to wait for me to come home to get an answer. Asking the chemist the same thing again feels awkward, and uploading prescriptions to some random app on the internet doesn't feel right either.
So for "Build for a Friend", I built for the two people I'd most like to help.
What I Built
Dawa Samjho (दवा समझो, "understand your medicine") reads a photo of a medicine strip or prescription and explains every medicine in simple Hindi (or English):
- 💊 what it's for, in everyday words
- 🕗 when to take it, only as the doctor wrote it
- ⚠️ general precautions, like "tell the doctor if you feel dizzy"
Three things mattered more to me than features:
- It runs entirely on our laptop. The AI is Gemma, an open-weight model running locally through Ollama. Prescriptions never leave the house, and it works with the Wi-Fi turned off.
- It never guesses a dose. If it can't read something, it says "साफ़ नहीं पढ़ पाए — डॉक्टर या केमिस्ट से पूछें" ("Couldn't read this clearly — ask your doctor or pharmacist") instead of making something up.
- It's built for them, not for me. Large text, big buttons, every label in Hindi with English beside it, and a one-click copy button to share the result in the family WhatsApp group.
It only explains what's already written. It never gives medical advice, and every result ends with the same line:
यह सिर्फ समझने के लिए है। हमेशा अपने डॉक्टर की सलाह मानें।
This is for understanding only. Always follow your doctor's advice.
Demo
The flow is four steps: choose हिंदी, upload or take a photo, press समझाओ · Explain, and read one card per medicine.
I tested it on the strips from our own medicine box, then handed the laptop to my parents. They liked it, and what I liked most was watching them do it themselves, without calling me over.
Code
दवा समझो · Dawa Samjho
Understand your medicine. Take a photo of a prescription or medicine strip and get each medicine explained in simple Hindi or English. Everything runs on your own laptop, so your health data stays on your machine.
Built for the DEV Hacktoberfest Weekend Challenge: Build for a Friend. The "friend" is a parent who takes several medicines a day and can't always read the doctor's handwriting or the English brand names.
⚠️ Status: the core app works (P0). Accuracy on handwritten prescriptions is still being tested, so always check names against the paper.
What it does
- Open the app in your browser (it runs locally).
- Pick a language: हिंदी (default) or English.
- Upload a photo of a prescription or medicine strip, or take one with your camera.
- Press समझाओ · Explain.
- Read one card per medicine
- Name, exactly as printed
- Purpose…
Once Ollama is installed, setup is three commands:
ollama pull gemma3:4b
pip install -r requirements.txt
streamlit run app.py
How I Built It
The stack is deliberately small:
- Gemma 3 (4B), the smallest Gemma that can read images, served by Ollama
- Streamlit for the UI, in pure Python
- Pillow for image handling
- Pydantic to validate the model's output
It all runs on an ordinary laptop with about 7 GB of RAM, integrated graphics and no GPU.
One photo, one pipeline. When you press Explain, the app:
- checks the photo, fixes its rotation and shrinks it to 1024 px,
- makes sure Ollama is running and the model is installed,
- sends the image to Gemma with a strict prompt that asks for JSON only,
- validates that JSON against a schema, retrying once if it's malformed,
- runs the answer through safety rules written in code,
- shows one card per medicine.
The biggest lesson: don't trust a model to be honest about itself
My first real test was a sample of doctor's handwriting that said "Cap Risek 20mg". Gemma read it as "Cap Risele", marked it as perfectly readable, and then added that it should be taken "once" (एक बार). Nothing on the paper said that.
That changed the project. A prompt that says "never guess" isn't enough for health information, so I moved the safety rules into code, where I can test them:
- No invented numbers. If a strength or dose in the answer doesn't appear in the text the model says it read from the image, the medicine is marked "couldn't read clearly". Hindi digits like १ are normalised first, so they're compared fairly.
-
No invented timings. If the text on the paper contains no timing at all (no
1-0-1, noOD/BD, no "after food"), any timing the model adds is removed, and the card says "Not written — ask your doctor". - No made-up advice. If the model doesn't recognise a medicine, the app shows no purpose and no precautions, rather than generic filler.
- Always checkable. "What the app read" is one click away, so you can compare it with the paper, and every result reminds you to match the name against the strip.
All of this is covered by 32 unit tests, including the exact "Risele / once" case that started it.
Honest limits
- Handwriting is hard. On cropped samples of doctors' handwriting, Gemma 4B often gets close but wrong, which is exactly why the code-level checks exist. Printed strips are much easier.
- It's not instant. It takes about 65–90 seconds per photo on my laptop's CPU, and the first photo is slowest while the model loads. That's slow for a demo, but still faster than waiting for me to get home.
Why Does Open Innovation Matter?
For this app, open isn't a nice extra. It's the only way it could exist.
- Privacy you can check. Prescriptions are some of the most personal documents a family has. With an open-weight model running locally, "your data stays at home" isn't a promise you have to trust: turn off the Wi-Fi and watch it still work.
- Free to run, forever. There's no API key, no subscription and no cost per photo. That matters for retired parents, and for every family that could use something like this.
- It speaks our language. Big apps are built for English first. Because the model and the code are open, I could tune the prompt for simple, spoken Hindi, and anyone can adapt it for Bhojpuri, Bengali, Tamil or Marathi without asking anyone's permission.
- Safety anyone can inspect. Every rule that stops the app from inventing a dose is in a file anyone can read, test and improve. For health information, being able to check a system matters as much as how clever it is.
My parents don't know what an open-weight model is. They just know that when they hold up a strip and ask "यह गोली किसलिए है?", something in the house now answers them in their own language, and honestly.
Top comments (0)