Home / use case

Flash: a local AI agent that turns 'Teach me C' into graded lessons

At a glance
Key gotcha
Small models take the shortest path through a schema, returning lessons with no exercises or repeating the first unit under new titles.

What they built

Flash is the author's AI agent, which runs on a laptop with local models. Typing "Teach me C" now builds a path of lessons in the chat instead of a long lecture, each with a few short paragraphs and something to do: pick an answer, fill in a blank, reorder steps or write real code.

Code answers are compiled and run in a throwaway folder, and Flash compares the printed output to what was expected, showing compiler errors or the two outputs side by side when you get it wrong. It covers C, C++, Python, JavaScript, Rust, Go, Java and Linux shell, with XP, a daily streak and spaced repetition.

The rule behind it is that the model writes the course but does not grade it. The model only comes back when you press Ask Flash, and then it is told to give a hint, never the answer.

Setup

  • Flash, an open-source agent on GitHub (Natuworkguy/Flash), running on a laptop with local models
  • 34 built-in guides on using its own tools, with 116 example tool calls checked by tests

How it works

  1. Every answer is marked on the page with zero model calls, which keeps checking instant on local models.
  2. Each answer updates an estimate of whether you know the material, and lessons come back after 1, 2, 4 and 8 days, or the next day if you got them wrong.
  3. When a small model returns a unit with nothing to answer, the tool call is rejected with a clear message telling it every step needs a quiz, blank, order or exercise.

Results & numbers

  • The author reports 40 commits in three days with 2,955 tests passing, and says everything runs on your own machine.
  • A test that checks every example tool call against the live tool definitions caught two broken examples on its first run.

Gotchas

  • Small models take the shortest path through a schema, returning lessons with no exercises or repeating the first unit under new titles.
  • Pages of instructions did not fix that; a rejected tool call with a clear error message did.
“The model writes the course. It doesn't get to grade it.”— Nathan C.

Do it yourself

  1. Have the local model generate lessons as structured steps, each with an exercise type.
  2. Validate the output and reject any unit whose steps have nothing to answer, with a specific error message.
  3. Grade exercises with code: compile and run submitted code in a temporary folder and compare its output.
  4. Call the model again only when the learner asks for a hint, and instruct it not to give the answer.
  5. Schedule reviews with spaced repetition based on right and wrong answers.
Source: Nathan C. (DEV Community) · Published 2026-10-29 · Added 2026-10-29. This write-up summarizes the original source; see it for full details.

Similar setups

rip: a local Gemma 2 2B writes epitaphs and revival ideas for your abandoned side projects

A Hacktoberfest CLI scans your folders for dormant projects and has Gemma 2 2B on Ollama write a witty obituary and a suggestion to revive each one, sending only metadata, never code.

razorbill (DEV Community) · 2026-11-03

A self-hosted llama.cpp endpoint on three 16 GB GPUs with presets.ini and Docker

Theo Dufort shares the Compose file and 60-line presets.ini behind his private OpenAI-compatible endpoint: a 27B coding model at 132K context and a 26B MoE chat model.

Theo Dufort (blog) · 2026-11-28

A private OpenAI-compatible LLM API on an AMD GPU with llama.cpp

A Vietnamese developer's notes on building llama.cpp for AMD cards, choosing between Vulkan and ROCm, and running llama-server as a locked-down systemd service that existing OpenAI SDK code can call.

DEV Community (EME GUG) · 2026-11-27

Getting OpenCode to work with a local Ollama model by fixing the 4,096-token context

OpenCode on a local Ollama model ignored files, invented tasks or looped, because each ~23k-token request was silently cut to fit Ollama's default 4,096-token context on a 16 GB GPU.

DEV Community (Davidrs) · 2026-11-27