<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Afreen Hossain</title>
    <description>The latest articles on DEV Community by Afreen Hossain (@afreen007).</description>
    <link>https://dev.to/afreen007</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3886529%2Fc562ecf0-67fe-477b-b5b7-932b1d274110.png</url>
      <title>DEV Community: Afreen Hossain</title>
      <link>https://dev.to/afreen007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/afreen007"/>
    <language>en</language>
    <item>
      <title>Gemma 4 at the Edge</title>
      <dc:creator>Afreen Hossain</dc:creator>
      <pubDate>Sun, 24 May 2026 07:43:54 +0000</pubDate>
      <link>https://dev.to/afreen007/gemma-4-at-the-edge-365g</link>
      <guid>https://dev.to/afreen007/gemma-4-at-the-edge-365g</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Write About Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  A Developer's Guide to Privacy-First, Multimodal, and Multi-Scale Local AI
&lt;/h1&gt;

&lt;p&gt;For years, the developer path to building AI-powered software followed a predictable, rigid pattern: sign up for a cloud service, get an API key, write some prompt orchestration, and hope the pricing tiers or model deprecation schedules don't break your app. &lt;/p&gt;

&lt;p&gt;But this "black-box API" paradigm is hitting serious roadblocks. Developers are increasingly building for environments where &lt;strong&gt;data privacy is non-negotiable, internet connection is unreliable, and external data storage is a compliance nightmare&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Google’s native &lt;strong&gt;Gemma 4&lt;/strong&gt; lineup marks a massive shift in developer sovereignty. It is a family of highly capable, open-weight models that can be run entirely locally. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Imperative of Privacy-First, Offline AI
&lt;/h2&gt;

&lt;p&gt;The most common hurdle in traditional AI development is trust. When building applications that handle highly personal or proprietary data, sending user logs to a third-party cloud server is often a dealbreaker. &lt;/p&gt;

&lt;p&gt;Consider these real-world development scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Healthcare Assistants&lt;/strong&gt;: Summarizing medical logs or patient journals where HIPAA compliance is critical.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internal Enterprise Docs&lt;/strong&gt;: Indexing sensitive codebase repositories, private financial charts, or confidential intellectual property.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline Student Tools&lt;/strong&gt;: Educational tools built to run in remote areas, offline classrooms, or regions with high internet latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal Journaling Apps&lt;/strong&gt;: Giving users a digital second-brain where thoughts are analyzed for sentiment, completely local to the device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By utilizing Gemma 4, developers can achieve &lt;strong&gt;100% offline autonomy&lt;/strong&gt;. There are no API calls, no third-party logs, and zero data leakage. Your user's information stays exactly where it belongs: on their physical device.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Choosing the Right Model: E2B vs. E4B vs. 31B Dense
&lt;/h2&gt;

&lt;p&gt;Gemma 4 is not a single model,it is a family of architectures tailored to different compute budgets. Picking the right variant is key to balancing user experience, latency, and hardware constraints.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model Variant&lt;/th&gt;
&lt;th&gt;Reasoning Depth&lt;/th&gt;
&lt;th&gt;Average Latency&lt;/th&gt;
&lt;th&gt;Memory Profile&lt;/th&gt;
&lt;th&gt;Best Suited For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; &lt;em&gt;(Edge-to-Boundary)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Lightweight/Stable&lt;/strong&gt;&lt;br&gt;Excels at single-turn instructions, classification, and simple extraction.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Extremely Fast&lt;/strong&gt;&lt;br&gt;(Sub-second to 2s)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Ultra-Low&lt;/strong&gt;&lt;br&gt;Runs smoothly on 8GB RAM laptops and mobile hardware.&lt;/td&gt;
&lt;td&gt;Offline CLI assistants, on-device text parsing, fast keyword mapping, and simple agents.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma 4 E4B&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Balanced&lt;/strong&gt;&lt;br&gt;Strong semantic understanding, RAG-friendly formatting, and structured outputs.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Moderate&lt;/strong&gt;&lt;br&gt;(2s to 5s)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Medium&lt;/strong&gt;&lt;br&gt;Optimized for 8GB–16GB developer setups.&lt;/td&gt;
&lt;td&gt;Local RAG pipelines, intermediate summarization, multi-turn chat applications, and schema validation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma 4 31B Dense&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Enterprise Grade&lt;/strong&gt;&lt;br&gt;Superior coding assistance, multi-step logical planning, and heavy mathematical reasoning.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Variable/High&lt;/strong&gt;&lt;br&gt;(8s to 12s on local edge)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt;&lt;br&gt;Requires 24GB+ VRAM or unified Apple Silicon memory.&lt;/td&gt;
&lt;td&gt;Complex code generation, intricate multi-agent systems, deep document analysis, and cloud hosting.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Selecting Your Variant
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use E2B&lt;/strong&gt; when latency and memory are your tightest bottlenecks. It is designed to act as a fast, high-speed, local utility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use E4B&lt;/strong&gt; for standard text-processing applications where you need the model to follow complex formatting instructions (like returning clean JSON or structured markdown summaries) without a high latency penalty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use 31B Dense&lt;/strong&gt; when you are building analytical systems, writing advanced code synthesis engines, or running batch processing workloads where reasoning depth overrides speed.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Beyond Text: Practical Multimodal Workflows
&lt;/h2&gt;

