Building Offline AI tutors - boosting the next generation of African students

The Challenge

Infrastructural barriers such as intermittent electricity, and expensive, often inaccessible WiFi plagues many parts of Africa. This is especially true of my home country, Zimbabwe. While you can go to a good school, in an increasingly competitive world, you cannot afford to be steps behind - especially since advantages attained at a young age compound. The stakes are high; it is imperative for Africa to build talent that will build our continent into a technological and economic powerhouse.

The Solution

I’m building offline AI tutors to help resolve this problem. Each child aged 8 -18 would have access to a cost effective laptop preloaded with AI that is fine tuned to guide them in passing exams and learning foundational tech skills.

Picture Tendai, a self driven 15 year old hunched over his Funda AI laptop. While his classmates wait for weeks to write and have their mock exams marked in preparation for their exams, Tendai is having daily conversations with AI, writing multiple mock exams, getting feedback and getting tutorship from an AI that has learned to tailor its explanations to Tendai’s pace of learning.

The AI quickly learned that Tendai is struggling with trigonometry, and through their conversation, it’s adjusting its teaching style. Unlike a lot of traditional teachers and tutors, Funda AI will not grow frustrated or feel intimidated as Tendai continues to ask more questions. It will not tell Tendai he has no future out of a fit insecure rage or give sarcastic responses out of a bruised ego. The AI will patiently explain a concept until Tendai fully understands it, working at the pace Tendai sets.

This isn’t just about passing exams, it’s about nurturing curiosity, building critical thinking and deeper foundational skills and decoupling from this learning process reliance on an internet connection, saving costs and increasing accessibility.

As a starting point, I am building an MVP to test this concept and gather feedback to drive iterative improvements.This MVP involves taking an affordable well-refurbished Macbook Air, and fine-tuning an offline AI model to act as a tutor and getting it in front of my nephew - my beta tester. This blog walks through the core assumptions I am currently testing and the rationale behind each decision and progress. While I am currently focusing on the ~220k students going through the Cambridge curriculum in Africa, there is no reason this cannot be adapted to address the 20 million+ children who can realistically afford and benefit from Funda AI.

Doing the work

The cost of the laptop must be low enough to realistically be accessible. While the cost of the laptop is integral to accessibility, this must be balanced with other factors.

Intermittent electricity

Zimbabwe is a microcosm of issues plaguing many parts of Africa; 20+ hour power cuts are the norm, meaning the laptop must either have an impressive battery life or come with a solar charger. Throwing in working and quality solar charger increases costs

Running an AI Model

The laptop must have the computational capacity to run a model that can conceivably be trained for this task

Tailored to a real user’s needs

I am opting to use my nephew as my first user. The rationale is simple, to put It bluntly, I only care about helping people who are self-driven, I want a faster feedback loop and solving a problem closer to home adds more stake into things.

In reality I have two sets of users: the parent (my sister-in-law) and the child (my nephew). From our first few user interview; I gathered that:

  • The most immediate problem is using AI to generate mock exams and mark and review these

  • There needs to be a chat interface where children can use AI to tutor them on their curriculum and other books broadening their knowledge base (i.e. Teaching logic and foundational skills to build tech careers)

  • There is a need to sandbox their access to the internet, especially at younger ages, preventing access to inappropriate sites.

For a self-driven learner this builds a feedback loop accelerating the learning process. For the parent this offers an immediate and measurable value. My nephew’s school (Masiyephambili) offers tablets to kids priced at around $270 -$300. These are used to give kids books annually, presumably to counteract the cost of buying textbooks. AI usage isn’t actively encouraged, this is something kids learn on their own after school for their own research.

Current progress – Building the MVP

I opted to start off with a refurbished Macbook Air 2013 with 8GB Ram. The branding is rudimentary for the time being, but “Funda AI” is a play on the words “funda” (to learn), AI (because of its reliance on AI to facilitate the learning process) and “funda i” (learn something, for example “funda iMaths would translate to learn Maths).

No alt text provided for this image

Blocking off inappropriate sites - Parental control

I am running a customizable OS on the laptop; Linux Mint. I implemented a robust form of parental control through user privilege management, network filtering and system access restrictions to create a more controlled/sandboxed environment. In simple terms, unless the child has admin access they are blocked out of inappropriate sites; I’m using an updated database of blacklisted sites (think preventing access to adult content, extreme violence etc), they cannot uninstall important sites, cannot boot from an external drive (installing a new operating system) or run administrator commands to name a few restrictions.

I opted for this feature based off the conversation I had with my sister-in-law and just the general context I have from having been raised in a similar context – this is something I know a lot of parents care about.

Can a Llama 3.2 3B type model run on a 2013 8Gb Ram Macbook Air?

To ensure this can scale beyond just helping my nephew, it was integral to get at least a Llama 3.2 3B (or equivalent) model running. This is important because this directly impacts the cost considerations I raised previously. I successfully ran a Llama 3.2 3B. This alone wouldn’t suffice for what I needed. Let’s think about this, I would either have to;

i.) rely on the model out of the box to act as a tutor, using a combination of code, prompt engineering and structuring output to get my desired behavior (i.e. Generating exam questions etc.),

ii.) fine-tune the model to specialize in the tasks listed,

iii.) use RAG to enable the model to retrieve relevant information from books uploaded on the laptop (synced with an centralized cloud “library”),

iv.) most likely a combination of all of some of these.

It gets a little more technical – skip this part if you don’t care about following along with this

I didn’t want to worry about RAG, vector databases etc. I opted to use a tool that would enable this out the box. I initially thought of GPT4All. I encountered compatibility issues. I initially assumed these were dependency issues.

Since I could execute the llama model through a llama-cli I invoked, I knew that the llama.cpp binary was working so I didn’t have to worry about architecture/hardware incompatibility related to the model itself. llama-cli doesn’t depend on GPT4All’s abstraction layers, I narrowed down the issue to issues related to the installation of Kompute, a library necessary for backend inference. I resolved the initial set of errors when loading GPT4All and attempting to download a model by running GPT4All through a wrapper script with environment variables pointing to up to date versions of some dependencies required for Kompute. While this got GPT4All running and allowed me to download a model, I still couldn’t load it.

I ventured into running the model in a more isolated environment (think chroot and docker) – however, I got to a point where the time investment didn’t warrant the reward, resulting in me finding alternate options. I was also pushing my luck because:

To cut it short, I got the model running through a tool that would easily enable AI to read locally available documents

Next Steps

The current step involves setting up all the data required to fine tune the model and enable it to retrieve more accurate information from specific books (RAG). I am preparing thousands of past papers and marking schemas covering Cambridge exams for O, AS and A level for multiple subjects, books on philosophy, logic, programming, psychology, and other non-fiction books tailored at giving children a broader education and building critical thinking skills.

I will also be exploring other offline learning tools to augment the laptop with.

Subscribe to my blog to stay up to date with Funda AI