<?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: realberry</title>
    <description>The latest articles on DEV Community by realberry (@realberry).</description>
    <link>https://dev.to/realberry</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%2F3770078%2Ff99fc621-3e83-4070-aba2-3d7b96bd2393.jpg</url>
      <title>DEV Community: realberry</title>
      <link>https://dev.to/realberry</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/realberry"/>
    <language>en</language>
    <item>
      <title>I Put Gemma 4's 2B Model on My Phone to Distill a Day of Screenshots Into a Recap</title>
      <dc:creator>realberry</dc:creator>
      <pubDate>Mon, 25 May 2026 06:09:56 +0000</pubDate>
      <link>https://dev.to/realberry/i-put-gemma-4s-2b-model-on-my-phone-to-distill-a-day-of-screenshots-into-a-recap-4mdd</link>
      <guid>https://dev.to/realberry/i-put-gemma-4s-2b-model-on-my-phone-to-distill-a-day-of-screenshots-into-a-recap-4mdd</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;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%2Fxgx9iygpm9y97db8wrls.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%2Fxgx9iygpm9y97db8wrls.png" alt="AetherLens cover" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem That Won't Go Away
&lt;/h2&gt;

&lt;p&gt;I just spent six hours on my phone today. I can't tell you a single thing I did.&lt;/p&gt;

&lt;p&gt;I know I scrolled TikTok. I know I added something to my Amazon cart and never bought it. I know I watched a YouTube video about a topic I now can't remember. My phone watched all of it — captured every pixel, technically — but the only thing left in &lt;em&gt;my&lt;/em&gt; head is a vague feeling that I wasted the day.&lt;/p&gt;

&lt;p&gt;I call this &lt;strong&gt;digital amnesia&lt;/strong&gt;. You probably have it too.&lt;/p&gt;

&lt;p&gt;I kept wishing my phone could just &lt;em&gt;tell me&lt;/em&gt; what I did. Like a little daily recap, every morning. &lt;em&gt;"Yesterday you browsed Amazon for shoes, watched a video about RC cars, and didn't reply to your mom."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The problem with that wish: nobody is going to build it at a level of privacy I'd be comfortable with. Not Google. Not Apple. Definitely not whatever cloud AI startup is going to vacuum up my screenshots.&lt;/p&gt;

&lt;p&gt;Then &lt;strong&gt;Gemma-4-E2B&lt;/strong&gt; dropped. 2.4 gigabytes. Multimodal. Reasoning. Runs on a phone.&lt;/p&gt;

&lt;p&gt;That was the &lt;em&gt;aha&lt;/em&gt; moment. Why am I wishing for this? Why don't I just build it RIGHT NOW?&lt;/p&gt;

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

&lt;p&gt;▶ &lt;strong&gt;1-minute video walkthrough&lt;/strong&gt;: &lt;a href="https://youtube.com/shorts/W_pw4Lqcz14" rel="noopener noreferrer"&gt;https://youtube.com/shorts/W_pw4Lqcz14&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;GitHub: &lt;a href="https://github.com/myberry2026/gemma-video" rel="noopener noreferrer"&gt;https://github.com/myberry2026/gemma-video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./install.sh &amp;lt;device-id&amp;gt;&lt;/code&gt;, point it at a Gemma-4-E2B model file, and you have your own private daily-recap engine in fifteen minutes.&lt;/p&gt;

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

&lt;p&gt;A daily recap of your digital life — built entirely from screenshots your phone already takes, curated by Gemma-4-E2B running &lt;strong&gt;on the phone itself&lt;/strong&gt;. No cloud. No laptop. No "share data for analytics".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How you use it&lt;/strong&gt;: install the app, grant Accessibility permission once, and forget about it. AetherLens hooks into Android's &lt;strong&gt;accessibility tree&lt;/strong&gt; to detect app switches and auto-captures a screen every 15 seconds in the background. Open the app whenever you want to see your day — the Storyboard tab shows the Gemma-4-curated highlights, the Album tab shows the raw screenshots, and the Settings tab has a "Trigger Manual Recap" button if you want to force curation right now instead of waiting for the next pass.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   AccessibilityService grabs a screen every 15 seconds, all day
              │
              ▼
   ┌────────── Real-time dedup as it captures ──────────┐
   │  Pass 1: pHash pixel filter   (drop the obvious)    │
   │  Pass 2: Gemma-4 visual sim   (decide the unclear)  │
   └─────────────────────────────────────────────────────┘
              │
              ▼   (only diverse frames hit disk)
        /sdcard/AetherLens/raw/  ← your day, deduped
              │
              ▼
   ┌────────── End-of-day distillation ─────────┐
   │  Pass 3: Gemma-4 narrative curation         │
   │          20 → 7 + one-sentence summary      │
   └─────────────────────────────────────────────┘
              │
              ▼
        Storyboard tab on the phone
        7 narrative highlights per app
        + Gemma-4 summary line each
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The captures live in &lt;code&gt;/sdcard/AetherLens/raw/&lt;/code&gt;. The 2.4 GB Gemma-4-E2B model lives in &lt;code&gt;/sdcard/Download/&lt;/code&gt;. The OpenAI-compatible inference server lives &lt;strong&gt;inside the app itself&lt;/strong&gt;, listening on &lt;code&gt;localhost:8080&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That's the whole stack. &lt;strong&gt;Three layers. One model. Fully on the phone.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Gemma 4 (Why E2B Specifically)
&lt;/h2&gt;