&lt;p&gt;Chatbots are only a tiny sliver of the AI landscape. In real-world software engineering, raw user inputs are rarely formatted as clean text. Instead, users provide blurry phone photos, receipt scans, metro ticket images, or system screenshots.&lt;/p&gt;

&lt;p&gt;Gemma 4's multimodal capabilities make it exceptionally powerful at grounding natural language reasoning in raw visual context. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Reclaiming Developer Sovereignty
&lt;/h2&gt;

&lt;p&gt;When you build with closed APIs, you are at the mercy of black-box model changes. A prompt that works flawlessly today might break tomorrow due to upstream model drift. You cannot inspect the raw weights, you cannot benchmark changes deterministically, and you cannot verify how your data is being handled.&lt;/p&gt;

&lt;p&gt;With Gemma 4:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You Can Inspect&lt;/strong&gt;: Study how the model handles tokenization boundaries and inspect active attention behaviors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You Can Quantize&lt;/strong&gt;: Compile custom, highly compressed runtime profiles (such as setting Ollama context boundaries like &lt;code&gt;num_ctx 128&lt;/code&gt; or &lt;code&gt;num_predict 64&lt;/code&gt; for E2B) to fit specific hardware targets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You Can Reproduce&lt;/strong&gt;: Ensure your application behaves identically every single time, completely immune to cloud drift or API outages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You Can Adapt&lt;/strong&gt;: Fine-tune the weights on domain-specific medical, legal, or transit databases, creating a highly specialized system that operates entirely under your control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gemma 4 proves that open-source models aren't just toys for hobbyists,they are the core building blocks for resilient, private, and highly customized modern software architectures.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;How are you planning to deploy Gemma 4 in your next project? Are you optimizing E2B for on-device edge workflows or building local RAG pipelines with E4B?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
    <item>
      <title>Find Your Route</title>
      <dc:creator>Afreen Hossain</dc:creator>
      <pubDate>Sun, 24 May 2026 07:30:29 +0000</pubDate>
      <link>https://dev.to/afreen007/find-your-route-2mc9</link>
      <guid>https://dev.to/afreen007/find-your-route-2mc9</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Find-Your-Route&lt;/strong&gt; is an edge-aligned, high-throughput civic transit co-pilot and real-time ecological impact dashboard built with an &lt;strong&gt;extreme focus on backend architectural optimization, low-latency pipeline performance, and offline resilience&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;By applying production-grade backend engineering principles, such as &lt;strong&gt;semantic Redis caching, upstream rate-limiting protection, and decoupled micro-pipelines&lt;/strong&gt;, the system bridges the gap between raw physical tickets and immediate, intelligent transit routing. Commuters upload a photo of a physical paper ticket and receive custom-tailored travel itineraries alongside visual greenhouse gas offsets in under two seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Core Problem
&lt;/h3&gt;

