Sokomu: Speak the Language of Home
An offline-first hybrid AI tutor that teaches Yorùbá, Igbo, Hausa and Nigerian Pidgin down to the regional dialect and the tone, the way families actually speak them, with no data and no signal needed.
Overview
Sokomu is a hybrid AI language tutor, built for the web in Chrome, for four Nigerian languages. Learners pick a language, a real regional dialect and a real-life scene, such as greeting an elder in Ijebu Ode, bargaining at a market in Kano or riding a danfo in Lagos. They hear a spoken two-voice dialogue in that dialect, then practise with drills that run on their own device.
The cloud is used once, to synthesize each scenario's audio, which is then saved in the browser and replayed offline forever. The high-frequency practice (vocabulary quizzes and tone drills) runs on Gemini Nano inside Chrome, so it costs the learner no data and costs us no tokens. A visible badge shows, at every moment, whether an answer came from the learner's device or from the cloud.
The name blends So (Yorùbá: speak), Koya (Hausa: learn) and Muta (Igbo: learn).
The Problem
Picture a young woman who has studied Yorùbá for years. She walks into her grandmother's house in Ijebu and can't follow the conversation. She learned textbook Yorùbá, and the people she loves speak something richer and different.
Nigeria has over 500 languages, and younger people, at home and in the diaspora, are losing their regional dialects. Igbo in Onitsha doesn't sound like Igbo in Owerri, and Hausa changes from place to place. Most apps teach one flat standard and treat the rest as mistakes. Three more barriers make it worse:
- Tone changes meaning. In Yorùbá, one spelling can mean four different things:
| Written | Meaning | |---|---| | ọkọ | husband | | ọkọ̀ | vehicle | | ọ̀kọ̀ | spear | | oko | farm |
A text-only translator that drops the marks teaches the wrong word.
- Data is expensive and signal drops. An AI tutor that needs the internet for every practice sentence fails learners on the days they have the least.
- Existing options miss the target. Live tutoring is priced per session, flashcard apps teach no tone or dialect, and school-focused apps aim at exams rather than conversation.
The Solution
Sokomu teaches how people really speak and keeps working when the network doesn't.
- Your language, your dialect, your moment. Choose Yorùbá, Igbo, Hausa or Nigerian Pidgin, then one of 8 regional dialects, then a goal such as greeting elders, the market, family or transport. 8 scenarios and 84 glossary entries ship in the app.
- Hear real dialogues. Two-speaker audio in the chosen dialect, synthesized once and saved for offline replay.
- Practise with zero data. On Gemini Nano, drills run on the device. Switch on Airplane Mode and the quiz keeps going. On devices that can't run Nano, saved audio still replays and a deterministic quiz still works from the saved glossary.
- Tone is a graded skill. A diacritic picker lets learners type the marks. Grading compares what they wrote against verified glossary entries, then explains the mistake in plain terms, such as "You wrote vehicle. The elder heard car, not husband."
- Honest by design. An inference-source pill shows ON-DEVICE or IN-CLOUD for every response, and a counter shows the mobile data and Naira each learner has saved.
- Respectful progress. Learners earn regional dialect stamps on a cultural map of Nigeria. There are no hearts, lives or streak punishments.
- Taught by native speakers. A Native Trainer Portal lets speakers submit words with tone patterns, even offline. Entries need review by a second trainer before they count as verified, and nobody can approve their own.
AI Implementation
Sokomu is a hybrid-first design. On-device inference is the primary path, and the cloud handles only what the cloud does best.
| Layer | What it does | Where it runs |
|---|---|---|
| Interactive drills | Vocabulary quizzes and tone drills with structured JSON output, grounded in cached glossary entries, plus diacritic and grammar feedback | On-device, Gemini Nano in Chrome (Prompt API), reached through Firebase AI Logic |
| Cloud fallback | Handles requests when the device can't run Nano, or when a deeper cultural explanation is needed; uses gemini-3.5-flash-lite with a per-device daily cap | Cloud, via Firebase AI Logic |
| Dialect audio | Natural two-speaker dialogue, streamed as 24 kHz PCM into the Web Audio API with no middleman server | Cloud, gemini-3.1-flash-tts-preview, once per scenario |
| Audio and lesson cache | Audio, scenarios and glossary are saved so lessons replay offline | IndexedDB plus a service worker for the app shell |
| Tone grading | A deterministic Unicode-normalized comparison is the ground truth; Nano only adds the explanation | On-device |
| Dynamic prompts and rules | Dialect rules, prompt templates, model names and feature flags change without redeploying | Firebase Remote Config |
Retrieval grounding. Before Nano writes a quiz or feedback, the app selects the relevant verified glossary entries and dialect rules and puts them in the prompt. This keeps a small on-device model accurate in languages that large models often get wrong.
Design decision. Tone grading is deterministic, and the model only enriches the feedback. We did this so a small quantized model can never mark a correct tone wrong.
Where it runs, and why it matters. More than 80% of interactions are designed to run on-device, which keeps marginal cost near zero and learners' data bills low.
Responsible AI and Real-World Impact
Responsible use
- Transparency: the telemetry pill reads straight from the SDK's reported inference source. We even fixed a bug where the app claimed Gemini Nano when it hadn't actually run.
- Human-verified knowledge: dialect content comes from native speakers, and trainer submissions need independent peer approval, with self-approval blocked.
- Deterministic guardrails: tone grading never depends on a model's guess.
- Abuse and cost protection: Firebase App Check (reCAPTCHA Enterprise) guards the AI and database endpoints. Remote Config kill switches and daily caps can halt cloud fallback or TTS instantly, and budget alerts are set at 5, 15 and 30 USD.
- Privacy: drills run on the learner's device, and no voice is recorded.
- Respect for dialects: regional speech is the organizing unit of every lesson, not an error to correct toward a standard.
Impact
- Helps diaspora families and young Nigerians reconnect with the dialect their grandparents speak.
- Removes the data barrier: after the one-time audio download, practice costs nothing and works in Airplane Mode.
- Gives native speakers a structured, credited way to preserve words and tone patterns that are disappearing.
- Points toward schools, where mother-tongue instruction is short of trained teachers and textbooks.
Challenges We Ran Into
- On-device AI needs capable hardware. Gemini Nano in Chrome needs a recent browser, plenty of RAM and tens of gigabytes of free storage. We built readiness detection, a download-progress banner and an automatic cloud fallback so every learner still gets a working path.
- Small marks change meaning. Models sometimes drop dots and accents in Yorùbá, Igbo and Hausa. Verified glossary grounding and deterministic tone comparison fixed this.
- Being honest about what ran. Showing whether an answer truly came from the device or the cloud meant binding the UI to the SDK's real source and fixing a case where it overstated.
- Designing for offline from day one. Caching, queued writes and idempotent sync had to be planned at the start, not added at the end.
Accomplishments We're Proud Of
- A full Airplane Mode study session: structured drills keep running on-device with no network requests.
- Natural two-speaker dialect audio, synthesized once and replayed offline forever.
- A live telemetry pill and a data-saved counter that show learners the truth about their practice.
- A Native Trainer Portal with offline submissions and peer review.
- A production-minded backend: App Check, Firestore security rules with tests, Remote Config live updates and budget guardrails.
What We Learned
- Offline use is a core feature for the people we're building for, and it has to be planned from day one.
- A small on-device model does far better in these languages when grounded in local, verified knowledge than when it guesses.
- Hybrid AI is the pedagogy, not decoration: drills need instant, private repetition, and natural voices need the cloud.
- A language app is only as good as the community that shapes it.
What's Next
- Speaking practice, so learners can say a phrase aloud and get feedback.
- Native mobile apps, so on-device AI reaches phones.
- More languages and dialects, including Tiv, Efik, Ibibio, Kanuri, Edo and Fulfulde, with schools and diaspora families helping shape each lesson.
- Shared pre-synthesized audio, so each scenario is synthesized once for everyone instead of once per device.
- A school dashboard with tonal accuracy reports per student.
Built With
- AI: Gemini Nano (Chrome built-in AI / Prompt API), Gemini 3.1 Flash TTS Preview, Gemini 3.5 Flash Lite, Firebase AI Logic
- Firebase: Authentication (anonymous and Google), Cloud Firestore, Remote Config, App Check with reCAPTCHA Enterprise
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS v4, Bun, lucide-react
- Offline and audio: IndexedDB (idb), service worker, Web Audio API
- Design: Plus Jakarta Sans, Inter
Try It Out
- Source code and setup: https://github.com/codewithemmax/sokomu (Apache 2.0 licensed; the README covers Bun setup and the Chrome flags for Gemini Nano)
Built With
- bun
- chrome-built-in-ai
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-auth
- firestore
- gemini
- gemini-nano
- generative-ai
- google-ai
- indexeddb
- low-resource-languages
- natural-language-processing
- nextjs
- offline-first
- on-device-ai
- rag
- react
- tailwindcss
- text-to-speech
- typescript

