跳到正文
DEV Community· Ishaan·· 2026-10-16AI 評分35

Shop Rate Bot: a one-page shop FAQ bot

Shop Rate Bot: a one-page shop FAQ bot

AI 導讀

作者製作 Shop Rate Bot,一款單頁店舖常見問題機械人,可即時回答商品價格及營業時間問題。它優先使用透過 Ollama 運行的 Gemma,失敗時則改用內置的固定回覆;離線時固定回覆仍可運作。專案採用 MIT 授權,不設資料庫或登入驗證。

正文

Ishaan

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

What I Built

Shop Rate Bot: a one-page shop FAQ bot. A shopkeeper sets a small rate card (atta, rice, milk, chai, sugar, eggs); customers ask "rice price?" or "open?" and get an instant answer. A status dot shows whether the answer came from the local model (green, Gemma via Ollama) or the built-in stub (grey).

Someone would pay for this: a neighbourhood kirana that fields the same rate/hours questions all day. No app to install, no per-query bill, answers in seconds.

Demo

  • Live: https://shop-rate-bot.onrender.com/
  • Try: "rice price?", "open?", "chai price?"
  • Note: Render free tier serves the deterministic stub (no Ollama there, no per-token budget). Run ollama run gemma3n:e2b locally and the same questions get warmer Gemma-written answers, dot flips green.

Code

https://github.com/ishaan-jindal/shop-rate-bot

FastAPI + one HTML page, no DB, no auth. MIT licensed.

How I Built It

src/brain.py tries Ollama first ($OLLAMA_HOST, $GEMMA_MODEL, default gemma4:e2b) with a strict short-JSON prompt grounded in the rate card, and falls back to a keyword stub on any failure — the endpoint never 500s and the app boots with zero keys. src/app.py exposes /health, /api/ask, /api/status. The page is 15 lines of inline JS. Docker image deploys to Render free tier with /health as the healthcheck.

Why Does Open Innovation Matter?

Two reasons this only works open. First, cost: a closed per-token API makes a Rs 499/month price for a kirana impossible; a local Gemma costs nothing per query. Second, privacy and offline: rate questions and customer patterns never leave the shop laptop, and the stub keeps answering with the Wi-Fi off. Open-weight models turn a shop laptop into the whole backend.

Prize Categories

Best Use of Render, Best Use of Gemma

來源:DEV Community · dev.to