&lt;p&gt;Most AI-driven transit or navigation solutions suffer from three fundamental bottlenecks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unacceptable Latency&lt;/strong&gt;: Running raw images through heavy multimodal vision models takes upwards of 80 seconds, which is completely non-viable for commuters moving through busy metro turnstiles. Uploading the same ticket at different times would call the API again, which increases latency and wastes computation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connectivity &amp;amp; Availability Drops&lt;/strong&gt;: Cloud-only APIs fail completely inside deep underground transit corridors or under heavy API rate-congestions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redundant Computation&lt;/strong&gt;: Re-running costly LLM queries for the same common commuter routes drives up latency and API expenses.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Solution: An Optimized Backend Architecture
&lt;/h3&gt;

&lt;p&gt;To solve this, we designed &lt;strong&gt;Find-Your-Route&lt;/strong&gt; around a modular, decoupled backend built to deliver lightning-fast responses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One-Command Containerized Deployment&lt;/strong&gt;: The entire backend ecosystem (FastAPI, EasyOCR pipelines, and the Redis cache) is fully Dockerized. A single command (&lt;code&gt;docker compose up --build&lt;/code&gt;) spins up the entire stack on any machine, making deployment instant and reproducible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Decoupled Ingest Pipeline&lt;/strong&gt;: Rather than relying on cloud vision APIs, a local, high-speed &lt;strong&gt;EasyOCR&lt;/strong&gt; pipeline extracts raw ticket text, which is parsed by regex-based station tokenizers in &lt;strong&gt;~1.6 seconds&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High-Performance Redis Caching&lt;/strong&gt;: Commuters traveling the same routes hit a canonical &lt;code&gt;source:destination&lt;/code&gt; key in memory. The system retrieves pre-computed route insights in &lt;strong&gt;under 1ms&lt;/strong&gt;, yielding a blazing-fast warm-cache API response of &lt;strong&gt;~1.8 seconds&lt;/strong&gt; (completely bypassing LLM latency).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dual-Model Edge Fallback &amp;amp; API Protection&lt;/strong&gt;: If cloud APIs face rate limits or latency spikes, the backend automatically fails over in &lt;strong&gt;less than 500ms&lt;/strong&gt; to a local Ollama instance running &lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; on edge infrastructure, ensuring transit guidance is never disrupted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-Memory Profile Optimization&lt;/strong&gt;: By utilizing customized Ollama runtime parameters, the local &lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; model runs smoothly on standard development laptops and low-memory profiles, making offline edge-deployment highly viable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vibrant Eco-Analytics Dashboard&lt;/strong&gt;: Frontend React Native elements consume rapid, clean JSON payloads to render interactive, SVG-based ecological footprint metrics (trees saved, carbon saved), upcoming metro timings and carriage crowding heatmaps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://drive.google.com/file/d/12-OXjNdV7-GgyCoG7o_yAutJ3GszuCVj/view?usp=sharing" rel="noopener noreferrer" class="c-link"&gt;
            gemma4-challenge.mp4 - Google Drive
          &lt;/a&gt;
        &lt;/h2&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fssl.gstatic.com%2Fimages%2Fbranding%2Fproduct%2F1x%2Fdrive_2020q4_32dp.png" width="32" height="32"&gt;
          drive.google.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/AfreenInnovates" rel="noopener noreferrer"&gt;
        AfreenInnovates
      &lt;/a&gt; / &lt;a href="https://github.com/AfreenInnovates/gemma4-e2b" rel="noopener noreferrer"&gt;
        gemma4-e2b
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Find-Your-Route&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;em&gt;AI-Powered Multimodal Civic Transit Co-Pilot &amp;amp; Eco-Impact Dashboard&lt;/em&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://dev.to/devteam/join-the-gemma-4-challenge-3000-prize-pool-for-ten-winners-23in" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/f1b81eea70db60a32e38743ab3b40f6f69a22afdddcd3652480444a3308a0a93/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445562e746f2d47656d6d615f345f4368616c6c656e67652d626c756576696f6c65743f7374796c653d666f722d7468652d6261646765" alt="Gemma 4 Challenge"&gt;&lt;/a&gt;
&lt;a href="https://opensource.org/licenses/MIT" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c7b487c51a946680acb2c3ccee8a2f2bad7e409d6c7098ed2971a7a7ce339d8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d7465616c2e7376673f7374796c653d666f722d7468652d6261646765" alt="License: MIT"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Find-Your-Route&lt;/strong&gt; is a civic transit co-pilot for ticket OCR, route guidance, caching, and eco-impact comparison. It uses Google's &lt;strong&gt;Gemma 4&lt;/strong&gt; models, Redis-backed caching, and a responsive dashboard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it does&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan a physical ticket image.&lt;/li&gt;
&lt;li&gt;Extract and normalize station details with OCR preprocessing.&lt;/li&gt;
&lt;li&gt;Generate route guidance with &lt;strong&gt;Gemma 4&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Compare carbon impact and travel cost against other transport options.&lt;/li&gt;
&lt;li&gt;Use local Ollama fallback when online API access is unavailable.&lt;/li&gt;
&lt;/ul&gt;

  &lt;div class="js-render-enrichment-target"&gt;
    &lt;div class="render-plaintext-hidden"&gt;
      &lt;pre&gt;graph TD
    A[Physical Ticket Upload] --&amp;gt;|react-native-image-picker| B[OCR Extraction Pipeline]
    B --&amp;gt;|FastAPI Preprocessing| C[Station Extractor / Normalization]
    C --&amp;gt;|Check Redis Cache| D{Cache Hit?}
    D --&amp;gt;|Yes: sub-second| E[Render UI Response]
    D --&amp;gt;|No: Cache Miss| F[Gemma 4 31B Dense Primary]
    F --&amp;gt;|API Congestion/Failure| G[Gemma 4 e2b Local Fallback]
    F --&amp;gt;|Generate Route Markdown| H[Store in Redis Cache]
    G --&amp;gt;|Generate Route Markdown| H
    H --&amp;gt; E
