What 10 University Visits in Cameroon Taught Me About Building AI for the Real World, and Why Gemma 4 Was the Answer EduCloud, a fully offline AI study assistant that runs on-device using Gemma 4 to help African students turn PDFs and lecture screenshots into interactive study materials. The project, tested across 10 Cameroonian universities, specifically chose Gemma 4's E2B model for its tool-calling capabilities, which eliminated the need for a complex JSON repair pipeline by guaranteeing structured output. The app is built with Flutter and Dart, supporting multiple platforms from a single codebase to accommodate diverse student devices. This is a submission for the Gemma 4 Challenge: Build with Gemma 4 I run Educloud Academy, a learning platform focused on cloud and AI skills for African students. Over the last year my team and I have done university outreach across 10 Cameroonian universities ,including my own alma mater, the University of Buea, running on-the-ground sessions on how to break into cloud and AI careers. Outreach evidence LinkedIn : Photos from these sessions attached below this post. Two problems kept showing up at every single campus, no matter the topic: EduCloud the app is my answer to both. It's a fully offline, on-device AI study assistant that turns a learner's own PDFs, textbooks, and lecture screenshots into interactive study materials — multiple-choice quizzes, flashcards, multi-lesson workshops, mind maps, and summaries — without a single byte ever leaving the device. Because Gemma 4 is genuinely multilingual, the same binary that serves an English-speaking student in Yaoundé serves a French-speaking student in Douala without an extra translation hop. ultraLean / lean / balanced / full and adjusts token budgets, RAG context size, and max question count so it runs cleanly on the iPhone 13 Pro Max I tested on as well as on lower-end mid-range Androids that students actually own.Everything is built in Flutter + Dart, with native Gemma 4 inference via the flutter gemma plugin LiteRT-LM under the hood , and persistence via ObjectBox. iOS, Android, macOS, Linux, and Windows are all supported from one codebase — important because campus device fleets aren't uniform. Watch the walkthrough on YouTube: https://youtu.be/dVYz8xq2L 8 Full source: https://github.com/trey-rosius/Local-Educational-App Key directories to explore: lib/services/educational tool service.dart — all 8 function-call schemas quiz, flashcards, workshop, plus 5 interactive tutor tools .lib/services/study material service.dart — generation entry points + the JSON repair pipeline + semantic validators.lib/services/rag service.dart — PDF/image ingestion, batched embedding, HNSW search.lib/services/background generation service.dart — the non-blocking task queue that branches between tool-call and text-mode paths.architecture.excalidraw — full visual architecture diagram open at https://excalidraw.com .README.md — complete feature + architecture + failure-mode documentation.Model chosen: Gemma 4 E2B .task . E2B was the only viable choice for a truly on-device application of this scope: E2B hits the sweet spot for what EduCloud needs: Message.withImage ... — critical for the "snap a textbook page" feature.ToolChoice.required + a Tool schema, structured generation is guaranteed valid — no JSON parsing failures possible. Before migrating to tool calling I had to maintain a ~700-line state-aware JSON repair pipeline to handle every quirk the model produced asymmetric quotes, missing braces, Python-style single quotes, \X escapes outside strings, 0.0 as answerIndex instead of 0 , citation paste-throughs… . After the tool-calling migration, that pipeline is now a fallback that almost never fires.How Gemma 4 is wired into the app, end to end: flutter gemma 's Embedder.generateEmbeddings List