Skip to content

Repository files navigation

SmartSplit-BillAI, Intelligent Bill Splitting with AI

SmartSplit-BillAI is a production-ready prototype that streamlines the process of splitting restaurant or shopping bills among multiple people. By integrating a conversational AI agent with an OCR-free receipt extraction model, the application ensures fair, transparent, and accurate cost distribution based on individual orders rather than equal division.

Key Features

  • Conversational AI Agent — Built with Agno and Groq's LLM inference, the agent guides users through the bill-splitting process in natural language.
  • OCR-Free Receipt Extraction — Leverages Pix2Struct from Google to extract total amounts, dates, and line items directly from receipt images without traditional OCR engines.
  • Proportional Cost Calculation — Tax, tip, and discounts are distributed proportionally based on each person's share of the subtotal, not simply divided equally.
  • Interactive Web Interface — Clean, responsive UI built with Streamlit, featuring both a quick calculator and a chat-based interaction mode.
  • Receipt Upload & Analysis — Users can upload receipt photos, have the AI automatically extract relevant data, and proceed directly to splitting.

How It Works

  1. Input: Users describe their bill verbally (e.g., "Budi ordered Nasi Goreng 45k, Ani ordered Sate 60k") or upload a receipt photo.
  2. Extraction (if receipt uploaded): The Pix2Struct model answers targeted questions about the receipt content (total, items, date).
  3. Calculation: The AI agent computes each person's total by:
    • Summing their ordered items
    • Adding proportional tax and tip
    • Subtracting proportional discounts
  4. Output: A detailed breakdown is presented in a formatted table, ensuring all individual payments sum exactly to the total bill.

Technology Stack

Layer Technology
Frontend Streamlit
AI Orchestration Agno (Agent framework)
LLM Inference Groq Cloud (Llama 3.3 70B)
Document Understanding Pix2Struct (Google, Hugging Face)
Backend Logic Python, custom calculator module
Deployment Streamlit Cloud / Hugging Face Spaces

Project Structure

SmartSplit-BillAI

├── app.py # Streamlit UI

├── ai_agent.py # AI agent configuration

├── utils.py # Split bill calculator class

├── receipt_extractor.py # Pix2Struct inference wrapper

├── requirements.txt # Python dependencies

├── .env.example # Environment variables template

├── .gitignore

└── receipts/ # Sample receipt images (optional)

Getting Started

Prerequisites

Model Selection Rationale

Two OCR-free models were evaluated for receipt extraction:

  1. Donut (naver-clova-ix/donut-base-finetuned-cord-v2): Produced garbled output on Indonesian receipts.
  2. Pix2Struct (google/pix2struct-docvqa-base): Successfully extracted key information despite language and layout variations.

Pix2Struct was selected for the prototype due to its superior qualitative performance and flexible question-answering capability.

###Installation

git clone https://github.com/USERNAME/smart-split-bill-ai.git
cd smart-split-bill-ai
python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages