DEV Community

Cover image for Restock: next week's order for small shops, from the sales file they already have
Bikram Pun
Bikram Pun

Posted on AI-assisted

Restock: next week's order for small shops, from the sales file they already have

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission πŸ’Έ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

Small shops run out of their best sellers on their busiest days. Owners guess how much to order, and on a busy Saturday a guess often isn't enough: the croissants πŸ₯ are sold out by 10 a.m.

I built Restock for a small mart in Hetauda, Nepal, that records every sale in a POS system and keeps running out of its best sellers during weekend offers.

Restock takes the sales file a shop already has, from a POS or Excel, and gives back:

  • how much of each item it will likely sell next week
  • a safe amount that still covers a busy week
  • an order message to copy and send to your supplier, on WhatsApp, SMS or email
Order to cover Sun 18 Oct to Sat 24 Oct:
- Baguette: 176
- Banana bread slice: 258
- Cinnamon roll: 174
- Sourdough loaf: 247
Enter fullscreen mode Exit fullscreen mode

In the sample, croissants πŸ₯ aren't on the list: the 500 already on the shelf cover the week.

No account, no store integration, no setup call. Upload one CSV, check which columns hold the date, item and units sold, and type what's on the shelf. If the file has a stock column, Restock fills that in for you.

Who would pay: any small shop that loses sales when its best sellers run out, like a bakery, grocery or pharmacy. Running out on one busy day can lose more money than a small monthly fee, so Restock is worth paying for if it stops that from happening even once a month.

Before showing a forecast, Restock tests itself on your own sales. It hides your last 7 days, predicts them, then checks how close it got, and compares that with the simple rule most owners use: "order the same as last week". If Restock does worse than that rule, it tells you, so you know before you spend money on an order.

Demo

Live: https://restock-4nle.onrender.com. Click "Try it with sample bakery data", no file needed.

Restock start screen

That's the whole setup: one upload box, a sample button, and a plain note about where the data goes.

Changing stock updates the order

Change what's on the shelf and the order updates: 300 baguettes cover the week, so Baguette drops off; with only 200 croissants, Croissant joins the order.

Next 7 days forecast table

The forecast: what each item will likely sell, and the safe amount for a busy week.

Baguette sales and forecast chart

One item day by day: the last 4 weeks of actual sales, then the next 7 days with a quiet-to-busy range.

Code

GitHub logo bikrampun / restock

Next week's demand per item for small shops, forecast with TabPFN (open-weight tabular model). Hacktoberfest 2026 DEV challenge.

Restock

Upload past sales, get next week's demand per item with a safe amount to prep or order. Built on TabPFN, an open-weight foundation model for tabular data.

Live demo: https://restock-4nle.onrender.com (click "Try it with sample bakery data"; no file needed).

How it works: Restock on DEV, with the architecture diagram and the accuracy check.

Before showing a forecast, it hides your last 7 days, forecasts them, and tells you how far off it was compared with "same as last week".

Run it

pip install -r requirements.txt
cp .env.example .env   # then paste your free key from https://platform.priorlabs.ai/account/api-keys
streamlit run app.py
Enter fullscreen mode Exit fullscreen mode

Private mode: pip install tabpfn and the app runs TabPFN-3.5's downloadable weights on your own machine instead of the API, so sales data stays on the laptop. First accept the non-commercial license at https://platform.priorlabs.ai/accept-license, signed in to the account whose key is in .env. The…

Repo: https://github.com/bikrampun/restock

About 230 lines of Python in one app.py. The live app calls TabPFN with an API key; the test script, check.py, swaps in a fake model so anyone can test the app without a key or spending credits.

How I Built It

Restock architecture diagram

The CSV is cleaned into daily totals, TabPFN forecasts the next 7 days, and the order is the safe amount minus what's on the shelf.

