惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
V
Vulnerabilities – Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
美团技术团队
aimingoo的专栏
aimingoo的专栏
Google Online Security Blog
Google Online Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threatpost
Y
Y Combinator Blog
T
Tailwind CSS Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
小众软件
小众软件
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Tenable Blog
W
WeLiveSecurity
L
LINUX DO - 热门话题
D
Docker
Cyberwarzone
Cyberwarzone
量子位
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
O
OpenAI News
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
IT之家
IT之家
S
Secure Thoughts
MongoDB | Blog
MongoDB | Blog
L
Lohrmann on Cybersecurity
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How Gemma 4 Helped Us Cut the Last Wire Keeping AI Out of African Classrooms
Fiewor John · 2026-05-11 · via DEV Community

This is a submission for the Gemma 4 Challenge: Build with Gemma 4


The Problem Started Long Before This Hackathon

In 2021, as a postgraduate student, I built something called AI-Grader. The idea was simple: teachers spend an unreasonable amount of their lives marking scripts. AI could change that. The first version used Microsoft Azure's Cognitive Services — OCR to read handwriting, key phrase extraction to compare answers. It worked, but it was brittle. It compared keywords, not understanding. It could not tell you why it gave a grade.

Then ChatGPT dropped, and the gap between what I had built and what was now possible became impossible to ignore.

In early 2024, I teamed up with two people I had only just met, and together we rebuilt everything from scratch — this time with Google Gemini — during the Google BuildWithAI Hackathon organised by GDG Lagos and renamed the project GradrAI. We placed third nationally, and walked away with something more valuable than the prize: confirmation that this problem was real and that Gemini was the right foundation to build on.

GradrAI's relationship with Google had officially begun.


What GradrAI Actually Does

GradrAI is an AI-powered assessment platform built for educators in Africa. Two core workflows:

Paper-Based Test (PBT) grading: Teachers upload scanned student scripts, a question paper, and a marking guide. Gemini reads the handwriting, evaluates each answer against the rubric, and returns per-question scores, explanations, and personalised student feedback — in minutes, not days.

Computer-Based Test (CBT) generation and grading: Teachers upload lecture notes or past papers. The platform extracts topics, generates a structured quiz (MCQ, essay, or hybrid), produces a marking guide, and grades student submissions automatically.

The cloud version of this works well. Schools loved the demos.

Then came the part nobody wants to hear at a demo: "We don't have reliable internet."


The Conversation That Started Everything

On the 20th of April, I shared a NetworkChuck YouTube Short about offline AI models with my team on WhatsApp. And then a day before this hackathon announcement, FreeCodeCamp dropped a tutorial on open model coding essentials that specifically highlighted Gemma 4 as "very smart with low memory usage."

The response from Greatness, a member of the GradrAI design team mentioned based on his experience: "But you need a lot of RAM power."
Adams, our backend lead: "Yes, definitely."

They were right to be cautious. But the timing of those two things landing in the same week felt like something. And there was context behind it that made it feel even more urgent.

Three schools we had specifically demoed GradrAI to had given us near-identical feedback: a private secondary school in Lagos told us they lacked the infrastructure to adopt a cloud-dependent solution. A school in Ogun State said internet costs were not something they were prepared to cover for teachers. A third Lagos school said something similar.

These were not fringe cases. They were our target market telling us, clearly, that the cloud dependency was the barrier. Not the price. Not the product. The wire running from the classroom to the internet.

That day, we started building.


Phase 1: An Offline App That Still Needed the Cloud

The first version of the GradrAI desktop app — an Electron application — solved part of the problem. Teachers could import an exam package from the cloud onto their laptop. Students would connect to the teacher's local network and take the exam offline on their own devices. The local SQLite database collected every attempt.

MCQs were graded immediately. The correct answer was embedded in the exam package at import, so no AI was needed.

Essay and theory questions were a different story. They sat in a queue. Ungraded. Waiting for the teacher's machine to get a stable internet connection so the answers could be synced to the cloud and processed by Gemini.

