---
id: "lib-2026-11-11-bread-units-from-a-photo-how-i-built-an-app-for"
type: "library"
title: "Bread units from a photo: how I built an app for my son with type 1 diabetes and what one recognition costs (Хлебные единицы по фото: как я сделал приложение для сына с диабетом 1 типа и сколько стоит одно распознавание)"
lang: "RU"
org: "Khlebka (solo developer)"
source_type: "Practitioner post"
date: "2026-11-11"
week: "2026-W46"
url: "https://nosov.ai/library/lib-2026-11-11-bread-units-from-a-photo-how-i-built-an-app-for/"
original_url: "https://habr.com/ru/articles/1106444/"
tier: "A"
tier_name: "Strong evidence"
tier_reason: "A parent-developer's Habr case on a carbohydrate-from-photo app reports unit costs, usage, barcode coverage and an error analysis from 235 user corrections, with design choices tied to the measured failure; a well-documented single case."
summary_basis: "full-text"
original_minutes: "6"
tags: ["business transformation"]
---

# Bread units from a photo: how I built an app for my son with type 1 diabetes and what one recognition costs (Хлебные единицы по фото: как я сделал приложение для сына с диабетом 1 типа и сколько стоит одно распознавание)

Tier A (Strong evidence): A parent-developer's Habr case on a carbohydrate-from-photo app reports unit costs, usage, barcode coverage and an error analysis from 235 user corrections, with design choices tied to the measured failure; a well-documented single case.

Summary based on the full text.

## In short

A Habr sandbox post (11 November 2026) by a father who built Khlebka, a free PWA that estimates carbohydrates and bread units from photos of a plate, for his son with type 1 diabetes. It uses qwen3.6-35b-a3b on Yandex AI Studio, costs about 0.45 RUB per recognition, and was opened on about 11,800 devices in its first 17 days. The most useful finding comes from 235 anonymous user corrections: the model gets carbs per 100 g right but overestimates portion weight, the error that matters most, because overestimated carbs mean too much insulin. The app therefore treats every estimate as an editable draft and does not calculate insulin doses.

## Key numbers

- 0,45 ₽ (0.45 RUB): cost of one photo recognition including prompt cache and barcode web search; the whole app runs at about 300-500 RUB a day
- 0,75: median ratio of user-corrected portion weight to model-estimated weight across 235 corrections; carbs per 100 g had a median error of zero
- 54 %: barcode searches with no product found (940 of 1,754) in the first two weeks
- 11 800: devices that opened the app in 17 days; about 3,000 people calculated something at least once
- 0.5 s vs 5.5 s: response time per photo for Qwen 3.6 35B versus DeepSeek v4.1 Flash on Yandex AI Studio

## What it reports

- Inputs: plate photo, barcode, or photo of the nutrition table; fallback search over about 1,200 products and dishes, including 1,052 items digitised from a Russian reference book and checked by sample.
- Data stays on the phone (localStorage); no accounts; only photos (not stored) and anonymous counters go to the server.
- Model choice: Qwen 3.6 35B with reasoning switched off, since default reasoning consumed max_tokens and returned empty content; then 0.5-2 s per answer. DeepSeek v4.1 Flash was about 1.5 times more expensive and about 5.5 s per photo, so Qwen stayed.
- Cost: about 1,000 tokens per photo, about 0.45 RUB per recognition, 60-70 RUB a month for a family photographing every meal, about 300-500 RUB a day for the whole app. Savings from a 30-day cache by photo hash, a shared product base built from label photos, static prompt first for cache hits (about half of input tokens at the cached price), and a limit of 60 recognitions a day per IP.
- Usage: 17 days, about 11,800 devices, about 3,000 people calculated at least once (2,240 in the last week); a typical day brings about 400 people and 800 photos. Next-day return about 15%, within a week about 10%.
- Barcodes: 1,754 searches, 940 not found (54%); of 762 unfound codes, 621 were searched only once. The national product catalogue API gives nutrition data only to the card owner.
- Errors: 235 weight corrections; people reduced weight in 142 cases and increased it in 62; median ratio 0.75. On the open Nutrition5k set, mean error is about 1 bread unit per plate.
- Infrastructure: started on an existing WordPress host; on day 10 CPU use hit 154 units against a limit of 70 with 64,000 requests a day, fixed by static files and batched analytics.
- No insulin dose calculation: that would make the app a medical device.

## How they got it

The author reports his own production counters, billing figures from Yandex Cloud and anonymised user corrections, plus a check on the public Nutrition5k dataset. The model comparison covers price and latency only.

## Limits

- Error analysis rests on corrections users chose to make, which may skew towards obvious errors.
- Nutrition5k is American cafeteria food; no evaluation on home-cooked Russian meals yet.
- Short observation window (17 days); retention is low and still being worked on.
- Device counts may include repeat opens on different browsers.

## Why it matters for companies

The post shows how to run a vision model in a safety-relevant consumer product cheaply and responsibly: cost per call measured and pushed down with caching, the model kept to drafting, a hard line drawn before medical advice, and user corrections collected as the evaluation set. The finding that the model was accurate on one quantity and biased on another, and that the bias points in the dangerous direction, is the kind of result only field corrections reveal. The barcode gap also shows that data coverage, not model quality, is often the binding constraint.

## Key passages in translation

> Углеводы на 100 г модель называет хорошо — медианная разница с поправкой равна нулю. А вот вес порции она завышает

The model gets carbs per 100 g right: the median difference from the correction is zero. But it overestimates portion weight.

> Для диабета это ровно та ошибка, которая опасна: завышенные углеводы означают лишний инсулин и риск гипогликемии.

For diabetes this is exactly the dangerous error: overestimated carbs mean extra insulin and a risk of hypoglycaemia.

> ИИ на фото — это черновик, а не ответ, и самой ценной функцией оказалось не распознавание, а лёгкая поправка и сбор этих поправок.

AI on a photo is a draft, not an answer, and the most valuable feature turned out to be not recognition but easy correction and the collection of those corrections.

Original: https://habr.com/ru/articles/1106444/
