DEV Community

Xenover !
Xenover !

Posted on

Apex — Learn Cybersecurity, AI and Programming Offline, in the Language You Actually Speak

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

This week's theme is "Touch Grass": build something with open-source AI that gets people off the screen and into the world. I'll be honest — Apex won't drag you onto a hiking trail. But it does something the theme quietly asks for: it works where the trail is.

Most AI learning tools die the moment you lose signal. Apex is an offline AI teacher that runs entirely on your own laptop — no internet, no cloud, no subscription. On a bus through the countryside, in a village with patchy coverage, in a park on your lunch break: it teaches exactly the same. And the things it teaches — spotting QR-code scams on restaurant tables, staying safe on public WiFi at cafes and stations, not broadcasting your live location to strangers — are the skills you need precisely when you're out in the world, phone in hand.

So I built Apex: an offline AI teacher for cybersecurity, AI, and programming, in the language people here actually speak.

What I built

Apex is a small web app (Python + Flask backend, vanilla HTML/CSS/JS frontend) with a ChatGPT-style interface. Everything is stored locally; there is no account, no signup, no external API call. After a one-time model download, it works with the WiFi off — I tested it.

Chat — three subjects, three languages. Pick Cybersecurity, AI, or Programming, and ask anything. Each subject has its own teacher persona, and everything works in English, Roman Urdu (the default — the language people here actually text in), and اردو. The cybersecurity teacher has one hard rule: it only teaches defense. Ask it how to hack something and it refuses.

Quiz. Five model-generated multiple-choice questions per round, drawn from the active subject — phishing and 2FA for cybersecurity, LLMs and prompting for AI, loops and functions for programming. Score plus a plain explanation for every answer. If the model ever returns broken JSON, a built-in backup question bank keeps the round running.

Practice — a different mode per subject. Cybersecurity gets Attack Scenarios: five real situations from life here — the "Mubarak ho, aap 500,000 jeet gaye" SMS, the "bank" calling for your OTP, the free public WiFi, the found USB stick, the hijacked WhatsApp account asking for money. Programming gets Code Challenge: the model shows you a short buggy Python snippet and you find the bug. AI gets Prompt Lab: you write a prompt for a given task, and the teacher scores it out of 10 and shows you a better version.

Learning Paths — the real core. A structured curriculum of 40 topics: 14 for cybersecurity, 12 for AI, 14 for programming, each from Beginner to Advanced. Click a topic and the teacher streams a full lesson — simple explanation, practical example, one checking question — right in the chat. Mark it complete, watch the progress bar fill.

The rest: a Daily Challenge (one fresh question every day, tied to your streak), a downloadable Certificate when you finish a whole learning path, XP/levels/streaks for gamification, a model switcher (Gemma 2-2B by default; any Ollama model works), white/black/system themes, and local chat history.

Who it's for

People who get scammed the most are the ones tech advice never reaches — not because they're careless, but because the advice is in English, on platforms that harvest their data to serve it. In Pakistan, the "bank" calls asking for OTPs and the fake prize SMSes don't target engineers. They target everyone else. Those people don't need another English blog post. They need a teacher who speaks Roman Urdu, answers without judgment, and doesn't send their questions — "is this SMS a scam?", asked by someone who barely understands phishing — to a server on another continent.

Demo




Code

GitHub logo xenover09 / Apex

APEX — offline AI teacher software for your PC. Learn cybersecurity, AI & programming in English, Roman Urdu or اردو. 100% private: runs fully offline on your own machine via Ollama + Gemma 2-2B. No internet, no cloud, no subscription.

APEX — Your offline AI teacher

Apex is an offline AI teacher designed to make learning accessible, secure, and private. It provides interactive education across Cybersecurity, Artificial Intelligence, and Programming in three languages (English, Roman Urdu, and اردو). Powered by Ollama and the Gemma 2-2B open-weight model, Apex operates 100% locally on your machine without needing an internet connection.