&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;span class="js-render-enrichment-loader d-flex flex-justify-center flex-items-center width-full"&gt;
    &lt;span&gt;
  
    &lt;span class="sr-only"&gt;Loading&lt;/span&gt;
&lt;/span&gt;
  &lt;/span&gt;


&lt;p&gt;&lt;strong&gt;Quick Start&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prerequisites: Docker, Docker Compose, and either an…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/AfreenInnovates/gemma4-e2b" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Architectures We Chose &amp;amp; Why
&lt;/h3&gt;

&lt;p&gt;To power our real-time commuter co-pilot, we designed a &lt;strong&gt;Hybrid Intelligent Routing System&lt;/strong&gt; leveraging two primary Gemma 4 architectures:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Primary Brain: Gemma 4 31B Dense&lt;/strong&gt; (&lt;code&gt;google/gemma-4-31b-it:free&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Role&lt;/strong&gt;: High-throughput Cloud Reasoning Engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it fits&lt;/strong&gt;: Crafting navigation itineraries requires highly accurate multi-step reasoning. Gemma 4 31B Dense excels at reading raw JSON databases of train lines, understanding platform interconnections, and formatting instructions in elegant, bite-sized markdown that is easy for commuters to read on the move.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Fallback: Gemma 4 E2B&lt;/strong&gt; (&lt;code&gt;gemma4:e2b&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Role&lt;/strong&gt;: Resilient Edge Deployment via Ollama.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it fits&lt;/strong&gt;: The &lt;strong&gt;E2B&lt;/strong&gt; model is highly optimized for local/offline deployment on restricted hardware (like station ticketing computers or local server nodes). It offers extremely high reasoning efficiency with a small memory footprint, ensuring that even if public internet connectivity drops in underground terminals, the local fallback is triggered in &lt;strong&gt;less than 500ms&lt;/strong&gt; to guide commuters safely.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Orchestration Pipeline
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foskhdz3xkzeg7thvrst6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foskhdz3xkzeg7thvrst6.png" alt="Pipeline" width="473" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Engineering Challenges &amp;amp; Breakthroughs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge 1: The Local Memory Bottleneck (8GB RAM Limit)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Problem&lt;/strong&gt;: During local testing, the system would regularly freeze and throw Out-Of-Memory (OOM) crashes. Ollama would struggle to run Gemma 4 concurrently with Docker, VS Code, and multiple open browser tabs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Fix&lt;/strong&gt;: We initially had to close all background apps and tabs just to keep Ollama alive. Recognizing that this was a bad user experience, we researched and implemented the &lt;strong&gt;Low-Memory Profile (&lt;code&gt;gemma4-lowmem&lt;/code&gt;)&lt;/strong&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenge 2: Docker Container Networking &amp;amp; Redis Configuration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Problem&lt;/strong&gt;: Orchestrating a FastAPI backend with a Redis cache using Docker Compose caused repeated connection failures, with the backend unable to reach the Redis container during startup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Fix&lt;/strong&gt;: We initially configured Redis using &lt;code&gt;localhost&lt;/code&gt; / &lt;code&gt;127.0.0.1&lt;/code&gt;, but that did not work because each Docker container runs separately. We fixed it by changing the Redis host to redis (&lt;code&gt;REDIS_HOST=redis&lt;/code&gt;), removed password setting, and updating the Docker setup so the backend could connect to Redis properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Images of the app!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsarkyfnvo876fent2w3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsarkyfnvo876fent2w3k.png" alt="Landing Page" width="439" height="758"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulm3niau1brychowvprd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulm3niau1brychowvprd.png" alt="Ladning Page" width="401" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2be8qgxy6nas65kx429j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2be8qgxy6nas65kx429j.png" alt="Analytics" width="416" height="748"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtgrinelqe6usic9a75s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtgrinelqe6usic9a75s.png" alt="Congestion" width="421" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvrkbn6nmbqvudhn8ixf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvrkbn6nmbqvudhn8ixf.png" alt="Gemma Response" width="396" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Submitted by &lt;a href="https://dev.to/afreen007"&gt;Afreen Hossain&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
    <item>
      <title>Energy Leak Scout: Find the Waste. Cut the Bill.</title>
      <dc:creator>Afreen Hossain</dc:creator>
      <pubDate>Mon, 20 Apr 2026 05:30:29 +0000</pubDate>
      <link>https://dev.to/afreen007/energy-leak-scout-find-the-waste-cut-the-bill-21ka</link>
      <guid>https://dev.to/afreen007/energy-leak-scout-find-the-waste-cut-the-bill-21ka</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-04-16"&gt;Weekend Challenge: Earth Day Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Energy Leak Scout: Track Every Watt, Save Every Month.&lt;br&gt;
Energy Leak Scout is a Flutter + Node.js app that helps users understand daily home energy usage and reduce waste.&lt;br&gt;
Users enter appliance runtime (hours/day), view estimated electricity usage and trends, and get AI-generated explanations for high consumption with practical tips.&lt;/p&gt;

&lt;p&gt;My goal was to make Earth Day impact personal and measurable by converting behavior into clear energy, cost, and carbon insights.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://drive.google.com/file/d/14t0fkyhtfS5gYTLxMxi4-22idsQKH7Wq/view?usp=sharing" rel="noopener noreferrer" class="c-link"&gt;
            weekend-challenge.mp4 - Google Drive
          &lt;/a&gt;
        &lt;/h2&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fssl.gstatic.com%2Fimages%2Fbranding%2Fproduct%2F1x%2Fdrive_2020q4_32dp.png" width="32" height="32"&gt;
          drive.google.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/AfreenInnovates" rel="noopener noreferrer"&gt;
        AfreenInnovates
      &lt;/a&gt; / &lt;a href="https://github.com/AfreenInnovates/weekend-challenge" rel="noopener noreferrer"&gt;
        weekend-challenge
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Energy Leak Scout&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Energy Leak Scout is an Earth Day themed full-stack app that helps users understand and reduce household electricity use.&lt;/p&gt;
&lt;p&gt;The app lets users log in, enter daily appliance usage (hours/day), and instantly see estimated energy impact in kWh, cost, and CO2. It also provides AI-assisted explanations for high consumption and practical savings recommendations.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What This App Means&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This project is about turning abstract energy data into everyday action.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Awareness: makes hidden energy waste visible.&lt;/li&gt;
&lt;li&gt;Action: gives clear recommendations users can follow immediately.&lt;/li&gt;
&lt;li&gt;Impact: links personal behavior to cost savings and lower emissions.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Core Flow&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;User logs in with Auth0.&lt;/li&gt;
&lt;li&gt;User enters appliance usage (hours/day).&lt;/li&gt;
&lt;li&gt;App calculates estimated usage and insights.&lt;/li&gt;
&lt;li&gt;User taps Why high?&lt;/li&gt;
&lt;li&gt;Backend verifies Auth0 token, then asks Cohere for a concise explanation.&lt;/li&gt;
&lt;li&gt;App displays explanation plus practical tips.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Tech Stack&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Flutter (frontend)&lt;/li&gt;
&lt;li&gt;Node.js + Express (backend)&lt;/li&gt;
&lt;li&gt;Auth0 (authentication and API protection)&lt;/li&gt;
&lt;li&gt;Cohere (AI explanation…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/AfreenInnovates/weekend-challenge" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I designed Energy Leak Scout as a practical user journey, not just a dashboard. The goal was to help a user move from "I think my bill is high" to "I know exactly what to reduce this week."&lt;/p&gt;

&lt;p&gt;Was fun building this, learned about Auth0 and how to integrate/implement it in the project! Though didn't integrate Backboard, did check out its docs and understood how to use it!&lt;/p&gt;

&lt;h3&gt;
  
  
  User Walkthrough
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Open app and authenticate&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user starts in Flutter and signs in with Auth0.&lt;/li&gt;
&lt;li&gt;A secure access token is issued after login.&lt;/li&gt;
&lt;li&gt;That token is stored in app state and attached to backend API calls.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Add appliance usage in simple language&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user enters daily runtime in hours for common appliances like AC, Fan, Fridge, and TV.&lt;/li&gt;
&lt;li&gt;The UI also supports adding custom appliances, so the app works for real homes with different devices.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;View instant energy impact &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As soon as usage is entered, the app converts hours/day into kWh/day.&lt;/li&gt;
&lt;li&gt;The user sees total consumption, top contributors, and chart-based trends.&lt;/li&gt;
&lt;li&gt;Additional insights include estimated monthly energy use, CO2 impact, and cost signals.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Ask for explanation when usage feels high&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user taps "Why high?" to get a plain-language explanation.&lt;/li&gt;
&lt;li&gt;This triggers a secure backend call (token-protected) that prepares a concise appliance summary and sends it to Cohere.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Receive practical savings actions&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The response returns short, actionable tips (for example reducing AC runtime or adjusting setpoint behavior).&lt;/li&gt;
&lt;li&gt;Recommendations are designed to be easy to apply immediately, not generic sustainability advice.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Continue tracking progress&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user can update inputs daily and monitor trend changes.&lt;/li&gt;
&lt;li&gt;This creates a small behavior loop: measure, understand, act, and improve.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical Build Details
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Flutter frontend for interactive UI, charts, and appliance usage input.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built the client in Flutter for one codebase across platforms.&lt;/li&gt;
&lt;li&gt;Added chart visualizations and summary cards so users can quickly identify which devices drive most consumption.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Node.js + Express backend for secure API routes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implemented a lightweight Express API with clear endpoints for health, usage, insights, and "why-high" reasoning.&lt;/li&gt;
&lt;li&gt;Added reusable calculation helpers for totals, rankings, category splits, trends, recommendations, and eco score outputs.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Auth0 JWT protection for usage and insights endpoints.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Protected key routes with Auth0 JWT validation via JWKS (&lt;code&gt;express-jwt&lt;/code&gt; + &lt;code&gt;jwks-rsa&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Enforced expected audience and issuer so only valid tokens from the configured Auth0 tenant are accepted.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Cohere integration for concise energy explanations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added Cohere chat generation on the backend so prompts and API keys stay server-side.&lt;/li&gt;
&lt;li&gt;Constructed prompts from actual appliance usage totals and top contributors to keep responses grounded in user data.&lt;/li&gt;
&lt;li&gt;Tuned response style for short, practical guidance instead of long-form AI output.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Local fallback logic to keep the app useful even when AI credentials are unavailable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;COHERE_API_KEY&lt;/code&gt; is missing or the upstream call fails, backend automatically returns a local explanation plus tips.&lt;/li&gt;
&lt;li&gt;Fallback logic is rule-based from appliance usage patterns, so the user still receives meaningful guidance.&lt;/li&gt;
&lt;li&gt;This improves reliability for demos, first-time setup, and offline/dev scenarios.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;Best Use of Auth0 for Agents, Best Use of Google Gemini, Best Use of GitHub Copilot&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
    </item>
  </channel>
</rss>
