跳到正文
DEV Community· Kritiraj·· 2 小時前AI 評分48

Ledger Lift:離線將商店手寫銷售帳簿轉成 CSV

Ledger Lift: turning a shop's handwritten sales ledger into a CSV, fully offline

AI 導讀

Ledger Lift 是桌面應用程式,可將商店手寫銷售帳簿照片轉成可編輯資料列及 CSV,並在本機處理,毋須上傳至託管 API。它透過 Ollama 執行開放權重視覺模型 qwen3-vl:2b-instruct,模型約 2 GB,下載後可離線使用。用戶須逐列核對並標記已審閲,才可下載;Apple M4 處理 15 列約需 21 秒,首列約 10 秒。

正文

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

What I Built

Ledger Lift is a desktop app that reads a photo of a handwritten daily sales ledger and gives you back editable rows and a CSV.

A lot of small shops still write every sale in a paper book. To get those pages into a spreadsheet, someone has to retype them. The tools that do it automatically want you to upload your shop's records to their server and pay per page.

In Ledger Lift you pick a photo of a ledger page and press Read this page. Rows (date, item, quantity, amount) show up one at a time as the model reads them. You fix whatever it got wrong, add more pages if there are any, tick each row as reviewed, and download one CSV for all of them. The photo stays on your computer the whole time.

The people I think would pay for this are shop owners, and the bookkeepers or accountants they hand their ledgers to, who currently spend hours retyping. Since there's no server cost per page, a one-time licence makes sense.

Demo

Ledger Lift showing a photo of a handwritten ledger page beside nine extracted rows, with uncertain fields highlighted in amber

Windows installer: Ledger Lift v0.2.1

Code

GitHub logo wkkny / ledger-lift

Photos of paper ledgers to spreadsheets, with a local open-weight vision model

Ledger Lift

A desktop app that turns a photo of a handwritten daily sales ledger into editable rows and a CSV. An open-weight vision model reads the page on the shop owner's own computer. Review and correct every row before using it.

The photo is sent only to the local Ollama service on the same computer. Ledger Lift does not store photos or send them to a hosted API. This is an early prototype: handwriting recognition can be wrong, so check each entry against the original page before downloading.

For the owner

  1. Open Ledger Lift. If Ollama isn't installed, the app says so, and its Download Ollama button opens the Ollama download page. Run its installer (no administrator password needed); the app notices when it finishes and carries on by itself.
  2. Ledger Lift starts Ollama for you and offers a one-time download of the reading model (about 2 GB).
  3. …

How I Built It

The model is qwen3-vl:2b-instruct, an open-weight vision model, running locally through Ollama. I skipped the plain qwen3-vl:2b tag because it thinks for 30 to 100 seconds before it answers anything. If you'd rather use a different model, there's a Model picker.

The app is Electron with a React UI (shadcn/ui and Tailwind v4). The main process looks after Ollama: it starts and stops it, downloads the model (about 2 GB, once) with a progress bar, keeps it loaded between pages, and sends each row to the UI as soon as it's read. The page itself is sandboxed and has no Node access.

Most shop owners won't have Ollama installed. If it's missing, the app tells them and opens the download page, then picks up where it left off once the install is done. No admin password needed.

Getting a 2B model to do this reliably took a few tricks:

  • Photos are shrunk to 1600 px on the long edge. Full-size phone photos overflowed the model's context window.
  • The prompt tells the model to read the total for each sale from the last money column, and to copy the date from the row above when there's a ditto mark.
  • Small models sometimes get stuck writing the same rows over and over. The app spots the loop, stops, and keeps the rows from before it.

I didn't want anyone to trust the output blindly. If the model couldn't read a field or wasn't sure about a digit, that field is highlighted, and the CSV download stays off until every row is marked reviewed.

To check how accurate it is, I wrote pnpm score. It runs the real model on real pages, compares the result with answer files I typed by hand, and reports per-field accuracy, missed and invented rows, and whether the fields it got wrong were the ones it highlighted.

A GitHub Actions workflow builds and smoke-tests a Windows installer that installs for the current user only. Unit tests run against a fake Ollama server, and Playwright drives the real app end to end.

On an Apple M4, a 15-row page takes about 21 seconds, and the first row shows up after about 10.

Why Does Open Innovation Matter?

A shop's sales ledger is private business data. With an open-weight model running locally, the pages stay on the owner's computer instead of going to a server they don't control. Once the model is downloaded, it works without internet too.

It's also why the business side works at all. There's no hosted inference bill per page, so the owner isn't tied to someone else's per-page pricing or subscription. And because the model and prompt are open, they can switch to another compatible model and see exactly how the extraction works.

It isn't perfect. Handwriting recognition gets things wrong, so every row needs checking against the page. I've scored two handwritten pages so far (about 9 and 16 rows). Amounts and quantities were mostly right, but dates and multi-word item names were weaker.

來源:DEV Community · dev.to