The learning loop — the thing that makes assessment valuable — was broken at exactly the moment it mattered most. A student submits an essay. They want to know what they got wrong. The system says: come back when there's WiFi.

That is not a product. That is a waiting room.


The Sign

On the 6th of May, the DEV Community announced the Gemma 4 Challenge. $3,000 in prizes. Running through May 24. The mandate: build something real with Gemma 4.

I had been sitting on a half-finished idea for weeks. This was the deadline that forced it into existence.

The first task was straightforward: move theory grading offline. Replace the cloud sync queue with a local Gemma 4 model running via Ollama as a sidecar process inside the Electron app. When a student submits an essay, the answer goes directly to Gemma 4 on the teacher's machine. Score, explanation, and feedback come back in seconds. No internet required.

This worked. But then I stopped and looked at the full picture.

The grading was offline. The exam creation was still entirely online. Teachers still needed cloud access to extract topics from their materials, generate quiz questions, and produce marking guides. We had moved the last mile offline while leaving the first mile completely dependent on the internet.

That made no sense.


Phase 2: Taking the Entire Pipeline Offline

The cloud CBT pipeline in GradrAI has four AI operations:

  1. Topic extraction — read a PDF, identify key pedagogical topics and their relative weights
  2. Exam generation — take those topics and produce a structured quiz
  3. Marking guide generation — for essay questions, produce the evaluation rubric
  4. Theory grading — evaluate student answers against the marking guide

Operations 3 and 4 are text-in, text-out. Swapping them to a local Gemma 4 call is straightforward.

Operations 1 and 2 are the hard part. The cloud implementation sends Google Cloud Storage URIs directly to Vertex AI — a mechanism specific to Google's infrastructure. Ollama cannot resolve a GCS URI. To run these operations locally, we needed to rasterise the PDF pages to images, base64-encode them, and pass them as inline multimodal parts to Gemma 4.

This is exactly where Gemma 4's native multimodal capability becomes the architectural enabler. Without it, local topic extraction from a PDF is either impossible or requires a separate OCR pipeline bolted on the side. With Gemma 4, the same model that extracts topics also generates questions and grades essays. One model. One Ollama endpoint. The entire pipeline.

The implementation:

// offlineProcessor.js — PDF pages to base64 image parts, entirely in memory
const { pdfToPng } = require("pdf-to-png-converter");

async function rasterisePdfToInlineParts(localFilePath) {
  const pages = await pdfToPng(localFilePath, {
    viewportScale: 1.5,
    outputFileMask: "page",
  });

  const capped = pages.slice(0, 20); // respect E4B context window

  return capped.map((page) => ({
    type: "image",
    data: page.content.toString("base64"),
    mimeType: "image/png",
  }));
}

Enter fullscreen mode Exit fullscreen mode

// gemma.provider.js — unified Ollama interface for all four operations
async function generateContent({ promptText, imageParts = [] }) {
  const message = {
    role: "user",
    content: promptText,
    ...(imageParts.length > 0 && {
      images: imageParts.map((p) => p.data), // Ollama expects base64 array here
    }),
  };

  const response = await axios.post(
    "http://127.0.0.1:11434/api/chat",
    {
      model: process.env.OFFLINE_MODEL || "gemma4",
      messages: [message],
      stream: false,
    },
    { timeout: 120000 }
  );

  return response.data.message.content;
}

Enter fullscreen mode Exit fullscreen mode

The provider abstraction means the rest of the application — topic extraction, exam generation, marking guide generation, theory grading — never needs to know whether it is talking to Gemini on Vertex AI or Gemma 4 on Ollama. The service layer calls generateContent. The provider handles the rest.


Why Gemma 4 Specifically

This is not a case of "we picked a model and ran with it." The choice of Gemma 4 over other open models was deliberate and is embedded in the architecture.

