#BuildHybridAI 2026 · iOS entry
Goldfish
Teach the goldfish. Ace the exam.
An iPhone study app that turns the AI tutor around. The student teaches Finn, a forgetful 8-bit goldfish who knows only what the student wrote. Gemini in the cloud reads the chapter and writes a hidden exam. Apple's on-device model plays the fish, so every quiz is instant, free and works offline.
01 · The hackathon
Google's #BuildHybridAI 2026
A Devpost hackathon for apps built on Firebase AI Logic's hybrid inference: a small model on the device where it can do the job, and Gemini in the cloud where it must. Every entry has to use at least one on-device platform: Chrome or Android with Gemini Nano, or iOS with Apple's Foundation Models. Goldfish is an iOS entry.
Closes Monday 30 November at 2:00 PM Pacific.
Apple's on-device model through Firebase AI Logic, with Gemini as the cloud tier.
- Technological Implementation
- Design
- Potential Impact
- Quality of the Idea
What an entry hands in
- A public GitHub or GitLab repo with all source, setup instructions and an OSI-approved licence. Goldfish uses Apache-2.0. The app must really call the Firebase AI Logic SDK at runtime.
- A public YouTube video, 3 minutes at most, showing the app working on its target platform, in English or with English subtitles.
- A Devpost write-up covering how Firebase AI Logic is used, the core features, the value and the platform category.
- A testable build (TestFlight, APK or web link) is encouraged but optional. Store releases are not required.
Dates, criteria and requirements are summarised from the hackathon brief. The official rules page on Devpost is the authority.
02 · The proposed candidate
Why Goldfish was picked
Six ideas were written up and compared on originality, impact and how much each needed both tiers of AI. Goldfish was chosen on 13 November 2026, ahead of the runner-up Knapsack, an offline tutor packed by the cloud. It was first sketched for Chrome desktop with Gemini Nano, then moved to the iPhone 17, where Apple's on-device model plays the fish.
Most AI study apps explain things to the student. Goldfish does the opposite: you teach the AI, and a smarter AI tests how well you did.The one-line pitch
On-device limits become the teaching method
Each weakness of a small phone model turns into a reason the method works.
Why it stood out
- Judges get it in one look. The fish fails, the student fixes one sentence, the fish passes.
- It needs both tiers. Only the cloud can read a long PDF and write a fair exam. Only a free local model makes re-quizzing on every edit practical, and a frontier model would be too clever to need teaching.
- A deterministic guard against bluffing. The fish must quote the student's own sentence word for word, and code, not a model, checks it.
- Grounded in learning research. Retrieval practice, spacing and learning by teaching carry the design.
The open risk: whether Apple's model answers only from the lesson. A 20-question Fish Check on the iPhone decides it, and the quote check turns most leaks into "not taught".
03 · Firebase AI Logic and hybrid AI
Two tiers, each doing the job it is best at
Every model call goes through the Firebase AI Logic Swift SDK (12.13.0 or later). The cloud handles the long reading and the careful writing. The iPhone handles the many short, repeated calls that make the game playable. Rules that must be exact, like grading and scheduling, are plain code.
- 1Add a chapterPDFKit pulls the text out on the phone. A long document is split at its headings into chapters of about 1,000 to 1,500 words.
Code - 2Write the Hidden Exam
gemini-3.8-flashreturns concepts and multiple-choice questions as JSON against a response schema. Code validates every question and runs one top-up pass for any passage no question covers.
Cloud - 3Fair exam checkApple's model only. Questions the fish can't answer even from an ideal teaching sentence are dropped.
On this iPhone - 4Teach in the Bowl600 words, chapter hidden. Any sentence sharing 8 or more words with the chapter is flagged "Say it your way".
Code - 5Pop Quiz: the fish answersOne question per concept, a new session each time. Apple's model first,
gemini-3.5-flash-liteif it is unavailable or refuses.
On this iPhone - 6Trace gradingAn answer counts only if its quote is in the lesson word for word, 3 to 30 words long, and holds the chosen option's key term. Otherwise it is a Gap.
Code - 7Your Turn and TidesThe student's own card quiz decides mastery: right on three different days. Reviews are spaced 1, 3, 7 and 14 days.
Code - 8Orla, the tutorThe deck is searched on the phone by words (BM25) and by meaning (Apple's sentence embedding). Apple's model writes a hint and a question back, never the answer. The cloud answers only when the prompt is too long.
On this iPhone - 9Final exam and Report CardThe fish takes held-out questions, the student takes Your Turn, and
gemini-3.8-flashwrites what was explained well, the misconceptions and what to review. Queued when offline.
Cloud
The hybrid call
From App/Services/FirebaseModels.swift. Apple's model is the primary, Gemini the secondary, with low temperature on both so the fish answers the same way each time.
let ai = FirebaseAI.firebaseAI(backend: .googleAI()) let system = FirebaseAI.SystemLanguageModel.default let cloud = ai.geminiModel(name: "gemini-3.5-flash-lite") let session = ai.generativeModelSession( model: .hybridModel(primary: system, secondary: cloud) ) let response = try await session.respond( to: prompt, options: .hybrid( gemini: GenerationConfig(temperature: 0), foundationModels: FirebaseAI.GenerationOptions( sampling: .random(probabilityThreshold: 0.1), temperature: 0.1 ) ) ) // Which tier answered: shown on every answer as a badge. let onDevice = response.rawResponse.modelVersion == "apple-foundation-models-system-language-model"
The fish's contract
One prompt per question, in a fresh session, so nothing carries over. The reply is plain text that our own parser reads, because Firebase lists on-device structured output as "docs coming soon".
You are a goldfish taking a quiz. You know nothing except the LESSON below. Use only the LESSON. First copy the one sentence from the LESSON that answers the QUESTION, word for word. Then give the letter of the matching option. If no sentence answers it, write NONE for both. QUOTE: <sentence or NONE> ANSWER: <A, B, C, D or NONE>
Token budget: about 1,230 of the 4,096 the on-device model takes: instructions 180, a 600-word lesson 850, question 120, reply 80. Answers are cached by a hash of lesson and question, so an unchanged lesson is never asked twice.
| When | What the app does |
|---|---|
| Apple's model unavailable | The hybrid session uses Gemini, and the badge says "Cloud" |
| Apple's model refuses | Retried once on a cloud-only session |
| Offline, no on-device model | Explains, and offers Your Turn, which needs no model |
| Cloud rate limit (429) | Backs off up to 3 times, then queues |
| Unreadable reply | Retried once, then treated as a Gap |
Showing the hybrid at work
Every fish answer carries a tier badge, On this iPhone or Cloud, and the quiz footer counts them, for example "8 on this iPhone, 0 cloud", with the phone's offline state.
The rest of Firebase
- App Check with the debug provider, since enforcement is required for AI Logic.
- Remote Config for model names, Bowl size and the tutor's search floor, with built-in defaults so the app works offline.
- Anonymous Auth and Firestore only for friends, shared chapters and teach-offs, all opt-in. Lessons and progress stay on the phone.
- No billing. Both Gemini models are on the no-billing tier.
04 · Abstract
What Goldfish is
Students preparing for content-heavy exams mostly reread, one of the least effective ways to study. Goldfish makes them teach instead. A student adds a chapter, and Gemini writes a hidden exam from it. The student explains each idea in their own words to Finn, a goldfish who knows nothing else, and Apple's on-device model answers the exam as Finn, quoting the sentence it relied on. A wrong answer points at the exact sentence that misled him, or shows the idea was never taught. Finn forgets everything between sessions, so each review starts with re-teaching from memory on a spaced schedule. The student is then quizzed directly, and only their own unaided answers count toward mastery. Teaching, quizzing and review run on the iPhone, free and offline. The cloud does the reading, the exam writing and the final report.
Who it is for
College students and licensure reviewers facing content-heavy exams, who study by rereading today.
Finn listens. The student is the teacher, and the one being assessed.
Design principles
- The student explains, the app never does.
- Memory first, notes second.
- The fish is the pupil; the student is assessed.
- Spread it out over days.
- Low stakes, honest feedback.
- No punishment: Finn never dies, nothing resets to zero.
- Time is never the score.
The evidence it rests on
- Retrieval practice, rated high utility (Dunlosky et al., 2013)
- Spacing across days (Cepeda et al., 2008)
- Learning by teaching, strongest when taught from memory (Kobayashi, 2019; Koh et al., 2018)
- Successive relearning to three correct recalls (Rawson and Dunlosky)
- Hypercorrection of confident errors (Butterfield and Metcalfe, 2001)
One study session, about 8 minutes
- Today shows a chapter is due and Finn has forgotten it.
- Fresh Water: re-teach the chapter from memory, the old lesson hidden.
- Call It: predict Finn's score.
- Pop Quiz: Finn answers on the phone, one question per idea.
- Miss review: fix the sentence that misled him, then re-quiz.
- Your Turn: a card quiz the student answers unaided.
- Wrap-up: the Mastery Map and when the chapter is next due.
Features
- Chapters and the Hidden Exam: PDF or pasted text, whole documents covered, a fair exam check.
- Teaching: the Bowl, the own-words check, Curious Fish "why" questions.
- Quizzing Finn: Pop Quiz, Trace, Mix-ups and Gaps, instant re-quiz, tier badges.
- Testing the student: Fresh Water, Your Turn cards with "One more go", Mastery Map, final exam and Report Card.
- The habit: Tides scheduling, exam dates, Feeding Time reminders, the forgiving fire.
- Decks and Orla: subjects as decks, and a Socratic tutor who points to the passage, never the answer.
- Friends: shared chapters and teach-offs, where two students teach the same chapter and compare idea by idea.
- 8-bit sounds and haptics, with no failure buzzer.
Orla, a red-cap Oranda in Finn's old glasses, has read the current deck. She answers with a hint, a question back and a passage to reread.
The fire counts teaching days. One missed day leaves embers, and the screen never shows a zero.
Mastery is the student's. Right in Your Turn on three different days, whatever Finn scored.
05 · Screens
The app, screen by screen
Mock-ups at iPhone 17 size, drawn from the same pixel art the app uses. The theme switch at the top shows each one in light and dark. Groups marked "Built" are written in Swift and waiting on their first device build.