Skip to content
All projects

Case study · AI Engineering · Forward Deployed · Architecture

Offline AI Tutor with Gemma 4 for Rural Peru

Educational tutor running Gemma 4 locally on a community edge server, so primary students without internet can use AI from basic phones over local WiFi

The problem

Many primary students in rural Peru have no internet at home or at school. Cloud AI tutors assume a connection they do not have.

Constraints

  • No internet in the classroom
  • Students only have basic phones with a web browser
  • Everything must run on one school computer
  • Answers must stay within the student’s grade and subject, using official MINEDU materials

Architecture and decisions

Click a box to see why it was chosen.

Offline AI Tutor (Gemma 4)Students
Basic phonesbrowser, no data
Local WiFischool intranet
Edge server
Web UIno CDN, works offline
FastAPIREST API
Agent
Google ADKagent + tools
Gemma 4local via Ollama
Gemini APIoptional cloud mode
Knowledge
PyMuPDFMINEDU materials
SQLitechunks, chats
TF-IDF searchRAG, scikit-learn

Why · Local WiFi

Phones join the school’s own WiFi network, so no mobile data is used.

Results

internet needed in the classroom
0
internet needed in the classroom
primary grades supported
6
primary grades supported
run modes: local and cloud
2
run modes: local and cloud
automated tests (API, search, UI)
12
automated tests (API, search, UI)

What I would do next

  1. 01Build a small eval set per grade, reviewed by teachers, to measure answer quality
  2. 02Sync chat history to the cloud when a connection is available
  3. 03Pilot in one school and measure how often students come back