&lt;p&gt;When I started, I tried every model in the family:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma-4 31B (dense)&lt;/strong&gt; — beautiful captions, but 60+ GB. Never going to live on a phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma-4 26B-A4B (MoE)&lt;/strong&gt; — Same, too big to fit in my phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma-4 E4B&lt;/strong&gt; — slightly better than E2B, but significantly slow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma-4 E2B&lt;/strong&gt; — 2.4 GB. Multimodal. Reasoning. &lt;strong&gt;The fastest model in the family on a phone, and the only one that fits.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;E2B is the only variant where I didn't have to compromise on any of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Lives on the phone&lt;/li&gt;
&lt;li&gt;Sees pixels (not OCR text)&lt;/li&gt;
&lt;li&gt;Has the "thinking" reasoning mode so it can explain &lt;em&gt;why&lt;/em&gt; it picked specific frames&lt;/li&gt;
&lt;li&gt;Inference fast enough that a daily recap doesn't drain the battery&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's why the title says "Gemma 4's 2B model". Everything else is a different product.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dedup Pipeline (where Gemma-4 actually earns its keep)
&lt;/h2&gt;

&lt;p&gt;Curation is the hard part. Twenty screenshots of the Amazon homepage all look similar. The user doesn't want twenty homepage thumbnails — they want &lt;strong&gt;the seven moments that actually mattered&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Three passes do the work. The first two run &lt;strong&gt;continuously, in real time&lt;/strong&gt;, as new screens come in:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pass 1 — Perceptual Hash (local, ~1 ms)
&lt;/h3&gt;

&lt;p&gt;Resize each incoming frame to 64×64 grayscale, take a pixel diff against the previous kept frame. Cheap and stupid, but kills the "you sat on the same screen for 15 seconds" case before Gemma even sees it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pass 2 — Gemma-4 Visual Similarity (borderline cases only)
&lt;/h3&gt;

&lt;p&gt;When pHash says "kinda similar" (0.85–0.98), the answer is ambiguous. Gemma-4 takes over and makes a semantic call — &lt;em&gt;"is this the same screen, or just a similar layout?"&lt;/em&gt; Cheaper than running it on every pair; smart enough to handle the cases pHash can't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pass 3 — Gemma-4 Narrative Curation
&lt;/h3&gt;

&lt;p&gt;This is the end-of-day headline pass. We hand Gemma-4-E2B the deduped frames from one app's session in a single multimodal call, and ask it to pick the seven most diverse, narrative-worthy moments and write a one-sentence summary. The "thinking" mode lets the model reason explicitly about diversity vs. redundancy.&lt;/p&gt;

&lt;p&gt;You get back something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"The session involved browsing specific products, exploring fashion and home goods categories, checking pet wellness items, and engaging with multiple seasonal sales promotions."&lt;/em&gt;&lt;br&gt;
Selected frames: 0, 1, 3, 5, 6, 7, 18.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Real output. Real Gemma. All on the phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Android app (Kotlin)
 ├── AccessibilityService — hooks the OS accessibility tree,
 │                           captures one screen every 15 s
 ├── LlmInferenceManager  — wraps com.google.ai.edge.litertlm
 ├── EmbeddedLlmServer    — NanoHTTPD, OpenAI-compatible /v1/chat
 │                           served on the device at localhost:8080
 └── MemoryBridgeService  — real-time dedup + end-of-day curation
       │
       ▼
   localhost:8080 hosted by EmbeddedLlmServer  →  Gemma-4-E2B (2.4 GB on /sdcard)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three layers. One model. &lt;strong&gt;No cloud, No laptop.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;(Optional power mode: if you want faster curation, the same Settings toggle can point the app at a workstation running the byte-identical Gemma-4-E2B over your home network. Same model, same prompts — just faster. But everything works fully on the phone by default, and the demo video runs on-device only.)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Actually Works (the demo)
&lt;/h2&gt;

