DEV Community

Cover image for poligem: a Polish conversation tutor that runs entirely on your own laptop
Dariusz Dumnicki
Dariusz Dumnicki

Posted on Fully Autonomous

poligem: a Polish conversation tutor that runs entirely on your own laptop

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

poligem is a Polish conversation practice app that runs entirely on your own laptop. The conversation core is Gemma 3 (4B), an open-weight model served locally through Ollama. No account, no API key, no subscription — and no data leaving the computer.
I've built it for my girlfriend who has recently started learning Polish. Since the app uses a locally served, open-weight model, she can practice even on the airplane when there's no wifi.

Poligem app has three parts.

Chat that starts with a situation. Most language apps open with "what would you like to talk about?", which is a hard question when you're a beginner — you don't have the vocabulary to answer it yet. poligem's tutor picks a scene and puts you inside it:

Ćwiczmy. Wyobraź sobie, że jesteś w kawiarni, a kelner podchodzi i mówi: „Dzień dobry, co podać?" — co odpowiesz?
example cafe scenario

It stays in character and asks one natural follow-up at a time.

When you don't understand. A beginner hits an unfamiliar word and stalls. poligem gives you an EN button under any sentence for an English translation. This is the feature that my girlfriend finds particularly useful. Since the translation is hidden at first, it makes her read the polish sentence first before reading the translation.

Exercises that adapt to you. Three drill types — translate English→Polish, translate Polish→English, and fill-the-gap — with a level (A1/A2/B1) derived from your measured accuracy rather than a dropdown you set once and forget. Missed prompts feed back into generation, so exercises target your weak spots instead of repeating one difficulty.

Demo

Code

GitHub logo dumnicki / poligem

Poligem - an app for Polish language practice

poligem

A Polish conversation practice app that runs entirely on your own machine.

poligem pairs a free chat tutor with structured drills for Polish learners The conversation core is Gemma 3 (4B) running locally through Ollama — no accounts, no API keys, no data leaving your laptop.


Why it runs locally

Polish learners are often self-studying, which means:

  • The conversation is private. Every sentence you type — including mistakes and often your name, your work, your partner — stays on your machine. Nothing is sent to a third party.
  • It is free. Ollama and Gemma 3 carry no per-token cost, so the app is not gated behind a subscription and does not degrade after a trial period.
  • The tutor is a file, not a service. The entire teaching personality — level handling, scenario framing, correction style, translation behaviour — lives in server/prompt.ts. Changing how poligem teaches Polish is editing…

How I Built It

Gemma 3 (4B) is not one component among several — it is the application. It writes every line the tutor says, generates every exercise, and drives its own difficulty adjustment based on how you perform. Nothing in the app is a canned response from a lookup table.

It's served locally via Ollama and reached through an Express proxy. The proxy looks redundant since Ollama's CORS is permissive, but it earns its place: the client never depends on Ollama's API contract, so the model can be swapped without touching the frontend, and it gives one place to inject the tutor's system prompt.

Two decisions came directly from watching a 4B model fail:

Exercises are pre-generated into a pool. Generating them takes ~35 seconds on CPU, which is unacceptable mid-lesson. So the server keeps three of each type ready in memory and refills in the background. Handing you an exercise is an array shift, not a model call: 45–167 ms measured. If Ollama is down, curated exercises are served instead, rotating so nothing repeats — the app never dead-ends.

Cloze blanks are applied by the server. Asked to remove a word from a Polish sentence, Gemma reliably returns a complete sentence and sometimes inserts its own blank — producing sentences with two gaps and an answer that matched neither. Rather than trust the prompt, the server locates the answer word and blanks it deterministically. Refills also generate in batches of three, because asking for a single exercise measurably degraded output into fragments.

Everything goes through a single request queue: a 4B model on CPU doesn't run two requests in parallel, they interleave and both slow down, and a background refill would otherwise stall your conversation.

Why Does Open Innovation Matter?

Running a small open-weight model locally rather than calling a closed API is what made this app honest to its own premise:

  • The data stays on the machine. Every sentence typed — including the mistakes, which are the most revealing thing you produce — never leaves the laptop. A closed API can't offer that at any price.
  • It's free, permanently. No token bill, no trial expiring mid-course, no feature degrading once credits run out. For a practice tool you use daily, that changes who can use it.
  • It works offline. Once the model is pulled, practice works on a plane or on a machine that has never seen a wifi network.
  • The tutor is a file. The entire teaching personality — level handling, scenario framing, correction style, translation behaviour — lives in server/prompt.ts. Changing how poligem teaches Polish is editing one file and restarting. There's no prompt-injection surface from a shared endpoint, and no vendor silently changing the model underneath you.
  • It's tunable by the learner. Swap the model, adjust the level, add your own vocabulary. A closed API gives you none of that.

Everything interesting in this project is a consequence of the small open model rather than a feature bolted onto a commercial one.

Prize Categories

Best Use of Gemma (featured) — Gemma 3 generates the tutor's dialogue, creates every exercise, and adapts its own difficulty. It is the core of the product, not an add-on.


Built with Gemma 3 by Google, served locally via Ollama. Drafted with AI assistance and verified by hand.

Top comments (0)