This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
A friend of mine is prepping for JEE and keeps hitting the same problem — she's studying somewhere with spotty internet, and every "AI study helper" out there needs a connection and usually a subscription. So I built LearnCLI: a tiny terminal tool that explains a topic and throws a practice question back at you, running fully offline.
You type a topic, it thinks for a few seconds, and it gives you a plain-text explanation plus one question to test yourself with. No account, no internet, no API bill.
The twist is I didn't have a laptop while building this. I did the entire thing on my phone, in Termux.
Demo
(this is a real run asking it to explain Newton's third law)
Code
Repo: https://github.com/krvnium/LearnCLI
How I Built It
Everything runs through llama.cpp, compiled straight from source inside Termux on my Poco M4 Pro. No GPU, no cloud box, just phone CPU.
For the model, I went with Gemma 3 1B, quantized down to Q4_K_M (~800MB), small enough that it actually runs at a usable speed on a phone.
The script itself is plain Python, calling the compiled llama-cli binary and cleaning up its output — stripping markdown symbols the model likes to throw in, cutting off a marker token I use internally to separate the prompt from the actual answer, and wrapping everything in a little terminal UI so it feels less like a raw model dump and more like an actual tool.
Build process, roughly:
-
pkg installthe usual suspects (clang, cmake, git, python) in Termux - clone and compile llama.cpp natively on-device
- pull the Gemma GGUF from Hugging Face
- write the Python wrapper around it
Why Does Open Innovation Matter?
This only works because the model weights and the inference engine are both open. Gemma being open-weight means I can download it once and run it forever, no API key, no per-request cost, no "service unavailable" when my friend's hostel wifi dies at 11pm before an exam. llama.cpp being open-source is the other half — it's what let me actually get a transformer model running on a phone's CPU without needing anyone's permission or infrastructure.
A closed API would've meant my friend needs internet every single time she wants to use this, and I'd be the one paying for her queries. With this, I built it once, and it just works, offline, for free, for as long as the phone has battery.

Top comments (0)