DEV Community

Shubham Kondekar
Shubham Kondekar

Posted on

DeadZone Drill: offline flashcards that only work when you walk away from the internet

The pitch in one sentence

DeadZone Drill turns your study notes into a spoken flashcard drill you run on a walk, with a local open-weight model writing and grading the cards — no account, no API key, no internet.

The problem I actually had

I revise with flashcards, and flashcards are a screen activity: sit down, stare at a card, tap "again". Studies on recall and the challenge's own framing kept pointing the same direction — I learn better when I'm moving, and I sit too much. The best moments of my last study session weren't at the desk at all. They were on a walk where I was muttering answers to myself.

So I stopped trying to make the desk better and made the walk the study session. DeadZone Drill is the tool I wanted: it talks, I answer out loud, and the screen stays in my pocket.

Demo

$ python3 -m drill build notes.md --deck foliage
Added 12 card(s) to deck 'foliage' (source: gemma).

$ python3 -m drill walk --deck foliage
TTS engine: macOS say (default voice)
----------------------------------------------------
  12 card(s) due. Answer out loud, then grade yourself.
----------------------------------------------------
[1/12] deck=foliage box=1
Listening to the question...
> "What is the primary trigger for autumn colour?"
Recall it, then press Enter to hear the answer...
A: Day length
Did you know it? [y/N, q to quit] y
...
----------------------------------------------------
  Reviewed 12 card(s). 9 correct (75%).
  Session over. Get outside.
Enter fullscreen mode Exit fullscreen mode

How it works

Everything that matters runs on the machine. The only network call is to localhost.

flowchart LR
    A["Your notes<br/>(.md / .txt)"] --> B["Gemma 3 via Ollama<br/>local, offline"]
    B --> C["Q/A cards<br/>SQLite + Leitner schedule"]
    C --> D{"Walk mode"}
    D -->|"speak question"| E["macOS say / Piper<br/>offline TTS"]
    E --> F["You answer<br/>out loud"]
    F --> G{"grade"}
    G -->|"typed / spoken"| H["Gemma grades<br/>local"]
    G -->|"self-grade"| I["one keypress"]
    H --> C
    I --> C

Pipeline:

  1. Generate — drill build notes.md sends your notes to a local Gemma 3 (via Ollama) with a strict prompt and asks for JSON flashcards. If no model is running, a dependency-free cloze generator still produces a usable deck.
  2. Recall — drill walk pulls the cards due today and speaks each question with offline TTS.
  3. Grade — answer out loud and self-grade with one keypress, type it for model grading, or speak it if you have a local Whisper build.
  4. Schedule — a small Leitner scheduler moves the card to the next box and sets the next review date in SQLite.

The whole thing is standard-library Python. pip install is not required; the Ollama client is 60 lines of urllib.

Why open matters here (not as a slogan — as a requirement)

The theme asks me to build something that gets people off the screen and into the world. The open pieces aren't decoration; they're the reason the product works:

  • It works with no internet, because the model is local. Card generation, text-to-speech, grading, and scheduling all run on-device. Airplane mode is a supported configuration, not a degraded one. A closed API would have made "study on a trail with no signal" impossible — which is exactly the scenario the app exists for. To prove it, drill prerender writes all question audio to disk so a walk needs zero synthesis work in the moment.
  • My notes stay mine. Lecture notes, personal study material, and every review I've ever done live in a SQLite file in ~/.deadzone-drill. There is no upload step to remember to disable, and no server holding what I'm weakest at. This is the "keep someone's data off a server they don't control" clause of the prompt, made concrete.
  • The brain is swappable. Any Ollama model works. I developed against one model and changed one environment variable to run Gemma. No vendor migration, no rate limits, no deprecation notice.
  • It costs nothing to run. There's no token meter between me and my own revision. I can drill 10 cards or 10,000 and the cost is identical: zero.
  • The open tools let the edges degrade and still work. When Whisper isn't installed, the app doesn't break — it falls back to self-grading. When no model is running, it falls back to cloze cards and token-overlap grading. Open, composable pieces made graceful degradation cheap to build.

I'm not claiming a local 4B model out-writes GPT-5 at flashcard creation. I am claiming that the fraction of usefulness that requires the internet was zero, and that's the whole point.

Built with

  • Gemma 3 (via Ollama) — the open-weight model that writes and grades cards
  • Python standard library — no runtime dependencies
  • macOS say, with Piper as a pluggable open-weight TTS engine
  • whisper.cpp / faster-whisper — optional offline speech-to-text
  • SQLite — local card storage and review schedule

What was hard

  • Grading free-form recall without a cloud service. Exact string matching punishes correct answers phrased differently. I solved it in two layers: a local model judges paraphrase and partial credit, and a token-overlap heuristic catches the case where no model is available.
  • Making "offline" real instead of aspirational. Pre-rendering audio and testing with the network off forced every hidden assumption into the open.

Try it

git clone https://github.com/kondekarshubham123/deadline-drill deadzone-drill
cd deadzone-drill

# optional: local model
ollama pull gemma3:4b

python3 -m drill sample               # seed a demo deck (works offline)
python3 -m drill walk --deck sample   # drill it

# or use your own notes
python3 -m drill build notes.md --deck mine
python3 -m drill walk --deck mine
Enter fullscreen mode Exit fullscreen mode

What's next

  • Optional spoken answers with a bundled Whisper build so the loop is fully hands-free
  • Deck export/import for sharing a good set of cards
  • A "grass streak" that tracks how many days you studied outside rather than how many cards you ground through

Built for the Hacktoberfest Open-Source AI Challenge, Week 1 (Touch Grass). If you try it, take it somewhere with no signal — that's where it's happiest.

Top comments (0)