Munshi:用本機 AI 將日常雜貨訂單轉成帳單
🧾 Munshi — Turning Everyday Grocery Orders into Bills with Local AI
Munshi 是一款本機雜貨店帳單助手,透過 Ollama 運行 Qwen 3.5 4B,將日常語言訂單轉成列明產品、數量、價格及總額的帳單。系統以 CSV 價格目錄匹配產品,並由 Python 邏輯計算金額,無須使用託管 LLM API。Munshi 目前透過 Streamlit 在本機運行,開發期間的測試套件在本機通過 14 項測試。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built
Munshi — Local AI Grocery Billing is a grocery billing assistant that converts natural-language orders into itemized bills using locally running AI.
Small grocery and snack shops often handle orders informally, then manually search for products, enter quantities, and calculate totals. Munshi aims to simplify this workflow.
With Munshi, a shopkeeper can enter an order in everyday language. The application extracts product details, matches them against a CSV-based price catalog, and generates a bill containing product names, quantities, prices, and the final total.
The goal is to help small businesses simplify repetitive billing without making a hosted AI API a requirement.
✨ Key Features
- 🗣️ Natural-language order processing: Describe an order in everyday language.
- 🤖 Local AI inference: Uses Ollama with Qwen 3.5 4B for order extraction.
- 🛒 Catalog-based product matching: Matches extracted products against a CSV price list.
- 🧮 Automatic bill calculation: Calculates quantities, rates, line totals, and the final amount.
- ⚠️ Unmatched-product handling: Identifies products that need review.
- 🌐 Interactive web interface: A Streamlit UI makes the workflow accessible.
- 🧪 Automated testing: Includes tests for billing, catalog matching, extraction, and order processing.
The intended users are small grocery shops, snack shops, and independent shopkeepers who want a simpler billing workflow.
👀 Product Walkthrough
Here is the workflow, from opening the application to reviewing a generated bill.
1. Start with a clean order screen
The clean interface gives the shopkeeper a starting point to enter an order and begin the billing workflow.
2. Enter an order for snacks
The shopkeeper describes the requested items in ordinary language. Munshi uses its local AI model to extract the order details and attempts to match the products against the available catalog.
The key interaction is that the user describes the order naturally instead of manually building every line of the bill.
3. Generate and review the bill
The application displays the matched products, quantities, prices, and calculated total. Products that cannot be matched confidently should be reviewed before the bill is accepted.
This is the core idea behind Munshi: turn an ordinary sentence into a structured bill through a practical combination of AI and conventional application logic.
Demo
Munshi currently runs locally using Streamlit and Ollama.
To launch the application, run:
python -m streamlit run app.py
Then open http://localhost:8501 in your browser.
The three screenshots in this post demonstrate the interface, order entry, and generated bill. Munshi is currently a local application, so I am sharing the source code rather than claiming a publicly deployed demo.
Code
GitHub Repository: munshi-smart-grocery-billing
The repository contains the Streamlit application, order-processing modules, product price catalog, dependency list, and automated tests.
Contributions and suggestions for improving product matching, multilingual order entry, and local AI reliability are welcome.
How I Built It
Munshi combines an open-weight language model with conventional Python application logic.
Technology Stack
- Python — application and order-processing logic
- Streamlit — interactive web interface
- Ollama — local model runtime
- Qwen 3.5 4B — open-weight model for extracting order information
- Pandas and CSV — product catalog management
- Pytest — automated testing
How the System Works
- The shopkeeper enters a grocery order in natural language.
- Qwen 3.5 4B, running locally through Ollama, extracts structured order details.
- The application matches extracted product names against the CSV catalog.
- Python billing logic calculates the line totals and final amount.
- Streamlit displays the generated bill for review.
A key design decision was to use AI for understanding the order and ordinary application code for catalog matching and arithmetic. This keeps billing calculations testable rather than relying on the language model to calculate prices correctly.
During development, the project's test suite passed 14 tests locally.
Why Does Open Innovation Matter?
A small-shop billing tool should not necessarily require a paid AI API, a constant internet connection for model inference, or sending order text to a third-party model provider.
Open-weight models and local inference make another approach possible.
By using Ollama with Qwen 3.5 4B, Munshi can perform its order-extraction workflow on the shopkeeper's own computer without requiring a hosted LLM API. This makes experimentation more accessible and gives developers greater control over the model and deployment environment.
Open innovation also allows other developers to inspect, modify, and extend the project. They could adapt the catalog to local products, improve fuzzy matching, add regional-language support, or introduce printable receipts and billing history.
Local inference does not automatically guarantee privacy or perfect accuracy, and product matches still need appropriate validation. However, it provides a useful foundation for building practical AI tools without making hosted inference a requirement.
For me, open innovation is about more than accessing a model's weights. It is about using accessible technology to build tools that solve everyday problems.
Prize Categories
Submitting Munshi to the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle.
🚀 What's Next?
There is plenty of room to grow Munshi:
- 🌐 Support more regional and Indian-language grocery orders.
- 🔍 Improve product matching for misspellings and locally used product names.
- ✏️ Add editable quantities and a bill-confirmation step.
- 🧾 Introduce printable receipts and persistent billing history.
- 📊 Evaluate extraction accuracy against a collection of realistic grocery orders.
- 🛠️ Make setup easier for shopkeepers who are not technical users.
The long-term vision is to build a simple, affordable, local-first billing assistant that helps small shops spend less time on repetitive manual entry.
🙌 Final Thoughts
Building Munshi helped me explore how an open-weight model can fit into a practical application rather than remain just a chat interface.
The interesting part was not simply connecting an LLM. It was combining natural-language understanding with a product catalog, predictable calculations, a usable interface, and automated tests.
That is the kind of practical open-source AI I want to keep building: useful, inspectable, and accessible to more people.
If you have suggestions for improving local AI billing, I'd love to hear them!
Explore the code: munshi-smart-grocery-billing
來源:DEV Community · dev.to


