Inspiration
Grading services charge $25 to $80 a card, and most cards that collectors send in don't come back a 10. People find out after paying. Existing AI grading apps upload every photo to a cloud model and hand back a grade guess. They don't tell you whether the fee is worth it. I wanted a pre-check that runs where the binder is, on the collector's own laptop, and ends in a decision.
What it does
Slab or Skip checks a whole binder from photos and sorts every card into worth a closer look, skip grading, borderline or check authenticity first.
- Code measures what pixels can tell: it finds the card, measures centering against published grading limits, and measures corner whitening, edge chips and straight bright lines (scratches and creases).
- Gemini Nano, on device, answers what needs looking and reading. It answers two narrow questions with structured output: is there a bright line across the surface, and exactly what is printed in the name, HP, move and number areas. Code turns the printed text into counterfeit tells, such as HP printed after the number or a misspelled move.
- Agreement before a hard cap. A surface flaw only caps the grade hard when the code's line detector and the model agree. The worst flaw sets the best grade the photo supports, and the app shows what limits it.
- The money maths. For a card worth a closer look, enter recent sold prices (raw, PSA 10, 9, 8). The app weighs the odds of each grade against the grading fee and shipping and says send it or keep it raw. The fee table lives in Firebase Remote Config, so it can change without a release.
On the 12-card demo binder (fictional cards with known flaws), the on-device run matches the answer key on 12 of 12 cards, reads all 12 on the laptop, and sends 0 bytes of photos. The cloud fallback also gets 12 of 12.
How I built it: Firebase AI Logic hybrid inference
- One
getGenerativeModel()per question withmode: InferenceMode.PREFER_ON_DEVICE,onDeviceParams(image and English text in,responseConstraintschema out) andinCloudParams(the same JSON schema for cloud Gemini). The on-device and cloud paths share one prompt and one schema. response.inferenceSourceis recorded for every card. The UI shows "This laptop" or "Cloud" per row and counts the photo bytes that left the device.initializeDeviceModel()is called on the user's click and never awaited. While Chrome downloads Gemini Nano, cards go to the cloud instead of waiting for gigabytes.- A Simulate no Gemini Nano switch forces
ONLY_IN_CLOUD, so judges can see the fallback a laptop without Nano gets. - App Check with reCAPTCHA (Essentials, score-based) protects every cloud call in production, with a debug token in development.
- The live price lookup is written for Google Search grounding (
ONLY_IN_CLOUD, sends only the card's name and number as text). Grounding needs a paid Gemini plan, so the free public demo says the search is off and takes typed prices instead. The decision works the same either way. - React + TypeScript + Vite, hosted on GitHub Pages. Domain logic (centering limits, grade ceilings, fee parsing, combining code and model reads) is covered by unit tests.
- Built solo with an AI coding assistant. I made the product and design decisions and did the QA: running the binder on-device and in the cloud and checking each result against the answer key.
Challenges
- A small model is good at narrow questions and bad at broad ones. Asking Gemini Nano to grade a whole card got 6 or 7 of 12 right. Splitting the work fixed it: code measures geometry, Nano answers yes/no and reads text, and the two must agree before a flaw caps the grade.
- Nano corrects spelling. It "fixed" a misspelled move name on the counterfeit card. The prompt now asks for text copied letter for letter, and any counterfeit tell stops the card.
- Never make the user wait for a model download. The first version awaited the model download and froze. Now availability is checked with a timeout and the cloud takes over until Nano is ready.
- Free-tier rate limits in the cloud. The fallback sends one combined request per card and backs off on 429s.
Accomplishments
- 12 of 12 on the demo binder, fully on device, with 0 bytes of photos sent.
- The same answers through the cloud fallback.
- An interface that shows where each answer came from and what limits each card, not just a score.
What I learned
Hybrid works best when you design the question for the smallest model first. The cloud then becomes a true fallback with the same contract, not a different product.
What's next
- Back-of-card checks and a guided photo mode for straight-on shots.
- A calibration set of real, graded cards to replace the rule-of-thumb grade odds.
- Turn live price search on when the project moves to a paid Gemini plan.
Notes for judges
- Use desktop Chrome on hardware that supports Chrome's built-in AI to see on-device inference. Elsewhere the app uses cloud Gemini automatically.
- Click Load the demo binder, then Check 12 cards. Open any row for the measured borders and the reasons. Flip Simulate no Gemini Nano to see the fallback.
- All demo cards are fictional originals drawn with CSS. No real card art, names or trademarks are used.
- The whole project was built during the submission period.
- Code: https://github.com/Jone4865/slab-or-skip (Apache-2.0)
Built With
- chrome-built-in-ai
- firebase-ai-logic
- firebase-app-check
- firebase-remote-config
- gemini
- gemini-nano
- react
- recaptcha
- typescript
- vite
- vitest