跳到正文
DEV Community· Tanmay Dalvi·· 4 小時前AI 評分36

Batchwise:把小型食品生意的零散開支轉化為實際盈利分析

Batchwise: Turning Messy Food Business Expenses into Real Profit Insights 🇮🇳

AI 導讀

Batchwise 是面向印度家庭食品生意的 AI 輔助成本核算及盈利分析工具,協助將零散開支筆記整理成每批生產的成本與盈利資料。AI 會從自然語言筆記擷取候選資料,供用戶核對後交由 Python Decimal 執行財務計算。本地開發環境支援透過 Ollama 使用 Gemma 3 1B,讓 AI 解析可在本機執行而毋須付費 AI API。

正文

Every batch. Every cost. Every rupee.

What if a home baker or a small snack seller could stop guessing their profits and actually understand the numbers behind every production batch?

That question inspired me to build Batchwise, an AI-assisted costing and profit intelligence tool designed for India's home-based food businesses.

Built for the Hacktoberfest 2026 Week 2 — Side Hustle Challenge, Batchwise combines AI-powered note parsing with deterministic financial calculations to help small business owners understand their costs, pricing, and profitability.

🔗 Live Demo: https://batchwise-henna.vercel.app/

💻 GitHub Repository: https://github.com/Tanmay-Dalvi/batchwise

1. The Problem: Revenue Isn't Profit

Imagine running a small homemade ladoo business.

You buy besan, oil, packaging materials, and other ingredients. You spend money on gas, electricity, labour, and transportation. Then you sell your products.

At the end of the day, you know how much money you received. But do you know how much you actually earned?

Many small food businesses still rely on notebooks, rough estimates, or manual calculations. Costs get missed, profit margins become unclear, and selling prices may not cover the actual production expenses.

I wanted to build something that could make these calculations simpler, more transparent, and more reliable.

2. Meet Batchwise

Batchwise is an AI-assisted costing and profit tracking application for home bakers, homemade snack sellers, tiffin services, and other small food businesses.

The name has a simple meaning:

  • Batch means one real production run, whether it is a batch of ladoos, a set of bread loaves, or a day's tiffin orders.
  • Wise represents making informed, data-driven financial decisions instead of relying on guesswork.

Together, Batchwise means making smarter business decisions, one production batch at a time.

Its core promise is simple: Every batch. Every cost. Every rupee.

The Batchwise homepage, designed around the needs of India's home-based food businesses.

3. Cost Every Batch, Not Just Every Ingredient

The Batch Costing Engine lets users enter ingredients, quantities, purchase pack sizes, purchase prices, packaging, labour, fuel, delivery, and other expenses.

It converts purchase costs into the quantities actually used in a batch, then calculates the financial results using Python's Decimal arithmetic.

Users can see:

  • Total production cost
  • Cost per sellable unit
  • Break-even selling price
  • Projected revenue and net profit
  • Profit margin versus markup
  • Break-even sales volume
  • Target-margin pricing recommendations
  • A transparent calculation audit trail

Users can also save recipes, reuse them for future batches, and maintain a history of recorded production runs.

Enter ingredients, purchase quantities, pack sizes, and production expenses in one workspace.

A real calculation

Consider a sample batch with these costs:

Item Cost
Besan ₹600
Oil ₹180
Packaging ₹80
Total batch cost ₹860

Suppose the batch produces 75 sellable packets, each priced at ₹25.

Metric Result
Cost per packet ₹11.47
Projected revenue ₹1,875
Projected profit ₹1,015
Profit margin 54.13%
Markup on cost 118.02%
Break-even quantity 35 packets

These figures assume all 75 packets are sold at the planned price, with no additional costs beyond those entered.

An important distinction: profit margin measures profit as a percentage of revenue, while markup measures profit as a percentage of cost. They are not interchangeable.

Batchwise makes costs, break-even points, profit margins, and markup visible instead of leaving them to guesswork.

The Batchwise architecture separates the user interface, backend API, data persistence, AI provider, and deterministic calculation engine.

4. From Messy Notes to Structured Data with AI

One of the most useful features is the AI Note Parser.

Small business owners don't always record expenses in a neat spreadsheet. They might write something like:

Sourdough batch: 2 kg flour 140, yeast 30, butter 120, electricity 50, baked 8 loaves, selling for 90 each.

Manually converting that note into structured ingredient entries takes time.

