# Balance Dex

- **Event:** [Meta Global AI Developer Hackathon](https://cerebralvalley.ai/e/meta-ai-developer-hackathon)
- **When:** Oct 26, 12:00 PM – Nov 4, 9:00 PM (EST)
- **Where:** Online
- **Team:** [Chaitya Dobariya](https://cerebralvalley.ai/u/chaitya02)
- **GitHub:** https://github.com/Chaitya02/dex-ai
- **Demo video:** https://youtu.be/doZlue7r_F4
- **Gallery:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3089

Dex splits a shared bill when you just say who had what. Snap the receipt, say (or type) who had what, the way you'd tell a friend, and Dex splits it item by item, marks each line on your own photo, and saves it to your expense log as one expense with exact shares. Balance Desk, my expense app, existed before the hackathon; Dex was built during it, in its own repo.

The problem: splitting a group bill properly is a chore, so people split evenly and someone overpays. On a real dinner of mine (Ajisen Ramen, $52.07), an even split is $10.41 each; by what each person had, it's $15.25 / $16.51 / $20.31. It's common: one in three people have trouble getting paid back (PayPal, 2024), Splitwise alone has tens of millions of users, and a popular Reddit post says it best: "People who insist on splitting the bill evenly know exactly what they ordered."

What exists today: Venmo, Cash App, and Zelle take one amount, so you do the math. Splitwise and Scan-and-Split apps read the receipt, but you still assign every line for every person. With Dex, you say it once and fix it the same way.

Because it's money, I never let the model do arithmetic or write data. Every share is integer cents: shared items and tax/tip are divided by largest-remainder rounding, so totals always match the bill exactly. Muse Spark Open fills a strict JSON schema, and code redoes every sum (items vs. subtotal vs. total). If they don't match, Dex reads again with more reasoning; if it's still off, it shows exactly which sum is wrong instead of guessing. Small photos are upscaled first, and savings printed on their own line are joined to their item.

The assignment agent (Muse Spark Open) acts only through six tools: assign_item, unassign_item, add_person, set_payer, set_tax_tip, ask_user. Every call is validated in code, and a bad one goes back as an error the model corrects. It asks when something's unclear, declines off-topic requests, and treats text printed on a receipt as data, never as instructions. Muse Voice Transcribe gets the names on the bill as hints, and SAM 3.1 finds each price on your photo.

Nothing is saved until you approve. Logs record timings and counts only, never names, items, or amounts.

Evaluated against the live models: 15/15 receipts read perfectly, including my own ALDI, Ajisen Ramen, and Costco bills from this week; 22/23 typed and 5/6 spoken who-had-what cases exactly; 0% of items ever put on the wrong person; agent replies in ~2.3s. 141 offline tests. Muse Spark 1.3 runs the same pipeline with one setting, compared side by side in the evals.

Known limits: on some real photos SAM places fewer items (they still show in the list), and on one photo it marked two items on header lines, which I'm fixing next.

Stack: Python 3.14, FastAPI, Pillow, httpx, a plain HTML/JS page, Docker on Render.
Live: https://dex-ai-vl0t.onrender.com

## More from Meta Global AI Developer Hackathon

- [Replace Consulting](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3086)
- [Seventy](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3087)
- [LedgerLens](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3088)
- [MiMi](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3090)
- [See The Germs](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3091)
- [Aura AI](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3092)

---

Markdown version of https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3089. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
