This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
I built AI English Buddy for a friend of mine who is currently improving their English. Grammar is the hard part: they often write a sentence that feels right but isn't, and a corrected version alone doesn't help because they still don't know why it was wrong.
I wanted something they could use any time, without paying for a subscription or worrying about someone reading their mistakes. So the app takes any sentence they type and gives back the corrected version, a short explanation in simple words, a more natural way to say it, and one new example using the same rule.
- Grammar check: tells them if the sentence is correct and gives the fixed version
- Explain my mistake: a short explanation in simple words
- Better version: a more natural, fluent way to say the same thing
- Example: a fresh sentence using the same grammar rule
You: I am go to university yesterday.
Buddy: ❌ Your sentence needs correction.
✅ I went to university yesterday.
💡 "Yesterday" talks about the past, so use "went", not "go".
Demo
I shared the app with my friend and asked for honest feedback. Here is what they said:
"Great work! This is a really nice and useful project for learning English. I especially like how it doesn't just correct the sentence, but also explains the mistake and gives a better version and an example. The interface is simple and easy to understand.
I also really like the idea of running it locally with Gemma via Ollama, because it keeps the user's sentences private and doesn't require a subscription."
They also suggested what to add next: vocabulary suggestions, pronunciation practice, and a history of previous corrections.
What's Next
My friend's feedback gave me a clear list to build on:
- Correction history: save previous sentences and fixes so they can review their common mistakes
- Vocabulary suggestions: suggest richer words for the same idea
- Pronunciation practice: let them hear and practice the corrected sentence
Code
Hasalawa
/
ai-english-practice-buddy
An AI English practice buddy built for a friend learning English. Type a sentence and get a correction, a simple explanation, a more natural version, and an example. Runs privately with Google's open-weight Gemma model via Ollama, using a Flask backend and plain HTML/CSS/JS frontend.
AI English Practice Buddy
An AI-powered English practice tool built for my friend, who is improving their English.
Features
- Grammar check – type a sentence, get the corrected version
- Explain my mistake – a short, simple explanation of why
- Better version – a more natural way to say it, plus an example sentence
AI
Uses the open-weight Gemma model (gemma3:1b) running locally through Ollama.
Why open models? Sentences stay on your laptop (privacy), there is no API cost, and you can swap the model with one env var.
Tech stack
HTML · CSS · JavaScript · Python (Flask) · Ollama · Gemma
Run it
# 1. Install Ollama (https://ollama.com) and pull the model
ollama pull gemma3:1b
# 2. Install and start the app
pip install -r requirements.txt
python app.py
Optional env vars: OLLAMA_MODEL (default gemma3:1b), OLLAMA_URL.
How it works
Browser -> POST /check…How I Built It
The AI at the core is Gemma (gemma3:1b), Google's open-weight model, running locally through Ollama. Nothing is sent to an external AI API.
Browser -> POST /check -> Flask -> Ollama -> Gemma -> JSON -> Browser
- Frontend: a single page in plain HTML, CSS and JavaScript. No framework, no login, no database.
-
Backend: a small Flask app with one endpoint,
POST /check. It validates the input (non-empty, max 500 characters) and calls Ollama's chat API. -
Prompting: a system prompt makes Gemma act as a patient English teacher and reply only as JSON with
is_correct,corrected,explanation,exampleandbetter. Ollama'sformat: "json"option plus a low temperature (0.2) keeps the output consistent, so the UI can render each part separately. - Error handling: if Ollama isn't running, the app says so instead of crashing (503). If the model returns something unparseable, the user gets a friendly retry message (502).
- Tests and CI: pytest tests cover the endpoint, with the Ollama call mocked. A GitHub Actions workflow runs the linter (ruff) and the tests on every push, so CI doesn't need a model at all.
The biggest challenge was that a 1B model is small, and a small model can easily ignore formatting instructions. My UI needs the correction, the explanation, the example and the better version as separate pieces, so a free-form reply wouldn't work. I solved this in three ways: asking Ollama for JSON output, keeping the temperature low (0.2) so the answers stay stable, and writing the backend so that a broken or unparseable reply gives the user a friendly "please try again" message instead of crashing the page. Because the model can't run in CI, my tests mock the Ollama call, so they check that the app handles good and bad replies, but not how good the grammar advice is. For that, the real test is my friend using it.
Why Does Open Innovation Matter?
This is the part that made me choose an open model instead of a hosted API:
- Privacy: practice sentences are personal, and sometimes embarrassing. With a local model they never leave my friend's laptop.
- Works offline, costs nothing: no API key, no per-request bill, no internet needed once the model is downloaded. That matters for a learner who just wants to practice anywhere.
-
Swappable: the model is one environment variable (
OLLAMA_MODEL). If a bigger Gemma, or a different open model, handles grammar better, it's a one-line change and no code rewrite. - Tunable for one person: because I control the prompt and the model, I can shape the "teacher" around exactly what this friend struggles with, instead of settling for a generic product.
A closed API could probably give better corrections out of the box, but it couldn't have given me all of the above for a tool built for one friend.
Prize Categories
Best Use of Gemma: the whole app is built around Gemma 3 running locally via Ollama.

Top comments (0)