--- sdk: gradio sdk_version: 6.16.0 app_file: app.py title: Kirana Detective AI short_description: AI invoice auditor for kirana stores — find where money is being lost license: mit tags: - invoice-audit - llm - yolo - gguf - gradio - indian-fmcg - kirana --- # Kirana Detective AI AI-powered inventory and invoice auditor for Indian kirana stores. Upload a distributor invoice and delivery photos — Kirana Detective finds pricing anomalies, missing deliveries, duplicate charges, and GST errors, then reports the total rupee leakage with actionable steps. ## Models All models run **locally — no cloud API calls**. | Model | HuggingFace Repo | Purpose | |---|---|---| | MiniCPM-V 4.6 (transformers) | `build-small-hackathon/minicpm-v-4-6-indian-invoice-extraction-merged` | Invoice OCR + extraction | | MiniCPM5-1B (GGUF) | `build-small-hackathon/minicpm5-1b-indian-fmcg-normalizer` | Product name normalization | | YOLO26n (ONNX) | `build-small-hackathon/yolo26n-indian-fmcg-detection` | Delivery photo product counting | Models are downloaded automatically on first run via `hf_hub_download()` / `AutoModel` and cached locally. ## Running Locally ```bash pip install -r requirements.txt python app.py ``` Requires ~6 GB RAM. First run downloads ~3 GB of model weights. ## Six-Agent Pipeline ``` Invoice Upload → Agent 1 (Extract) → Agent 2 (Normalize) → Agent 3 (Pricing) → Agent 4 (Count) → Agent 5 (Reconcile) → Agent 6 (Report) → ₹ Savings ``` Each agent run is traced and published to HuggingFace Hub for the Sharing is Caring badge. ## Fine-Tuned On - **Invoice extraction**: 500 synthetic Indian invoices (printed GST, handwritten, Tally PDF, WhatsApp screenshot) across 10 major FMCG suppliers - **Product normalization**: 2,000 synthetic `(raw_name, normalized_name)` pairs covering 200 Indian FMCG SKUs - **Product detection**: Indian Grocery Object Detection dataset (Roboflow) fine-tuned on YOLO26n Training was done on Modal using Unsloth QLoRA (MiniCPM models) and Ultralytics (YOLO26n).