Batchwise uses AI to extract candidate fields from natural-language notes and prepare them for the costing workspace.

The important part is that the AI does not get to decide the final financial result.

The workflow is:

  1. The user pastes a purchase or production note.
  2. The AI extracts candidate ingredients, quantities, prices, and yield information.
  3. Batchwise highlights missing or ambiguous information.
  4. The user reviews and corrects the extracted fields.
  5. The confirmed information is transferred into the costing workspace.
  6. Python performs the actual financial calculations.

For example, a note that says “yeast 30” does not establish how much yeast was used. Batchwise can flag the missing quantity instead of silently treating an assumption as fact.

Natural-language input lets users start with the notes they already have.*

Extracted values remain editable, and ambiguous quantities are flagged for human verification before calculation.

AI extracts candidate data, the user verifies it, and the deterministic engine calculates the financial results.

5. Why Deterministic Math Matters

AI is useful for understanding unstructured language, but financial calculations need to be predictable and verifiable.

That is why Batchwise separates AI-based extraction from financial computation.

The AI helps interpret what the user wrote. The Python calculation engine handles the numbers.

The engine uses Decimal arithmetic to avoid common binary floating-point representation issues in monetary calculations. It validates units, rejects invalid production yields, and maintains a calculation audit trail.

This separation makes the results easier to verify and reduces the risk of an AI-generated numerical answer being mistaken for an accurate financial calculation.

AI interprets the note; validated inputs and deterministic arithmetic produce the financial results.

6. Built Local-First, with Privacy in Mind

Batchwise was designed with local-first usage in mind because recipes, ingredient prices, and supplier costs can be sensitive business information.

The local development setup supports Gemma 3 1B through Ollama. This allows AI parsing to run locally without requiring a paid AI API.

The hosted demo has a separate deployment environment. Any external AI provider used in hosted mode must be configured explicitly, and users should be told when their notes are sent to that provider.

The principle remains the same: AI should help structure the data, but users should retain control over what they submit and confirm.

7. The Technology Stack

Batchwise brings together a lightweight frontend, a Python backend, a deterministic calculation engine, data persistence, and AI-assisted extraction.

  • React, TypeScript, and Vite: Interactive frontend
  • FastAPI: Backend API
  • Python Decimal: Financial calculations
  • SQLite and SQLAlchemy: Data persistence
  • Gemma 3 1B with Ollama: Local AI note parsing
  • Gemini API: Hosted AI parsing when configured
  • Vitest and React Testing Library: Frontend tests
  • Pytest: Backend tests
  • Vercel and Render: Frontend and backend hosting

[INSERT DIAGRAM 4 HERE — Batchwise technology stack]

Suggested caption: The technologies powering Batchwise, from its mobile-friendly interface to its AI-assisted parsing and financial engine.

8. Testing and Verification

The project has a backend test suite covering calculation logic, unit handling, API endpoints, database operations, and AI parser behavior.

The frontend includes tests for currency formatting, financial summaries, the AI review flow, and costing workspace behavior.

During development, the reported verification results included:

  • 67 backend tests passing
  • 16 frontend tests passing
  • A successful frontend production build
  • End-to-end checks of calculation, recipe management, batch history, and AI extraction

These tests are important because a financial tool should be more than visually appealing. It should handle invalid inputs, make assumptions visible, and produce reproducible results.

9. What's Next?

Batchwise is a starting point for making financial clarity more accessible to small food businesses.

Future improvements could include better multilingual note extraction, more detailed expense tracking, downloadable reports, and reliable persistent storage for hosted users.

The goal is not to overwhelm small business owners with complicated accounting software. It is to give them a practical way to understand the economics of each batch they produce.

Final Thoughts

Building Batchwise reinforced one idea for me: useful AI products don't need to hand every decision over to a language model.

Sometimes the strongest design is to let AI handle the messy human input and let deterministic software handle the math.

For a small business, understanding the difference between revenue and profit can matter more than a flashy dashboard.

Batchwise is my attempt to make that understanding simpler, one production batch at a time.

🔗 Try Batchwise: https://batchwise-henna.vercel.app/

💻 Explore the code: https://github.com/Tanmay-Dalvi/batchwise

Built for the Hacktoberfest 2026 Week 2 — Side Hustle Challenge.

Hacktoberfest #AI #Python #BuildInPublic #SmallBusiness

來源:DEV Community · dev.to