The model. TabPFN is an AI model for spreadsheet-style data. It was trained in advance on millions of made-up tables, so it doesn't need training for each shop: you give it your rows and it predicts straight away. Prior Labs showed with TabPFN-TS that this works for sales forecasting too. For each day, Restock gives it five simple facts: the item, the day of the week (weekends sell more), the day of the month (paydays), the month (seasons), and a running day count (slow growth or decline).

Cleaning a messy file. Real exports are messy, so most of the code is cleanup:

  • one row per sale or one row per day both work; days with no sales count as zero
  • dates can be 2026-08-01 or day-first 01/08/2026, common outside the US
  • "Croissant", "croissant " and "CROISSANT" become one item
  • items under 3 weeks old, or with no sales in 2 weeks, are left out with a note
  • problems point to the spreadsheet row, like Row 12: "abc" isn't a number, so you can fix them in Excel

Messages for a messy CSV

What a messy file looks like in Restock: blue notes for what it fixed by itself, yellow for what you should check, red for what you need to fix.

From forecast to order. TabPFN gives a range for each day, not one number: a quiet day, a normal day and a busy day. "Expected" adds up the normal days. "Safe amount" adds up the busy days, so it's enough even if the whole week runs busy. The order is the safe amount minus what's on the shelf:

Safe amount = sum of the 7 busy-day forecasts
Order       = max(0, Safe amount - In stock now)
Enter fullscreen mode Exit fullscreen mode

For baguettes in the sample: a safe amount of 276, with 100 on the shelf, so order 176. An item with enough stock gets 0 and drops out of the message.

For stock, Restock only trusts each item's latest count. If that cell is blank, it shows 0 and names the row instead of using an older count. An older count is usually too high, which would make the order too small: the exact problem Restock exists to fix.

Honest numbers. On the sample bakery data, TabPFN was off by 4.3 units per item per day, against 5.7 for "same as last week" (24% better). That data is made up with clean weekly patterns, and the app says so. Real shop sales are messier, so expect a smaller gain, and the app shows that number for your own file.

Stack. Streamlit, pandas and tabpfn-client, hosted free on Render. The live demo calls Prior Labs' API. If you install tabpfn, the app switches to TabPFN's downloadable weights on your own laptop, so sales never leave it. That path is coded but not yet tested end to end.

Update (Oct 19): I've since tested private mode end to end: TabPFN-3.5's weights run on my laptop and work with Wi-Fi off, with the same forecast as the API.

Why Does Open Innovation Matter?

I read 24 public reviews of an established inventory forecasting tool on Capterra, Trustpilot, Reddit, Xero and Shopify. People like it, but the same complaint kept coming up: getting started. One reviewer wrote: "Initially navigating screen and tabs is confusing." Others thank the onboarding staff by name, because they needed help to get going. And every reviewer already ran their business on bigger software: Xero for accounting, a Shopify store, or a full business system (ERP).

None of those 24 reviewers was a small local shop.

An open, pre-trained model changes who can be served. Forecasting no longer needs a data team, a training pipeline or months of history. It needs one file. Prior Labs' free tier covers about 250 Restock runs a day (5 million daily credits, about 20,000 per run), so a free tool for small shops actually works. Anyone can read how Restock works, run it on their own laptop, or fork it for the shops in their town.

One honest catch: TabPFN is free, but not for business use. To charge shops, I'd buy a licence from Prior Labs or switch to a free-for-business model like TimesFM or Chronos. Open models give me that choice. A closed AI service wouldn't.

Prize Categories

  • Best Use of TabPFN: TabPFN does all the forecasting. Its busy-day numbers decide how much to order, and a second TabPFN run tests the forecast against "same as last week" on the shop's own sales.
  • Best Use of Render: the app runs on Render's free plan from a one-file render.yaml, with the TabPFN key kept as a Render secret.

Thanks to Prior Labs for publishing TabPFN, and to the Hacktoberfest team for a challenge that asked for something people would actually pay for.

Top comments (0)