The E4B model runs on consumer hardware. Most schools in our target market do not have server-grade machines. The teacher's laptop is the server. Gemma 4 E4B runs on consumer-grade laptops and high-end Android phones. It runs on the hardware that actually exists in Nigerian secondary schools — a mid-range Windows laptop, the kind a teacher might already carry to class.

Native multimodal input eliminates a pipeline dependency. Every other approach to offline PDF processing requires a separate OCR layer. Gemma 4's vision capability means a single model handles both document understanding and structured output generation. The pipeline is simpler, the failure surface is smaller, and the resource footprint on the local machine is lower.

The 128K context window makes the full syllabus available. For topic extraction, we can pass an entire semester's lecture notes as context in a single call. For grading complex essays, the marking guide, question paper, and student answer fit comfortably within the window without chunking. This is the difference between a model that skims a document and one that reads it.

Structured JSON output is reliable enough for production use. Our grading pipeline requires strict schema adherence — every response must contain questionId, score, maxScore, explanation, and feedback fields, or the result cannot be persisted. The existing score-clamping and schema validation in our grading service guards against drift, but Gemma 4's instruction following at this task is consistent enough that the guard rarely needs to activate.


What the Offline CBT Pipeline Looks Like Now

A teacher in a school with no internet connection can now do the following, entirely on their laptop:

  1. Open the GradrAI desktop app. Ollama starts automatically in the background. Gemma 4 loads.
  2. Upload a PDF — lecture notes, a past paper, a textbook chapter.
  3. The app rasterises the PDF in memory and sends the pages to Gemma 4. Topics are extracted and returned to the teacher in a visual interface where they can adjust weights and priorities.
  4. The teacher configures the exam: MCQ count, essay count, difficulty, total marks.
  5. Gemma 4 generates the full question set and marking guide simultaneously.
  6. The teacher reviews, approves, and publishes the exam to the local network.
  7. Students connect their devices to the teacher's hotspot and take the exam.
  8. MCQs are graded deterministically and instantly.
  9. Essay answers go directly to Gemma 4. Scores and feedback are returned to students within seconds.
  10. All results are stored in the local SQLite database and synced to the cloud the next time internet is available.

No cloud token was consumed. No data left the building. The student got their feedback before the class ended.


The Broader Context: Why This Matters for Africa

The shift toward Computer-Based Testing is accelerating across Africa. Nigeria's Joint Admissions and Matriculation Board (JAMB) now administers its UTME entirely via CBT to over 1.8 million candidates annually. Ghana's WAEC has been piloting CBT for WASSCE. Kenya's KNEC has published a national CBT roadmap. The continent is moving toward digital assessment at institutional scale.

The infrastructure reality has not kept pace. Nigeria's internet penetration sits below 45%. Electricity supply in many states is unreliable, meaning internet-dependent systems face compounding failure modes — no power, no router, no exam. The tools being built for this transition cannot assume the connectivity that developed-market EdTech takes for granted.

GradrAI's offline-first architecture is not a feature for edge cases. It is the baseline requirement for the market we are actually building for.

Gemma 4 is what made it technically feasible at the hardware level that this market actually has.


What Comes Next

The offline CBT pipeline is complete. The next stage is the SmartPrep feature — GradrAI's student-facing JAMB and WASSCE practice mode. Currently, SmartPrep surfaces past questions from an external API and provides AI-generated feedback online. The logical extension is an offline practice mode: Gemma 4 generates practice questions from curriculum content, grades student responses, identifies knowledge gaps across a session, and produces a diagnostic summary — all on-device, all free of cloud cost.

A student preparing for JAMB in a rural school, with no data, no tutor, and no money for a prep centre, practising with an AI that tells them exactly what they got wrong and why. That is the version of this product we are building toward.


Links

  • GitHub Repository: (to be added before submission)
  • Demo Video: (to be added before submission)
  • GradrAI Platform: gradrai.com

What we built during this hackathon is not a demo. It is a production feature shipping to real schools. The students who take exams on GradrAI's desktop app this term will get their theory grades back before they leave the classroom — because Gemma 4 is running on the teacher's laptop while they wait.