AI & LLMCase study
The Pour Is Right
LLM wine pricer and deal-hunting agents: QLoRA fine-tuning, RAG with Qdrant, an ensemble, and LangGraph agents that send Telegram alerts.
- Category
- AI & LLM
- Status
- Case study
- Core stack
- Python · PyTorch · Hugging Face Transformers · PEFT / QLoRA · TRL

“$7.96 avg. price error, 63% below baseline”
01 — Overview
My capstone for Ed Donner's AI Engineer Core Track, applied to wine instead of the course's Amazon products. Models predict the price of a bottle from its review, and an agent system finds live wine deals and messages me about the best one.
02 — How it's measured
Every model prices the same 200 held-out test wines (median price $33). The score is the mean absolute error: the average gap, in dollars, between the predicted and the real price. Lower is better.
The baseline is the simplest possible model: always predict the average price of the training wines ($41.72). It is off by $21.71 on average, and every percentage on this page is measured against it.
| Model | Avg. error | vs. baseline |
|---|---|---|
| Baseline: always predict the average | $21.71 | — |
| Qwen 3 4B before fine-tuning | $23.15 | 7% higher |
| Qwen 3 4B fine-tuned with QLoRA | $10.10 | 53% lower |
| Claude Sonnet 5, no examples | $9.06 | 58% lower |
| Claude Sonnet 5 with RAG | $8.25 | 62% lower |
| Ensemble | $7.96 | 63% lower |
03 — What it does
- 01Curated 280,000 wine reviews into a 22,000-item dataset, and rewrote every review into a standard summary with an LLM through the Groq Batch API, for about $1
- 02Benchmarked traditional ML, neural networks and frontier models (Claude, GPT, Qwen) on the same 200 test wines
- 03Fine-tuned Qwen 3 4B with QLoRA on a free Colab T4, cutting its error from $23.15 to $10.10, level with Claude Sonnet 5
- 04Served the fine-tuned model as a GPU service on Modal
- 05Added RAG with a Qdrant vector store, and combined Claude, the fine-tuned model and a PyTorch network into an ensemble: average error $7.96, 63% below the baseline
- 06Built agents that read live deals from WTSO, Last Bottle and HotUKDeals, price them with the ensemble, and send the best to Telegram
- 07Wrote the planner as a LangGraph graph with parallel fan-out, conditional routing and human-in-the-loop approval, and wrapped it all in a Gradio app
04 — Architecture
A LangGraph planner fans out to a scanner and an ensemble of three pricers, decides whether a deal is worth it, and notifies me on Telegram.
Hover or tap a component to see what it does and what it talks to.
- External
- AI / ML
- Service
- Data
- Client
05 — Engineering challenges
- 01Removing price hints from the review text, so the models judged the wine instead of reading the answer
- 02Training on a free T4: bfloat16 ran at 0.08 steps per second, and switching to float16 with float32 adapters made it six times faster
- 03Working around a gated base model (Llama) by moving to Qwen, whose tokenizer writes prices one digit at a time
- 04Keeping the scanner's descriptions factual: the first version invented tasting notes and let UK deals crowd out the US ones
- 05Pricing deals one at a time, because parallel calls made Modal start a new GPU container for each request
06 — Stack
- Python
- PyTorch
- Hugging Face Transformers
- PEFT / QLoRA
- TRL
- Qdrant
- LangGraph
- OpenAI
- Claude
- Groq
- Modal
- Gradio
- scikit-learn
- XGBoost
Next project
LogiFlow