Smart Stock & Demand Predictor
Can an AI forecast help a small shopkeeper make better stocking decisions?
Small retailers need to decide what to reorder, how much inventory to keep, and when to place orders. Too little stock can mean missed sales, while excess inventory can tie up cash and increase the risk of expiry or waste.
For the Hacktoberfest 2026 Open-Source AI Challenge: Week 2 β Side Hustle, I built Ranchi Dukaan Pro, a prototype that uses TabPFN-TS to estimate product demand over the next seven days and combine those estimates with simple inventory rules.
The goal is to explore whether a focused, affordable AI tool could help a local kirana shop make more informed stock-planning decisions.
π What I Built
Ranchi Dukaan Pro is a Python and Gradio dashboard with the following features:
- Seven-day demand forecasting for individual products using TabPFN-TS.
- Editable inventory information, including current stock, incoming stock, supplier lead time, safety stock, and unit cost.
- Restock recommendations that combine estimated demand with available inventory.
- Estimated order costs to help users evaluate suggested purchase quantities.
- Forecast evaluation comparing TabPFN-TS with a simple historical baseline.
The current prototype uses example productsβMilk 500 ml, Bread, and Rice 1 kgβto demonstrate the complete workflow.
π§ How It Works
The workflow is straightforward:
- Load daily sales history for each product.
- Use TabPFN-TS to generate a seven-day demand forecast.
- Estimate demand during the supplier's lead time.
- Combine that estimate with current stock, incoming stock, and safety stock.
- Display a suggested reorder quantity and its estimated cost.
The stock recommendation uses this rule:
Reorder quantity = max(0, lead-time demand + safety stock - current stock - incoming stock)
The forecasting model estimates demand; a separate inventory calculation produces the reorder recommendation. The recommendation is a decision-support estimate, not an automatic purchase instruction.
π Sample Results
The sample forecast generated these estimated total sales over seven days:
| Product | Estimated 7-day demand |
|---|---|
| Milk 500 ml | 134 units |
| Bread | 96 units |
| Rice 1 kg | 49 units |
Using the example inventory values, the application initially suggested:
| Product | Suggested order | Estimated order cost |
|---|---|---|
| Milk 500 ml | 13 units | βΉ312 |
| Bread | 9 units | βΉ252 |
| Rice 1 kg | 1 unit | βΉ52 |
| Total | 23 units | βΉ616 |
I also tested the editable inventory input: increasing the example milk stock from 10 to 30 units changed the recommended milk order from 13 units to zero and reduced the total estimated order cost from βΉ616 to βΉ304.
These are illustrative results using synthetic sales and example inventory values, not actual data from a Ranchi shop. The estimated order cost is not a demonstrated saving.
π§ͺ Forecast Evaluation
I generated synthetic daily sales data for three example products and held out the final seven days for testing. I compared TabPFN-TS with a simple baseline that uses sales from the same weekday one week earlier.
| Evaluation | TabPFN-TS MAE | Baseline MAE | TabPFN-TS WAPE | Baseline WAPE |
|---|---|---|---|---|
| All products | 1.29 | 1.62 | 9.18% | 11.56% |
| Milk 500 ml | 1.14 | 2.14 | 5.71% | 10.71% |
| Bread | 1.43 | 1.29 | 10.00% | 9.00% |
| Rice 1 kg | 1.29 | 1.43 | 16.67% | 18.52% |
Lower MAE and WAPE indicate lower prediction error. In this particular test window, the overall metrics favoured TabPFN-TS, but the simple baseline performed better for Bread.
Important limitation: this was one seven-day holdout on synthetic data. It does not establish real-world forecasting accuracy for local shops. Multiple backtesting windows and evaluation on real sales records, with the shop owner's permission, would be needed before relying on forecasts for purchasing decisions.
πΈ Dashboard Screenshots
1. Main Dashboard
2. Inventory Editing Test
3. Forecast Results
π₯οΈ Try the Demo
Open Ranchi Dukaan Pro β Gradio Demo
The prototype lets users review the sample data, edit inventory values, generate forecasts, and inspect restock suggestions.
The Gradio share link is temporary and may stop working when its session ends.
Source code and evaluation files: GitHub β ranchi-dukaan-pro
The repository contains the application, setup instructions, sample CSV files, screenshots, and synthetic-data evaluation outputs.
π± Why Open-Source AI?
I used TabPFN-TS to explore time-series forecasting through an open-source implementation instead of building the entire application around a closed forecasting service.
The current prototype uses client/cloud inference. It does not claim to run entirely offline, and users should review the provider's data-handling terms before sending commercially sensitive sales records for inference.
Open-source tools provide room to inspect the implementation, experiment with alternatives, and adapt the surrounding application to a particular use case. However, model selection alone does not guarantee accuracy or business value; evaluation remains essential.
πΌ Who Might Pay for It?
The intended users are small retailers who find it difficult to track demand and decide when to reorder inventory.
A future version could explore an affordable subscription with recurring forecasts, inventory reports, expiry-aware suggestions, and easier sales imports.
This is a business hypothesis, not validated customer demand. I have not yet established that a real shopkeeper would pay for this prototype. The next step is to demonstrate it to a local retailer, understand their current workflow, and learn whether the forecasts and recommendations are genuinely useful.
π§ What I Learned
This project reinforced three lessons:
- A forecast becomes more useful when it supports a concrete business decision.
- A simple baseline helps establish whether a more complex model adds value.
- A working demo on synthetic data is a starting point, not proof of real-world impact.
Future improvements include walk-forward evaluation across multiple time windows, better handling of missing records and stock-outs, expiry-aware ordering, supplier constraints, and usability testing with a local shopkeeper.
πΏ Final Thoughts
Ranchi Dukaan Pro is an early experiment in making demand forecasting and stock planning more accessible to small retailers.
It is an educational and hackathon prototype, not a production inventory system. Its predictions may be wrong, and its real-world usefulness remains to be validated.
Built for the Hacktoberfest Open-Source AI Challenge: Week 2 β Side Hustle.



Top comments (0)