跳到正文
DEV Community· mohamedaminehamdi·· 3 小時前AI 評分39

FlipCheck 用 Gemma 4 和 TabPFN 從相片估算二手物品價格並生成刊登內容

FlipCheck: snap a thrift find, get a fair price and a ready listing (Gemma 4 + TabPFN)

AI 導讀

FlipCheck 用 Gemma 4 識別物品,再以 SerpApi 搜尋最多 200 筆即時 eBay 刊登,交由 TabPFN 根據物品狀況估算快速出售、公平及耐心等候價格,並生成 eBay 標題、描述和商品資料。價格依據的是目前叫價,而非成交價;TabPFN 在 CPU 上處理 200 筆刊登需時 0.2 s。程式目前未部署,可在本機運行。

正文

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

Posted after the submission window closed, so it's here to share the build rather than to compete.

What I Built

Every reseller knows the routine. You find something good at a thrift store or a car-boot sale, and then you spend ten minutes on eBay working out what it is, what it's worth and how to list it. Multiply that by forty items a weekend and the research eats the profit.

FlipCheck does that research from one photo:

  1. What is it? An open vision model names the item: brand, model, visible condition, and the search a seller would type.
  2. What's it worth? It pulls live eBay listings for that search and prices your item's condition as three numbers: quick sale, fair, and if you can wait. It also shows the closest listings.
  3. The listing. An eBay title (80 characters max), an honest description and item specifics, each with a copy button.

FlipCheck home screen

Who would pay for it: part-time flippers on eBay, Vinted and Depop. Many already pay for listing tools and pricing spreadsheets. The pitch is simple: price an item in 15 seconds instead of 10 minutes.

Demo

FlipCheck isn't deployed yet. It runs locally in three commands:

git clone https://github.com/mohamedaminehamdi/flipcheck && cd flipcheck
cp .env.example .env        # add a SerpApi key; Gemma 4 defaults to local Ollama
uv run uvicorn app.main:app --port 8000

The repo includes a Render blueprint (render.yaml) for one-click hosting.

Code

GitHub logo mohamedaminehamdi / flipcheck

Snap a thrift find, get a fair resale price from live eBay listings (TabPFN) and a ready-to-paste listing (Gemma 4).

FlipCheck

Snap a thrift find. Get a fair resale price and a listing ready to paste.

For eBay, Vinted and car-boot flippers who price dozens of items a week and hate the research.

photo ──> Gemma 4 (vision) ──> "Canon AE-1 with 50mm f/1.8, used"
      ──> live eBay listings for that search (SerpApi)
      ──> TabPFN learns a price model from those listings, on the spot
      ──> quick sale · fair · patient price, plus the closest listings
      ──> Gemma 4 writes the title, description and item specifics

How the price works

  1. Identify. Gemma 4 names the item from the photo: brand, model, visible condition and the search a seller would type. You can edit the search before anything is priced.
  2. Market. Up to 200 current eBay listings for that search, via SerpApi. Lots, sponsored listings, unrelated titles and price outliers are dropped.
  3. Price. TabPFN is a tabular foundation model. It…

How I Built It

photo ──> Gemma 4 (vision)       "Canon AE-1 with 50mm f/1.8, used"
      ──> SerpApi eBay search    up to 200 current listings, cleaned
      ──> TabPFN                 a price model fitted on those listings, on the spot
      ──> Gemma 4                title, description, item specifics

The app renders each step as soon as it's ready. You see what it thinks the item is first, and you can fix the search before any market data is spent.

Step 1: Gemma 4 identifies the item

Gemma 4 gets the photo and must answer in a strict JSON schema: title, brand, model, condition, search query and confidence. I tested the small gemma4:e4b locally through Ollama on four freely licensed photos:

Photo Gemma 4 E4B said
Canon AE-1 Canon AE-1 with 50mm f/1.8 ✅
Original Game Boy Nintendo Game Boy ✅
Coach Borough bag Coach, model unknown, low confidence ✅ honest
Air Jordan 4 "White Cement" Nike Air Max 90, high confidence ❌

