-
-
English Q&A — in-scope (Algorithms)
-
English practice question
-
English Q&A — in-scope (Data Structures)
-
Out of scope (programming topics)
-
Shona practice questions
-
Shona Q&A — in-scope, different topic
-
Shona Q&A — in-scope, different topic
-
Shona Q&A — in-scope, different topic
-
Shona practice questions
-
Shona out of scope question
Inspiration
l grew up in Gokwe North, a rural community in Zimbabwe where reliable internet and paid AI subscriptions are not a given. Meanwhile, most AI coding tutors assume both, and assume you're comfortable learning technical concepts in English, with no local-language support at all.
l wanted to build the tool I wish had existed: a coding tutor that works entirely offline, on a laptop many students and schools can actually afford, and that can explain concepts in Shona as well as English. When I saw the Africa Deep Tech Challenge's Laptop LLM track, specifically built for the hardware Africa actually has, it was the right problem at the right time.
What it does
The Offline Shona AI Coding Tutor teaches foundational Python and computer science: variables, control flow, functions, data structures, algorithms, and debugging through two modes:
- Ask a question and get a grounded explanation in English or Shona.
- Get practice questions on a topic to test understanding, also in either language.
Everything runs 100% offline: no internet connection, no API costs, no cloud dependency. It's built on a small quantized language model (Gemma-2-2b-it) combined with retrieval-augmented generation (RAG) over a curated 58-topic CS syllabus we wrote ourselves, in both English and Shona.
How we built it
We used a retrieval-augmented generation (RAG) architecture rather than fine-tuning:
- Retrieval:
sentence-transformers(all-MiniLM-L6-v2) embeds student questions and matches them against our syllabus using FAISS - Generation: Gemma-2-2b-it, quantized to GGUF Q4_K_M, runs locally via
llama.cpp; no GPU required - Bilingual layer: English responses are generated live by the model using retrieved context; Shona responses are curated and human-verified, returned directly rather than generated
We chose RAG specifically because it lets a small, general-purpose model behave like a scoped CS tutor without the GPU time and training data that fine-tuning would require, which simply isn't realistic on an 8GB laptop.
Challenges we ran into
Shona generation was unreliable. Early on, we asked the model to generate Shona explanations freely and got fluent-looking but largely incoherent output. Testing confirmed Phi-3.5-mini (our first model choice) simply hadn't seen enough Shona text during training. Rather than ship broken output, we redesigned the system: all Shona content is curated and verified by us, retrieved directly rather than generated. This was a real pivot, not a minor tweak, but it made the difference between a tutor that's honestly bilingual versus one that only looks bilingual.
Shona question input has real limits, and we characterized them precisely. We tested whether students could ask questions in Shona and found a clear pattern: fully Shona questions with no English technical term don't reliably match our syllabus (embedding similarity as low as 0.15), but code-switched questions with Shona sentence structure with an embedded English term, like "Chii chinonzi for loop," match correctly. This turned out to reflect how many Zimbabwean students actually talk about programming in practice, so rather than a shortfall, it became a real, defensible finding we documented rather than hid.
Speed needed real engineering, not guessing. Our first model (Phi-3.5-mini, 3.8B params) ran at ~6.8 tokens/sec. We tested thread counts (4 vs 8 of 12 available cores) and found negligible difference, confirming the bottleneck was compute-bound, not thread-limited. We then benchmarked a smaller model, Gemma-2-2b-it, and got a genuine 42% speed improvement (9.67 tokens/sec) alongside 31% less RAM usage, with no quality regression in our testing. That became our final model.
Getting the pipeline itself right. Along the way, we tuned a similarity-distance threshold so the tutor gives an honest "I don't cover this yet" instead of confidently answering with the wrong topic, validated against exact matches, paraphrased matches, and clearly off-topic questions.
What we learned
- RAG is genuinely the right tool for this constraint set; it lets us get a capable, scoped tutor running on modest hardware without needing to train anything
- Being honest about a model's limitations (Shona generation) and designing around them produces a better, more trustworthy product than trying to paper over the gap
- Empirical model comparison beats guessing: the switch from Phi-3.5-mini to Gemma-2-2b-it was a real, measured decision, not an assumption
- Precise, tested claims ("code-switched Shona works, pure Shona doesn't") are more credible and more useful than vague ones ("supports Shona")
What's next
- Expanding the curated syllabus beyond the current 21 core topics
- Exploring a lightweight Shona-keyword mapping layer to improve pure-Shona question matching
- A simple GUI, since the tutor currently runs as a command-line tool


Log in or sign up for Devpost to join the conversation.