&lt;p&gt;For the submission, I ran AetherLens against 9 real apps on a real phone (Motorola Edge 2025). Real Gemma-4-E2B inference. Zero heuristic fallbacks fired.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;App&lt;/th&gt;
&lt;th&gt;Gemma-4-E2B summary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Amazon&lt;/td&gt;
&lt;td&gt;"Browsing specific products, fashion/home goods, pet wellness, seasonal sales"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;td&gt;"Searching for info, tech deals and financial market news, sponsored content"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Calendar&lt;/td&gt;
&lt;td&gt;"Navigating from empty view through dense schedules, future planning"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;YouTube&lt;/td&gt;
&lt;td&gt;"Lifestyle, sponsored ads, sports highlights, social, DIY"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TikTok&lt;/td&gt;
&lt;td&gt;"Comedy, DIY, lifestyle vlogs, pet content, relationship dynamics, travel"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Photos&lt;/td&gt;
&lt;td&gt;"Initiates and completes the Google Photos backup setup"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maps&lt;/td&gt;
&lt;td&gt;"Initiated a search but no updates were found in the area"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Messaging&lt;/td&gt;
&lt;td&gt;"Viewing Google Messages with verification codes and a Gemini AI prompt"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Settings&lt;/td&gt;
&lt;td&gt;"Navigating main settings — security, location, parental controls"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;9 apps. 180 raw frames in. 63 curated highlights out. All real Gemma. All on the phone.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-day rollup&lt;/strong&gt; — chain daily recaps into a weekly mosaic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice query&lt;/strong&gt; — "What was I doing on Tuesday?" — feed the storyboard back into Gemma-4 as context&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-app privacy mode&lt;/strong&gt; — never capture from banking or password apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NPU variants&lt;/strong&gt; — drop in a vendor-compiled E2B for extra speed without changing any other code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/myberry2026/gemma-video" rel="noopener noreferrer"&gt;https://github.com/myberry2026/gemma-video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The whole thing is one Kotlin app and a handful of scripts. Clone, run &lt;code&gt;./install.sh &amp;lt;device-id&amp;gt;&lt;/code&gt;, point it at a Gemma-4-E2B model file, and you have your own private daily-recap engine in fifteen minutes.&lt;/p&gt;

&lt;p&gt;I built this because I was tired of forgetting my own day. Maybe you are too.&lt;/p&gt;

&lt;p&gt;— Powered entirely by Gemma 4, on the device in your pocket.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
    <item>
      <title>I built a tool to find your H1B Wage Level by ZIP code (OpenH1B.org)</title>
      <dc:creator>realberry</dc:creator>
      <pubDate>Mon, 02 Mar 2026 01:02:59 +0000</pubDate>
      <link>https://dev.to/realberry/i-built-a-tool-to-find-your-h1b-wage-level-by-zip-code-openh1borg-48fm</link>
      <guid>https://dev.to/realberry/i-built-a-tool-to-find-your-h1b-wage-level-by-zip-code-openh1borg-48fm</guid>
      <description>&lt;h1&gt;
  
  
  Building a fast H1B search engine with DuckDB
&lt;/h1&gt;

&lt;p&gt;Hey devs,&lt;/p&gt;

&lt;p&gt;I'm excited to share a project I've been working on recently - a fast and clean H1B search engine called &lt;a href="https://openh1b.org" rel="noopener noreferrer"&gt;OpenH1B.org&lt;/a&gt;. As someone who's dealt with slow government databases and ad-heavy sites, I wanted to create a better alternative for finding honest H1B data.&lt;/p&gt;

&lt;p&gt;To make this project a reality, I used a combination of Python and DuckDB, a columnar database that allows for fast querying and indexing of large datasets. Here's a high-level overview of the tech stack and architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Ingestion&lt;/strong&gt;: I used Python scripts to process over 546,000 certified H1B records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Storage&lt;/strong&gt;: I used &lt;strong&gt;DuckDB&lt;/strong&gt; and &lt;strong&gt;Parquet&lt;/strong&gt; for fast analytical processing, with &lt;strong&gt;SQLite&lt;/strong&gt; for transactional metadata.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Optimized for &lt;strong&gt;200+ QPS on a 4-core ARM VPS&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: I used a minimal HTML/CSS/JS frontend to keep it lighweight and fast.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some key features of the project include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wage Levels by ZIP&lt;/strong&gt;: Users can search by ZIP code to find the official DOL Wage Levels (I-IV) for their specific role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Market Pulse&lt;/strong&gt;: The homepage features a real-time feed of the latest 100 certifications, providing insight into current market trends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dedicated Rankings&lt;/strong&gt;: I built dedicated rankings for Top Hospitals and Law Firms, where median salaries often exceed $200k-$500k+.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In terms of performance, I'm proud to say that the site loads in under a second, even on mobile devices. I achieved this by optimizing the database queries, using caching, and minimizing the number of requests to the server.&lt;/p&gt;

&lt;p&gt;I'm still fine-tuning the search functionality, so I'd love to hear your feedback. Does the ZIP code lookup accurately match your area? Check out the site at &lt;a href="https://openh1b.org" rel="noopener noreferrer"&gt;https://openh1b.org&lt;/a&gt; and let me know what you think!&lt;/p&gt;

&lt;h1&gt;
  
  
  h1b #data #python #career #visa
&lt;/h1&gt;

</description>
      <category>python</category>
      <category>data</category>
      <category>career</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
