{"slug": "kasimargin", "title": "KasiMargin", "summary": "A solo developer built KasiMargin, a local-first financial-clarity prototype for South African owner-operated microbusinesses that separates estimated operating margin from conditional cash headroom and returns UNKNOWN/HOLD when evidence is missing rather than treating unknowns as zero. The system keeps financial arithmetic in an exact-integer-cents engine while Gemma only selects identifiers from a permitted catalogue of facts, warnings and actions, with validation and a labelled deterministic fallback if inference fails. The developer reports a recorded local evaluation across seven synthetic scenarios with three model calls each, but notes no real operator trial or demonstrated willingness to pay has been completed.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle](https://dev.to/challenges/hacktoberfest-week2-2026-10-12)*\n\nThree haircuts can make for a busy day. But a busy day does not automatically tell a barber how much money is available to spend tomorrow.\n\nImagine two customers pay R50 each in cash, a third pays R50 by card, and the barber spends R20 on supplies.\n\nThat is **R150 in recorded sales**, but it isn't necessarily R150 in available cash. The card payment might not have settled. Rent may still be due. Other business expenses might be missing.\n\nThat distinction inspired **KasiMargin**, a local-first financial-clarity prototype for South African owner-operated microbusinesses.\n\nThe idea grows out of a broader question I've been exploring through KasiLink and Kopano Labs: how can small businesses turn the information they already have into better-informed decisions, without needing complicated accounting software?\n\nKasiMargin currently offers two connected experiences:\n\nThe application distinguishes estimated operating margin from conditional cash headroom. When important evidence is missing, the result remains **UNKNOWN/HOLD**, rather than quietly treating an unknown amount as zero.\n\nOur latest interface improvement also makes the decision explanation visible, connects the two workflows through simple navigation, and displays previously recorded daily totals as a **read-only reference**. Recorded sales are never automatically promoted into independently verified cash.\n\n**Who might pay for this?** An owner-operated barber shop, spaza shop, car wash or food business that finds daily financial clarity useful enough to return to. That is our proposed customer, not a proven commercial result. We have not yet completed a real operator trial or demonstrated willingness to pay.\n\n[Watch the 97-second synthetic KasiMargin demonstration](https://github.com/RobynAwesome/KasiMargin/blob/main/docs/demo/KasiMargin-synthetic-demo.mp4)\n\nThe recording demonstrates actual local browser interaction with fictional barber records: entering sales, recording spending, correcting an amount and inspecting the separate financial-check workflow.\n\nCorrecting one R50 cash haircut to R60 changes recorded sales from R150 to R160 while retaining the earlier entry's history.\n\nThe video has captions and no audio. It was recorded before the latest interface improvement and demonstrates the earlier deterministic explanation experience. **It is not a recording of new live Gemma inference.**\n\nThe project was created during the October 12–18 challenge window.\n\nThe submitted source baseline is [`main@85d3cc9`](https://github.com/RobynAwesome/KasiMargin/tree/85d3cc9398701c451734eafe62aa1d15770fc6d1), with a [successful GitHub Actions run](https://github.com/RobynAwesome/KasiMargin/actions/runs/39166865463).\n\nThe latest operator-experience improvements were introduced through [PR #8](https://github.com/RobynAwesome/KasiMargin/pull/8), followed by documentation alignment in [PR #9](https://github.com/RobynAwesome/KasiMargin/pull/9).\n\nThe project code is MIT-licensed. Gemma model weights remain subject to their own terms. Development involved AI-assisted coding, and this is a solo project submission.\n\nKasiMargin combines:\n\nAn important design decision is that **Gemma does not perform the financial arithmetic**.\n\nThe financial engine computes values using exact integer cents, handles incomplete evidence and produces required warnings. Gemma receives a permitted catalogue of facts, warnings and possible actions, then selects identifiers within that catalogue.\n\nIts selections undergo validation before a trusted renderer produces the final explanation. The model cannot invent new amounts, change ledger entries or authorise purchases. If inference fails, the system uses a clearly labelled deterministic fallback.\n\nWe completed a recorded local evaluation across seven synthetic financial scenarios, with three model calls per scenario.\n\nThe results were:\n\nIn that scenario, Gemma selected `preserve_headroom` but omitted another permitted action, `compare_restock_quote`. Required financial amounts and warnings remained unchanged.\n\nThese results demonstrate bounded local inference, not proven improvements in financial understanding.\n\nThe recorded warm median inference time was approximately five seconds, while the cold median was approximately 89 seconds. This exposes a real hardware and responsiveness trade-off.\n\n[Read the complete Gemma technical evaluation](https://github.com/RobynAwesome/KasiMargin/blob/main/docs/GEMMA-TECHNICAL-EVALUATION.md).\n\nA financial-clarity application for a small business should be inspectable, reproducible and careful about the information it is trusted with.\n\nRunning an open-weight model locally gives us a way to experiment with explanations without sending the inference payload to a hosted model API. It also lets us compare model behavior against deterministic output, identify failures and question whether the AI genuinely adds value.\n\nThere are trade-offs. Local model weights require storage and memory, cold inference can be slow, and an open model does not automatically produce better financial guidance.\n\nFor KasiMargin, open innovation matters because it allows us to investigate personalized intelligence while keeping financial calculations, provenance and human decision authority separate.\n\nThe first interface was too technical. It displayed financial terminology and implementation details before answering what the business operator actually needed to understand.\n\nThe later design moved toward everyday tasks, visible financial explanations and a more direct connection between recording activity and reviewing money.\n\nBut I want to take the product further.\n\nSouth African microbusinesses operate across different languages, sectors and working conditions. My longer-term direction is to investigate **visual-first, accessible and context-aware financial intelligence**, with optional language and voice support where those capabilities genuinely help.\n\nThat direction is not implemented functionality today.\n\nThe next important experiment is a consented operator walkthrough. Can a barber record a sale, correct a mistake and explain the difference between recorded sales and available money without coaching? Does the experience fit their working routine? Does Gemma's explanation improve understanding compared with the deterministic version?\n\nThose are questions for real users, not assumptions we can settle with synthetic tests.\n\nKasiMargin does not currently verify bank balances or card settlement, scan receipts, provide unrestricted financial advice or demonstrate measurable economic impact.\n\n**The purpose of this first version is to build a trustworthy foundation for financial understanding, then allow the people who use it to help shape what comes next.**\n\n**Best Use of Gemma**\n\nKasiMargin includes a locally evaluated Gemma 4 E2B integration with constrained output selection, explicit validation and deterministic fallback. Its incremental benefit to operator comprehension remains unmeasured.", "url": "https://wpnews.pro/news/kasimargin", "canonical_source": "https://dev.to/robynawesome/kasimargin-2h3j", "published_at": "2026-10-18 21:40:54+00:00", "updated_at": "2026-10-18 21:48:46.230719+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-products", "developer-tools"], "entities": ["KasiMargin", "Gemma", "KasiLink", "Kopano Labs", "GitHub Actions"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/kasimargin", "markdown": "https://wpnews.pro/news/kasimargin.md", "text": "https://wpnews.pro/news/kasimargin.txt", "jsonld": "https://wpnews.pro/news/kasimargin.jsonld"}}