Features

  • Chat (3 Subjects): Specialized AI personas for Cybersecurity, AI, and Programming.
  • Quiz: Dynamic, model-generated multiple-choice questions tailored to the active subject.
  • Practice Modes
    • Attack Scenarios (Cybersecurity)
    • Code Challenge (Programming)
    • Prompt Lab (AI)
  • Learning Paths: Structured curriculum with 40 interactive topics.
  • Daily Challenge: A unique daily question to test your knowledge.
  • Certificate: Downloadable completion certificate upon finishing a subject's learning path.
  • Model Switcher: Easily switch between supported local models directly in the app.
  • Gamification: Earn XP, build your daily streak, and level up…

How I Built It

The AI core is Gemma 2-2B, Google's open-weight model, running entirely on the user's machine through Ollama (http://localhost:11434). The Flask backend sends each message to the local model with a fixed system prompt that locks the persona per subject and language: friendly teacher, short practical answers, defense-only for cybersecurity, code examples in blocks for programming. Streaming responses come straight from the local model.

Quiz questions are generated as JSON with a local fallback bank; cybersecurity scenarios live in scenarios.json; the 40-topic curriculum lives in learning-paths.json. Progress, streaks, XP, settings, and chat history all live in the browser's localStorage — the backend is stateless. The only network traffic in the whole app is the browser talking to localhost:5000 and the backend talking to localhost:11434. The stack is deliberately boring — Python, Flask, no build step — so anyone can read the code and run it.

Try it yourself: clone https://github.com/xenover09/Apex, run ollama pull gemma2:2b, pip install -r requirements.txt, python app.py, open http://localhost:5000.

Why Does Open Innovation Matter?

Apex only exists because the AI at its core is open. A closed API would have killed this project three ways: it needs internet (which doesn't reach everywhere here), it sends every question to someone else's server, and it costs money per question — which means the people who need it most can't afford it.

With an open-weight model, the whole thing inverts: the model lives on an ordinary laptop, questions never leave the house, and the marginal cost of the thousandth question is zero. Nobody's terms of service can take it away, no pricing change can break it, and anyone can swap Gemma 2-2B for a bigger model later without rewriting a line. That's not a philosophical preference — it's the difference between a tool my family can actually use and a demo that dies when the free credits run out.

This week, Microsoft and NVIDIA put local AI at the center of the PC: the Surface Laptop Ultra (RTX Spark chip, preorders from $2,599, shipping Oct 16) and a $5,999 developer box, both pitched to run AI models on-device instead of in the cloud. Apex already lives there — from the opposite end of the price curve: their local AI needs flagship hardware; mine runs a 2B open-weight model on the laptop a student already owns. (Microsoft/NVIDIA Windows AI event, Oct 7, 2026 — https://www.unite.ai/nvidia-and-microsoft-bring-rtx-spark-laptops-ai-agents-to-windows-pcs/ and https://www.barrons.com/articles/microsoft-and-nvidia-will-present-new-ai-centric-laptop-today-why-it-matters-1a5fb9e9)

How I built it (honest version)

I don't hand-write code — I build by directing AI agents. My workflow: I write a precise build prompt (exact stack, exact features, exact file structure, acceptance criteria the agent must verify before calling it done), run it in an agent, and then verify the result against the real repo myself. For Apex the acceptance criteria were: the app boots with two commands, chat answers in the selected language for all three subjects, quiz questions match the active subject, each practice mode behaves correctly, everything works with WiFi off, and not a single external API call. Anything the agent claimed, I checked.

Prize Categories

  • Best Use of Gemma ($200 featured): Gemma 2-2B is the entire AI core of Apex — run locally via Ollama, not through any cloud API. The project is only possible because Gemma is open-weight and small enough to run on an ordinary laptop CPU.

What's next

One-click installer so setup is a double-click instead of terminal commands, more attack scenarios (fake job offers and "customs duty" parcel scams are next), and spoken lessons for low-literacy learners.


Built for Hacktoberfest 2026 — Week 1 (theme: Touch Grass).
Code: https://github.com/xenover09/Apex

Top comments (0)