Inspiration

The fastest way to find out what you do not understand is to explain it to someone. Teachers call it the protege effect. But you cannot practise it with a normal AI: a big model already knows the answers, so it "passes" even when your explanation is wrong. It is a bad student.

Gemini Nano is small. It does not know much, and that is exactly what a student should be. Pip turns the small model's weakness into the product.

What it does

Pip is a small AI student that lives in your Chrome browser (Gemini Nano, on device). You learn a topic by teaching it to Pip.

  1. Pick a topic: a ready pack, a class code from your teacher, any new topic, or your own notes, a PDF or a link.
  2. Pre-test (the ignorance probe): Pip answers the exam with no lesson, on the device, 3 samples per question. Questions Pip already knows are dropped, so a passing score has to come from your lesson.
  3. Teach: type, dictate, snap a photo of your notes (read on the device), or send highlighted text from any page with the Pip Chrome extension. Pip raises a hand when something is unclear.
  4. Exam: Pip answers 12 questions on the device, quoting your lesson as its reason ("You said heavier things sink"). Majority vote over 3 samples.
  5. Feedback: wrong answers grouped by misconception, the exact lesson lines that caused them (function calling), one Socratic hint that never gives the answer, and Pip's sketch of what it understood. Fix the lesson and re-teach. Your score line climbs.
  6. After Pip passes: the Professor's viva questions you out loud (Gemini Live API), and you can share your lesson to a moderated Hall of lessons.
  7. Pip forgets: what Pip learned fades on a forgetting curve. Streaks, badges and an opt-in push reminder bring you back.

For teachers: class packs from a topic, a syllabus link or a PDF; a class code; a misconception heatmap; a Live Teach-off with a real-time leaderboard; lessons grouped by meaning with vector search; a weekly AI report. Teachers see class totals, never a student's lesson text.

Why hybrid is the product

Every AI call has one job and the inference mode that fits it:

AI call Mode Why
Build exam ONLY_IN_CLOUD A strong model writes correct questions and tags a misconception on every wrong option
Ignorance probe ONLY_ON_DEVICE Must measure Nano's own knowledge; a cloud fallback would make it meaningless
Pip's exam ONLY_ON_DEVICE One model scores every answer; 12 questions x 3 samples cost nothing
Pip raises a hand PREFER_ON_DEVICE Runs while you type; nothing is scored, so fallback is fine
Tutor hint PREFER_IN_CLOUD Quality first; offline it falls back to Nano
Photo of notes, Inside Pip's head PREFER_ON_DEVICE Private and free on the device (image input)
Tutor marks lines, number check, packs from PDF or link, viva, TTS ONLY_IN_CLOUD Function calling, code execution, PDF input, URL context, Live API, TTS

Rules: we never mix sources inside one exam. If Nano is not available, the whole session runs on a clearly labeled "Cloud stand-in, less honest learner". Every response shows an On-device or Cloud badge from inferenceSource, and the Under the hood drawer counts on-device vs cloud calls, cloud calls avoided and latency per source, because Firebase's AI monitoring has no on-device data.

How we built it

React, Vite and TypeScript, with Firebase AI Logic hybrid inference (all four web modes), structured output validated with zod, and a 3D Pip built in three.js.

Firebase products: AI Logic, App Check (reCAPTCHA Enterprise, enforced), Authentication (anonymous, upgrade to Google), Cloud Firestore (offline cache, vector search), Realtime Database (Live Teach-off presence), Remote Config (models, prompts, thresholds, feature flags), A/B Testing (hint style, goal score_up), Google Analytics, Performance Monitoring, Cloud Messaging (reminders), Hosting (installable PWA, works offline).

Everything runs on the free Spark plan. Instead of Cloud Functions, a small Node server on Render with the Firebase Admin SDK handles teacher roles, class stats and vector search, and relays the Live API with App Check headers. A daily GitHub Actions job sends push reminders, writes a Genkit weekly teacher report, and exports anonymous data to the BigQuery sandbox.

We used the Firebase agent skills in Claude Code. The firebase-security-rules-auditor skill audited our Firestore rules; it found that a class code could be reused by another user and that pack checks ran only on create, and we fixed both.

Step 0: the kill test

Before any UI we tested whether the idea works on the real model (Gemini Nano in Chrome, on device, 3 samples per question):

  • Wrong lessons: with a fictional-world persona, Pip followed 5 of 5 deliberately wrong lessons; with no lesson it picked the wrong fact 0 of 5 times.
  • Ignorance probe: on plain textbook questions only 1, 4 and 0 of 30 survived, because Nano already knows textbook facts. Questions built from class notes and probed as Pip: 12, 15 and 15 of 15 survived. So Pip's packs ask about the source's own examples and results.
  • Stability: the same lesson 3 times scored 10, 10 and 10 of 12.
  • Our class float lab pack: a wrong lesson scored 1 of 12, a good one 11 of 12.

Challenges

  • Nano knows more than we expected about textbook topics. The probe and the "build from your own notes" path were the fix.
  • Live API on the web sends no App Check header on its WebSocket, so we built a small relay.
  • Staying on the free plan meant building our own stand-ins for Functions, scheduled jobs and Storage.

What we learned

  • A small model is a better student than a big one, but only after you measure what it already knows.
  • Hybrid works best when every call has one clear job: the device for anything scored or private, the cloud for anything that must be correct.
  • Never mix sources inside one exam, or the score stops meaning anything.

What's next

Android and iOS through AI Logic's on-device support, more class packs, and a deeper teacher view.

Try it

  • Live: https://pip-hackathon.web.app (Chrome 139+ desktop; for on-device Pip enable chrome://flags/#prompt-api-for-gemini-nano-multimodal-input and click Download Pip; without it Pip runs as the labeled cloud stand-in)
  • Code: https://github.com/jumanak825-lang/pip-learns (Apache 2.0)
  • Test steps: pick "Our class float lab", teach a wrong lesson ("the clay boat floats because flat clay is lighter"), give Pip the exam, read the hint, fix it, re-teach. Open Under the hood to see device vs cloud calls.

This is a new project built for #BuildHybridAI 2026.

Built With

Share this project:

Updates

Submission history