ShopCast: a sales forecast a small shop can actually pay for

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

ShopCast: a sales forecast a small shop can actually pay for

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 The shop owner already knows Saturday is busy. What they cannot price is how much busier, or what happens if they run a Friday promo, or whether last month’s “slow Wednesday” was just Wednesday. Closed forecasting tools want a seat licence in dollars and the whole sales history on a server they control. For a bakery or mini-mart, that is not a product. That is a cost centre.

Hacktoberfest 开源 AI 挑战赛第 2 周:副业项目提交 💸 这是 Hacktoberfest 开源 AI 挑战赛第 2 周的副业项目提交。我构建的内容:店主已经知道周六很忙。但他们无法估算的是到底忙多少,或者如果他们进行周五促销会发生什么,又或者上个月的“冷清周三”是否真的只是周三。封闭式的预测工具需要以美元计价的席位许可,并将全部销售历史存储在他们控制的服务器上。对于面包店或小型超市来说,这不是产品,而是成本中心。

ShopCast is the version I would actually charge for. Export daily sales as a CSV (date, sales, optional promo). Click Start forecast. You get: the next 1–8 weeks of sales, with a range, not a single smug number unusual days the model did not expect (generator died, surprise catering order) a backtest against the owner’s own rule: “same as last week” a chat box that answers “what if I promo every Friday?” with TabPFN’s numbers, then Gemma’s words Who pays: a shop that would spend a few thousand naira a month to stop over-baking on Tuesdays.

ShopCast 是我真正愿意收费的版本。将每日销售额导出为 CSV(日期、销售额、可选促销)。点击“开始预测”。你将获得:未来 1-8 周的销售额,以区间而非单一自负的数字呈现;模型未预料到的异常日期(发电机故障、意外的餐饮订单);针对店主自身规则“与上周相同”的回测;一个聊天框,通过 TabPFN 的数据和 Gemma 的语言回答“如果我每周五都做促销会怎样?”。谁会买单:一家愿意每月花费几千奈拉来避免周二过度烘焙的商店。

How I Built It I built this on a five-year-old Latitude: 2-core i5, 8 GB RAM, no usable GPU. About a gigabyte free on a good day. So the first design decision was boring and correct: do not run TabPFN or a 27B model on this laptop. TabPFN goes through Prior Labs. Gemma goes through Google AI Studio. The laptop runs Streamlit and pandas.

我是如何构建它的:我在一台五年前的 Latitude 笔记本电脑上完成了开发:双核 i5,8GB 内存,没有可用的 GPU。状态好的时候大约有 1GB 的空闲内存。因此,第一个设计决策既无聊又正确:不要在这台笔记本电脑上运行 TabPFN 或 27B 模型。TabPFN 通过 Prior Labs 运行,Gemma 通过 Google AI Studio 运行。笔记本电脑仅运行 Streamlit 和 pandas。

The second decision was how to make forecasting tabular. Each day is a row: weekday, payday window, Nigerian public holidays, festive season, promo flag, sales from 7 and 14 days ago. Lags start at 7 on purpose. That way TabPFN predicts a whole week in one call, then those predictions become next week’s lags. Four API calls for 28 days, not 28. Unusual days use the same model in 5-fold out-of-sample scoring.

第二个决策是如何使预测表格化。每一天都是一行:工作日、发薪日窗口、尼日利亚公共假期、节日、促销标记,以及 7 天和 14 天前的销售额。滞后项特意从 7 开始。这样 TabPFN 可以在一次调用中预测整周,然后这些预测成为下一周的滞后项。28 天只需四次 API 调用,而不是 28 次。异常日期使用相同的模型进行 5 折样本外评分。

Why Does Open Innovation Matter? The model vanished and the app did not. Gemma 3 27B 404’d. I listed what the key actually serves and swapped. A closed “forecasting API” with one SKU does not let you do that on a Sunday afternoon. Small data is the product, not the edge case. A bakery has hundreds of daily rows, not millions. TabPFN is built for that. Asking a general LLM to “look at the CSV and predict October” is how you fail.

为什么开放式创新很重要?模型消失了,但应用程序没有。Gemma 3 27B 报错 404。我列出了密钥实际支持的模型并进行了切换。一个只有单一 SKU 的封闭式“预测 API”无法让你在周日下午做到这一点。小数据才是产品,而不是边缘情况。面包店有数百行每日数据,而不是数百万行。TabPFN 正是为此而生。要求通用大语言模型“查看 CSV 并预测十月”是注定会失败的。