Show HN: Using an LLM to sensibly sort a shopping receipt (www.treblig.org)

🤖 AI Summary
A Show HN project uses a local LLM as a lightweight classifier to sensibly sort grocery receipt lines. The pipeline extracts items from a PDF via pdftotext + awk/fmt, attaches a short prompt that forces the model to output exactly one word from each input line (the most important classifier token), runs a local llama.cpp client with Qwen3-Coder-30B (and parameters like temp 0.7, top-p 0.8, top-k 20, presence-penalty 1.0, q8_0 cache), strips extraneous markers, sanity-checks line counts, and then pastes the model’s single-word tags onto original lines for Unix sort. The single-word constraint prevents the LLM from “mangling” item text and keeps outputs simple and easy to use in external tooling. For the AI/ML community this is a pragmatic example of using LLMs as feature-extractors in deterministic pipelines: it showcases local model deployment, prompt engineering to constrain outputs, and practical validation (count checks, post-filtering). It also highlights limitations—non-deterministic tagging (e.g., “Choco” vs “Pops”) can harm user experience—so developers must combine prompt rules, deterministic sampling (or lower temp), and fallback normalization or rule-based overrides. The approach is notable for being low-friction, privacy-friendly (local model), and immediately useful, while reminding practitioners to build verification and consistency layers around LLM-driven labels.
Loading comments...
loading comments...