DEV Community

jose francisco arce
jose francisco arce

Posted on

Never Fight Over the Restaurant Bill Again With This Open-Source AI Tool

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

For this challenge, I built FairSplit AI, a minimalist, lightning-fast web application contained in a single index.html file designed to solve a classic problem every group hangout faces: splitting restaurant bills without arguments, headaches, or math errors.

I built this for my university group of friends, who always end up wasting 20 minutes trying to decipher messy receipts, calculating tips by hand, or arguing over who ordered what when items were shared. The app takes a messy text or receipt description, and AI extracts the data in a structured way so that the JavaScript logic can handle the exact math down to the very last penny.

Demo

You can try the live application or check out the deployment here:
https://josefrancisco.tech/FairSplitAI/

Code

You can check out the full source code—packaged neatly into a single, dependency-free file—in the GitHub repository:
https://github.com/0xincainsider/FairSplitAI

How I Built It

FairSplit AI is built with HTML5 and vanilla JavaScript, implementing strict integer-based cent arithmetic to avoid classic floating-point rounding errors in JavaScript.

For the artificial intelligence core, I used an open-weight model (meta-llama/llama-3.3-70b-instruct:free via OpenRouter, compatible with any OpenAI-compliant endpoint). The AI handles parsing exclusively: it transforms messy consumption text into a clean JSON object. The entire math engine afterwards (proportional distribution of taxes/tips, and rounding remainder allocation) runs locally right in the browser. Plus, it includes an offline local fallback reader (using simple syntax like Ana: pizza 30) so the app works seamlessly even without an internet connection or configured API keys.

Why Does Open Innovation Matter?

Open innovation was crucial for this project for three key reasons:

1 Financial Data Privacy: When processing consumption records and people's names, using open-source models and flexible endpoints ensures total control over data without relying on opaque policies from closed API corporations.

2 Zero Cost and Portability: Being able to hook the app up to free open-weight models or run them locally eliminates economic barriers.

3 Integration Flexibility: The ability to swap out the AI provider for any OpenAI-compatible endpoint or fall back to a local parser guarantees the code is never locked into a specific proprietary service.

Top comments (0)