ChatLedger A developer built ChatLedger, an open-source, local-first desktop application that parses WhatsApp chat exports from home food and craft sellers and converts them into structured order sheets using open-weight local LLMs. The tool combines a multi-line WhatsApp parser, a 48-hour temporal thread grouper, a JSON-Schema-constrained intent and entity extractor with an offline heuristic fallback, a deterministic financial engine, and an Excel exporter, and it accumulates Alpaca-style training pairs for fine-tuning compact local models on each seller's menu and abbreviations. The project targets sellers handling 10–40 orders a day, aiming to save 45–90 minutes of daily manual order transcription and prevent costly baking and delivery mistakes. This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle https://dev.to/challenges/hacktoberfest-week2-2026-10-12 ChatLedger is a local-first, privacy-focused open-source AI desktop tool designed for home food and craft side-hustlers cake bakers, caterers, handmade craft makers who take 10 to 40 orders a day over WhatsApp. Home food sellers face evening WhatsApp chaos: customers chat casually across multiple days, requesting custom flavor combinations, changing delivery dates at the last minute, and sending bank transfer slips. A home baker or caterer making $400–$1,500/month would happily pay $10–$15/month or a one-time license because ChatLedger gives them back an hour every evening and prevents expensive baking and delivery mistakes. .txt chat files from both Android and iOS devices. 🔍 next to any item immediately highlights the exact source message in the chat stream. .jsonl dataset to fine-tune compact local models on the seller's specific menu and abbreviations. git clone https://github.com/tharu200304/ChatLedger.git cd ChatLedger python -m venv .venv .venv\Scripts\activate On Linux/macOS: source .venv/bin/activate pip install -r requirements.txt python -m uvicorn backend.app:app --host 127.0.0.1 --port 8000 http://127.0.0.1:8000 and click the Turning a home seller’s WhatsApp chaos into tomorrow’s order sheet, entirely on her own laptop. ChatLedger is an open-source, local-first application designed for home-based bakers, caterers, and craft sellers who receive 10–40 orders a day over WhatsApp in English “I would like to order a 1kg chocolate cake for Sunday evening, deliver to Peradeniya” . The complete codebase is available at https://github.com/tharu200304/ChatLedger https://github.com/tharu200304/ChatLedger . backend/parser.py : Multi-line regex WhatsApp parser supporting 12h/24h timestamps, system message filtering, and phone number normalization. backend/thread grouper.py : Temporal thread splitter applying a 48-hour inactivity threshold to divide ongoing customer relationships into clean conversational orders. backend/extractor.py : Intent and entity extractor utilizing local open-weight LLMs with strict JSON Schema constraints, accompanied by an offline heuristic fallback engine. backend/catalog.py : Catalog manager and deterministic financial engine isolating arithmetic from LLM generation. backend/exporter.py : Multi-sheet Excel workbook generator built with openpyxl . backend/lora dataset.py : Local fine-tuning dataset accumulator storing Alpaca-style training pairs from validated user orders. frontend/ : Clean, glassmorphic dual-pane interface built with vanilla HTML5, CSS3, and JavaScript. ChatLedger is built entirely around open-weight local inference : For home businesses and independent creators, open-source AI offers advantages that proprietary cloud APIs cannot match: localhost . This project was built with the assistance of an autonomous AI agent session: ChatLedger: turning a home seller’s WhatsApp chaos into tomorrow’s order sheet, entirely on her own laptop 1. The product and the person The user: a home-based food or craft seller a cake baker, a short-eats caterer, a handmade jewelry maker who takes 10–40 orders a day over WhatsApp. Customers write in Sinhala, English, or romanized Sinhala “Singlish” in the same chat, often in one sentence: “ada ratta 1kg chocolate cake ekak, Sunday evening ekata, Peradeniya”. The problem today: every evening she scrolls through dozens of chats, copies orders into a notebook or spreadsheet, and works out what to bake or make and where to deliver. Orders get missed, a changed date gets overlooked, and a cancelled order still gets baked. That’s 45–90 minutes a day, and a single mistake costs a 1 kg cake and a customer’s trust. Why she’d pay: the tool gives back an hour a day and prevents the occasional costly error. One avoided wrong order pays for months of the subscription. The structured-output feature matters most. The model fills a fixed schema instead of writing free text, which removes the largest source of garbage in extraction. Four reasons actually apply to this product: Customer data is other people’s data. Chats contain names, phone numbers, and home addresses. “Your customers’ chats never leave your laptop” is a promise a seller can make to her own customers, and it’s one a cloud API can’t back. Sinhala/Singlish is a niche general APIs handle unevenly. With open weights, I can add a LoRA adapter trained on the seller’s own corrected orders, so the tool learns her shorthand “ekak”, “paan”, “bun 10 k” instead of hoping a general model gets it. Connectivity and power are unreliable. The tool must work during a bad-connection evening, so it can’t depend on an API. No lock-in. If a hosted model is deprecated or repriced, the product breaks. With a pinned local model, a seller’s tool behaves the same in two years. Direct comparison: Closed API ChatLedger local open Customer data Sent to a third-party server Stays on the seller’s laptop Adapting to Singlish shorthand Prompting only LoRA fine-tune on her own corrections Works offline No Yes Behavior over time Model changes under you Pinned, reproducible Cost per extra chat Tiny but nonzero, and it recurs Zero marginal cost after hardware Raw extraction quality out of the box Better Weaker see §6 I won’t claim the cost row is decisive, since small hosted models are already cheap. The privacy, adaptation, and offline rows are what justify the stack. Build decisions that keep it reliable: The LLM never does arithmetic or sees phone numbers. Phones, timestamps, and prices come from code. The model only interprets intent. Every extracted field links back to its source message, so she can verify any order in two seconds. Her edits are saved as examples. They’re fed back as few-shot context immediately, and they become the LoRA training set later. Cancellations and changes are handled by processing a thread chronologically and having the model emit status, so “cancel karanna, next week ekata” updates the order instead of creating a duplicate. Week-one scope is the parser, extraction, review screen, and the two exports. Nothing else. First user: one home baker I can sit beside for two evenings. I run ChatLedger on her real exported chats, with her permission, and build a 50-chat test set from her corrections. Pricing test three arms across the first 10 sellers : A one-time license around LKR 8,000–10,000 A monthly plan around LKR 2,000–2,500 A free trial that converts to the monthly plan after 14 days These are starting guesses to be tested, not conclusions. The key signal is whether she pre-pays or commits to a date, not whether she says it’s useful. What I measure: Field accuracy without edits target ≥ 90% on date, quantity, product Minutes saved per evening, self-reported and timed Missed or wrong orders before versus after Daily use in week 2, as the best retention proxy Conversion at each price point If sellers love it but won’t pay at any tested price, the idea fails, and that’s a useful result. Closed API ChatLedger local open { } $ {} $ {} $ {} $ {} { } $ {} { } { } { } { } { } { } { } { } { } { } { } { } { } $ {} $ {} $ {} { } { } { } { } { } $ {} { } $ {} $ {} $ {} { } { } { } We have built and verified ChatLedger according to your product specification. The application runs 100% locally on the seller's laptop , guaranteeing complete customer privacy, resilience during connectivity drops, and deterministic pricing and arithmetic. A complete architectural and operational report has been compiled in chatledger architecture and implementation.md . WhatsApp "Export chat" .txt │ ▼ Deterministic Parser parser.py ── splits messages, reads phone numbers/timestamps, strips system notices │ ▼ Thread Grouping thread grouper.py ── per customer, per ~48h window │ ▼ Extraction Engine extractor.py ── Ollama Qwen3-8B JSON schema / Local Singlish Heuristic items {product, qty, variant, notes, source message ids} , delivery date, area, status new/changed/cancelled │ ▼ Catalog Matcher catalog.py ── maps product & aliases to catalog items, computes price │ ▼ Review Screen FastAPI + Vanilla CSS ── side-by-side WhatsApp chat with highlighted source snippets, confidence badges, one-click confirm/edit │ ▼ openpyxl Exporters exporter.py ── 1. Daily Kitchen Production Sheet .xlsx 2. Dispatch & Delivery Sheet by Area .xlsx 3. Outstanding Payments & COD Tracker .xlsx Deterministic WhatsApp Export Parser parser.py : 15/10/2026, 14:15 - Sender: Message and iOS bracketed formats 15/10/2026, 14:15:10 Sender: Message . +94 7X XXX XXXX and handles multiline continuations and system notice filtering. Temporal Thread Grouper thread grouper.py : Hybrid Extraction Engine extractor.py : source message ids . Deterministic Catalog Matcher catalog.py : Interactive Review Workspace index.html , styles.css , app.js : Executive Excel Workbooks exporter.py : Continuous Learning & LoRA Exporter lora dataset.py : All 9 automated test cases passed cleanly: bash python -m unittest tests/test chatledger.py Ran 9 tests in 0.094s: OK The browser subagent completed an interactive walkthrough: - Loaded demo Sinhala/Singlish baking chats. - Verified source message highlighting on item inspection. - Tested order confirmation and observed the LoRA continuous learning counter increment. - Tested warning banners on cancelled and rescheduled orders. - Verified Excel export generation via openpyxl . To run the application: bash python run.py Open http://localhost:8000 in any web browser. You can click "⚡ Load Demo Chats" to immediately test realistic orders, or drag-and-drop any exported WhatsApp .txt file into the upload modal. remove singlish structure only want english chats { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } $ {} $ {} { } { } { } { } $ {} { } { } We have removed all Singlish and Sinhala structures across the application, transitioning ChatLedger to pure English chat processing . The updated architecture and verification report is documented in chatledger architecture and implementation.md . Extraction Engine extractor.py : local english heuristic to target English intent extraction. Catalog & Database database.py : Sample Chat Scenarios sample data.py : sample chats/ 01 english peradeniya cake.txt : 1kg chocolate cake with custom icing inscription 02 rescheduled butter cake kandy.txt : 1kg butter cake rescheduled from Saturday afternoon to Monday morning. 03 cancelled brownies order.txt : Box of 6 brownies cancelled due to event cancellation. 04 catering savories katugastota.txt : Office catering order with fish patties, rolls, and brownies, paid via bank transfer. 05 birthday ribbon cake maharagama.txt : 1.5kg ribbon cake with Web UI & Navigation index.html , app.js : ⚡ Local English Engine Offline Ready Automated Unit Tests test chatledger.py : bash python -m unittest tests/test chatledger.py Ran 9 tests in 0.091s: OK The application is running live at http://localhost:8000 . run the system { } $ {} $ {} $ {} { } { } $ {} $ {} $ {} $ {} The system is active and serving locally on your laptop: 👉 URL : http://localhost:8000/ http://localhost:8000/ http:// REDACTED :11434 . data/chatledger.db | | Customer | Status | Delivery Date & Area | Items & Inscription | Total LKR | |---|---|---|---|---|---| | 1 | Kasun Perera | NEW | 2026-10-18 • Peradeniya | 1x Chocolate Fudge Cake 1kg