Inspiration

A lab report is a page of numbers and abbreviations like HGB, MCV or 25-OH, and the doctor visit often lasts ten minutes. People google each value, find ranges that don't match their lab, and either panic or miss something. I wanted a tool that explains your own form honestly and helps you ask better questions, without pretending to be a doctor.

What it does

LabLens turns a photo or PDF of a lab report into a plain-language explanation in English, Russian or Kazakh. It is for patients and caregivers who get results before anyone explains them, people comparing labs or countries, and Russian and Kazakh speakers.

  • Upload a photo, a PDF or up to 5 camera pages.
  • Check values: two different AI models read the form. Each value is marked agree, mismatch or missing. A mismatch shows both readings, and Confirm stays locked until you resolve it.
  • Results: red flags labelled "Critical-value rule" or "AI judgement", value cards with range bars and converted units, and patterns phrased as questions for a doctor.
  • Trends in one unit across labs, and a printable one-page doctor summary.
  • Chat with streamed answers, voice questions (you review the transcript before sending) and read aloud.

It never diagnoses, and your history stays in your browser.

How I built it

FastAPI backend, plain JavaScript frontend, Chart.js, Docker on Render.

AI (google-genai SDK, free Gemini API tier):

  • Gemini 3.5 Flash-Lite reads the report and writes explanations, streamed chat answers and voice transcripts.
  • Gemini 3.1 Flash-Lite reads the same report independently, in parallel. A different generation means different mistakes.
  • Gemini 4 Hydrogen is the backup when the main model is busy.
  • Claude is an optional paid provider.

Answers are schema-validated JSON. The rule: models read and explain; code decides. Code parses numbers, compares them with the printed range, converts units (35 tests, names in EN/RU/KK), applies critical-value rules and computes trends. 275 automated tests run with the models mocked.

Challenges I ran into

  • Free-tier capacity. Gemini 4 Hydrogen and the larger Flash models allow only 5 requests a minute and ran out of their daily quota after about 20–35 requests, so both readers became Flash-Lite models (15 a minute, about 5 s per reading), with a retry, a backup model and an answer cache.
  • Speed. A Russian explanation took about 90 s at the default thinking level and about 20 s at low, so every call runs at low.
  • Units across languages. "×10⁹/л", "мкмоль/л" and "µIU/mL" must map to one unit; unknown units are never guessed.
  • Kazakh. Natural Kazakh, not Russian, needed explicit prompt rules.

Accomplishments that I'm proud of

  • When the two models read a value differently, the app stops and asks the person before anything is explained, so a misread digit does not turn into a confident wrong explanation.
  • Safety decisions live in tested code, not in a prompt.
  • A complete app in three languages, including Kazakh.

What I learned

  • For health data, a visible disagreement between two models is more useful than one model that always sounds sure.
  • Free-tier AI must be designed for failure from day one.

What's next for LabLens

  • Usability tests with patients and a text review by clinicians.
  • Urinalysis and coagulation tests; ranges for children and pregnancy.
  • A paid, no-training API tier so people can use real results.

Responsible AI

  • No diagnosis, treatment or doses, enforced in every prompt; the disclaimer is fixed text from code.
  • Deterministic safety net: critical-value rules in code (for example potassium above 6.2 mmol/L) always run, whatever the model says.
  • Unit conversion in code, never by the model.
  • Human in the loop: you confirm every value; disagreements between the two models are shown, not hidden.
  • Browser-only storage: no database, no health data in logs; history stays in your browser, with export and delete.
  • Free-tier disclosure: Google may use free-tier submissions to improve its products. The home page says so in all three languages, and the demo uses synthetic data only. Please don't upload real personal results.

Try it

The first load can take about a minute while the free server wakes up. Try demo is instant and makes no AI calls; Try a sample report runs a synthetic form through the live AI.

Built With

Share this project:

Updates

Submission history