DukaanDraft:供小店使用的本機 AI 寫作助手
DukaanDraft: a local AI writing helper for small shops
DukaanDraft 是一款供小店使用的英語本機 AI 寫作原型,可將簡短優惠資料改寫成可編輯貼文草稿。它使用量化版 SmolLM2-360M-Instruct,透過 Node 在本機 CPU 推理;草稿須由用戶核對及自行複製,不會自動發布。應用程式採 MIT 授權,模型權重採 Apache-2.0 授權;原型未有公開部署。
This is a submission for the DEV Hacktoberfest Week 2 Challenge.
What I Built
DukaanDraft is an English-only prototype that turns a local shop's short offer facts into an editable post draft.
The workflow is simple: enter a shop name and offer facts, generate a rewrite, compare it with the original facts, edit, and copy. Nothing is posted automatically. The destination labels help organize a draft for WhatsApp, Google Business Profile, or Instagram; they do not change the model prompt yet.
The side-hustle idea is a human-reviewed post-writing service for local shops. It is an idea to test, not an existing business. There are no customer, revenue, or willingness-to-pay claims.
Demo
The fictional test input was:
- Shop: Fictional Store
- Offer facts: rice for Rs 50 per kg.
The model returned:
Fictional Store sells Rice at Rs 50 per Kg.
The complete local browser-to-Node-to-model test returned this draft in 3.8 seconds on the test computer. This is one measured result, not a performance guarantee. First use also downloads model weights.
The interface keeps the original facts under the editable draft, alongside a warning to check every claim. A small model can still invent details or change a name. In other tests it added "affordable" or changed a shop name, which is why human review is part of the product rather than an afterthought.
Code
The application code is MIT licensed. The model weights keep their own Apache-2.0 license.
To run locally with Node.js 20+:
npm install
npm start
Then open http://127.0.0.1:8787 on the same computer. The prototype was tested with Node 22 on Linux. It is not publicly deployed.
How I Built It
The app uses plain HTML and JavaScript for the form, a small Node HTTP server, and Transformers.js for local inference.
The AI core is SmolLM2-360M-Instruct, using the ONNX community conversion. The quantized model runs on the CPU in Node, not through a hosted inference API. No API key or new account is needed to run the app.
The server listens only on the local loopback address and accepts local same-origin browser requests. Model files are downloaded from Hugging Face; shop text is processed locally by this application. The first download is hundreds of MB, and model loading needs enough free memory. This is not a phone-only or low-memory-device promise.
I kept the scope small: English rewriting, an editable result, original facts for comparison, and an explicit copy action. Earlier API-hosted and browser-only inference approaches were explored but were not verified as working routes and are not the shipped version.
Why Does Open Innovation Matter
Open weights make it possible to test this idea without an inference-service account or a per-request API dependency. The model can be downloaded, inspected through its published documentation, and run locally. Open-source application code lets someone else change the workflow or replace the model without starting from scratch.
That freedom also makes the tradeoffs visible. A small local model is accessible, but it is not automatically accurate enough to write a shop's public claims. The useful next step is to test with real shop owners, measure factual errors, and find out whether a reviewed writing service saves them enough time to pay for it.
For now, DukaanDraft is a working local experiment with a clear review step, not a claim of a finished commercial product.
來源:DEV Community · dev.to