Two lessons:

  • Make it look before it names. I added a visible_marks field that comes first in the schema: list every logo, label and printed detail you can see, then name the item. That fixed the overconfidence on the bag. It didn't fix the sneaker, where the 4B model saw a "red swoosh" instead of a Jumpman. Telling sneaker models apart is hard, and a bigger model is the real fix.
  • Small models invent features. The listing writer said the Game Boy had "stereo sound capability". Only through headphones. The prompt already forbids specs it can't see. That's why the hosted version uses the 31B Gemma 4 through an OpenAI-compatible endpoint (DigitalOcean or OpenRouter). Switching is one environment variable.

Step 2: live eBay listings, honestly labelled

SerpApi's eBay engine no longer returns sold listings, and eBay's sold-price API needs approval. So FlipCheck prices against current asking prices and says so on every result: "Sold prices are usually a bit lower."

Before pricing, the comps are cleaned:

  • sponsored listings and bulk lots are removed
  • titles that don't share most of the search's words are dropped
  • outliers (accessories, damaged lots) are trimmed with a robust log-price band

Step 3: TabPFN prices this item

This is the part I like most. TabPFN is a tabular foundation model: it fits a small table in one forward pass, with no training run. So every search gets its own price model, fitted on that search's fresh listings.

For each listing it sees:

  • condition
  • auction vs buy-it-now
  • shipping cost
  • seller feedback
  • how closely the title matches

It predicts the 25th, 50th and 75th percentiles of log price for an item in your condition. Below 8 good listings, it falls back to plain percentiles; below 3, it says there isn't enough data.

It's fast enough to forget about: 0.1 s for 50 listings, 0.2 s for 200, on CPU. In the test suite, on a synthetic market, it prices "new" above "used" and keeps quick ≤ fair ≤ patient.

Built to survive the public internet

A pricing tool spends real money on every check, so the API is guarded:

  • Rate limit per IP. It's keyed on the address the hosting proxy writes, so a faked X-Forwarded-For doesn't reset it, and IPv6 clients are grouped per /64.
  • Upload size. Bodies over 12 MB are refused before they're read, and decompression-bomb images are rejected.
  • API keys never appear in errors. There's a test that tries to leak one.

CI runs 10 offline tests plus the real TabPFN test on every push.

Why Does Open Innovation Matter?

Because a side hustle only works if the cost per check rounds to zero.

  • The model licence decides whether you can sell it. TabPFN's v2 weights (Apache 2.0 plus attribution) may be hosted commercially; its newer weights are non-commercial. FlipCheck uses v2 on purpose. With a closed model, that question never even comes up. You just get whatever the pricing page says this month.
  • No training pipeline to maintain. TabPFN learns from each search's listings in a fraction of a second, so prices are always current. There's nothing to retrain when the market moves.
  • Swap the brain, keep the business. Gemma 4 is open-weight. The same code runs on a laptop with Ollama, on DigitalOcean, or on OpenRouter. If one provider raises prices, you change one environment variable.
  • It can run on the seller's own machine. For people pricing hundreds of items, a local model means no per-image fee at all.

My Agent Session

I built FlipCheck with Claude Code as my pair programmer: the research (which is how I found out sold listings were gone), the TabPFN pricing design, and the security hardening.

Prize Categories

Technologies used (posted after the deadline, so for the record rather than for judging):

  • Gemma: identifies the item from the photo and writes the listing, with schema-constrained JSON.
  • TabPFN: the pricing engine, fitted on each search's live listings with no training, giving prediction intervals.
  • SerpApi: the eBay market data integration (built and tested offline; live runs need an API key).
  • GitHub Copilot: GitHub Actions CI runs the offline and TabPFN tests on every push.

What's next: real prices for the four examples, a hosted 31B Gemma for better sneaker IDs, and a first real reseller. If you flip things and want to try it, tell me in the comments.

來源:DEV Community · dev.to