Skip to content
Alp Yalay
HomeWorkCase StudiesResume
Back to Case Studies
Case Study
Edge AI & ML
Offline-First
Vibe-Coding

RealDex: Squeezing a 344MB AI Transformer onto Mobile Hardware via Distributed Vibe-Coding

March 2026
15 min
Alp Yalay
XLinkedIn
Role
Creator & Product Architect
Tech Stack
React Native CLI, C++ JSI, TFLite, SQLite, Python, Raspberry Pi 5
Platform
iOS & Android (Offline-First)
AI Model Scale
344MB BioCLIP + YOLO + Custom JSI Vector Loaders

How I engineered a zero-latency, offline-first biological field journal using a hybrid Colab/Pi 5 data pipeline, overcoming build exhaustions, package clashes, and a vector mismatch that branded my cat as an insect.

1. The Vibe-Coder's Mission

Most wildlife logging tools require active 4G connections to process photos via cloud computer vision APIs. But wildlife tracking happens deep in national parks and mountains where internet doesn't exist. As a non-programmer (a 'vibe-coder'), I wanted to build RealDex: a premium, forest-themed digital nature journal that works entirely offline-first. My goal was simple but massive: run a scientific-grade 344MB BioCLIP vision transformer directly on mobile hardware.

Orchestrating this required bridging complex machine learning frameworks, low-level binary array decoders (C++ JSI), and local SQLite databases. It was a journey of sheer perseverance, moving from high-level prototypes in Google Colab to SSH-ing into a Raspberry Pi 5 to crawl data, and surviving a grueling React Native CLI ejection process where packages clashed constantly. When it finally compiled and identified its first specimen, it wasn't just a triumph—it was an immense relief.

RealDex was born from a desire to blend Pokémon-style progression loops with genuine scientific field journaling. To make collection satisfying rather than an endless, aimless crawl across 2.16 million global species, I aggregated the biological tree into 1,000+ distinct animal families (via family_index.json). The UI was styled as a high-fidelity forest-green journal. The core engineering feat was squeezing a massive 344MB BioCLIP model into a hardware-accelerated on-device runtime, paired with a custom 0.05-degree (5.5km) spatial grid territory system that logs physical coordinates into SQLite, giving users an achievable, rewarding map-filling loop.

2. The AI Engineering Hurdles

Building a complex mobile AI app without deep low-level coding expertise meant facing three formidable technical bottlenecks that required creative system architecture:

GPU & JSI Accelerations

To prevent native UI freezing during classification, I bypassed the standard JavaScript bridge. I built a JSI-based C++ array decoder using quick-base64 to parse the 10MB binary species embeddings directly into a Float32Array in mobile RAM. We also engineered a crash guard using local MMKV storage; if loading the 344MB TFLite model triggered an Out-of-Memory (OOM) OS crash, the app flags it on reboot, avoiding infinite loading loops.

Geospatial Territory Mapping

To give players a sense of regional progression, we built a local grid system (0.05° ≈ 5.5km squares). When an explorer enters a new cell, a new entry is logged into SQLite under territory_visits. The app queries a local spatial snapshot (territory_snapshots) to generate targeted, localized checklists of birds, mammals, and insects unique to that exact geographic coordinate, making physical walks feel like expanding a real map.

The Hybrid Data Model

Offline accuracy depends on robust reference embeddings. We bundled a 10,000-species vector database for 100% offline, free species classification on-device. For rarer species outside the top 10,000, we built a paid Cloud AI (Gemini 2.0 Flash) fallback tier to process long-tail identifications without bloating the local application bundle size.

3. Spotlight: Prototyping, Pi 5, & Mascot Bugs

Getting the offline classifier operational required a highly creative hybrid infrastructure, resulting in some hilarious setbacks:

Prototyping
Colab to Raspberry Pi 5
Testing embeddings was too heavy for my main laptop. I prototyped the visual vector scripts in Google Colab, and then offloaded the actual data crawling to a Raspberry Pi 5 running 24/7 in my living room via SSH to avoid thermal throttling.
The Bug
Mascot Branded as an Insect
During the first live test with my cat Mavi (the official mascot), the app confidently identified her as an insect. I had accidentally mapped the text embeddings onto the visual embeddings, scrambling the JSI similarity engine vectors.
The Churn
72-Hour Embedding Rebuild
To fix the vector scramble, I had to rebuild the reference vectors. The script harvested 25 representative images per species from the iNaturalist API across 10,000 species. It ran continuously on the Pi 5 for 3 days to bypass rate-limits.

3. Implementation & Architecture Pipeline

I mapped my system implementation into three distinct optimization phases:

01. Model Optimization & Quantization

We compiled the 344MB BioCLIP model into FP16 formats using CoreML and TFLite converters, shrinking memory footprints by 50% for mobile neural engines and allowing inference to complete in under 120ms.

02. Geospatial Exploration Grid

We divided the physical world into 0.05-degree squares (5.5km) inside a local SQLite database to provide targeted regional checklists and map-filling progress without relying on high-speed internet.

03. Distributed Scraping Pipeline

We prototyped embedding generators on Google Colab GPUs and deployed them to crawl 250,000 images on a Raspberry Pi 5 via SSH for 3 days to respect iNaturalist rate-limits.

4. The Reality of Vibe-Coding

Technical Achievements

AI Inference Time: ~120ms on-device. Storage Reduction: 344MB raw PyTorch to highly optimized native packages. Platform Reach: Bare React Native CLI compile. User sentiment has been outstanding due to the zero-latency, offline-first experience.

344MB
Model Scale
10,000
Local Species

The Honest Developer Feeling

"People always expect a grand Eureka moment. But honestly, when the JSI loaders, SQLite schema, and Pi 5 embeddings finally snapped together and Mavi was correctly identified as Felis catus, the dominant feeling was sheer relief. Constant troubleshooting is exhausting, and holding a stable, working app in your hands is the ultimate reward."

Key Lessons

System Architecture Wins Over Code Syntax

You don't need a computer science degree to build advanced ML applications. By leveraging AI coding assistants (Claude Code) and acting as a Product Architect—coordinating Colab GPUs, SSH servers, and mobile frameworks—I built a high-performance system that many senior engineers find intimidating. Design, logic, and perseverance are the real developer superpowers.

Build Fatigue is Real

Ejecting from Expo to bare React Native CLI to get react-native-fast-tflite working was a brutal gauntlet of dependency hell and package clashes. AI speeds up code writing, but troubleshooting build errors requires deep stamina. The key to finishing is pacing yourself through the fatigue.

Summary of Achievements

RealDex is living proof that high-performance, offline-first Machine Learning can be shipped directly to mobile hardware by resourceful "vibe-coders." By combining a robust local SQLite architecture with 344MB on-device classifiers, a low-power Pi 5 scraping server, and deep gamified territory grids, we've built a premium digital wildlife companion that functions anywhere on Earth.

Previous case studyCase Study: The "Vibe-Coding" Protocol – Localizing Heroes of Hammerwatch 2Game LocalizationNext case studyCase Study: Vibe Coding Ecosystem – Scaling Prompt Infrastructure to 3k+ GitHub StarsCase Study

Contents

  1. 1. The Vibe-Coder's Mission
  2. 2. The AI Engineering Hurdles
  3. 3. Spotlight: Prototyping, Pi 5, & Mascot Bugs
  4. 3. Implementation & Architecture Pipeline
  5. 4. The Reality of Vibe-Coding
  6. Key Lessons
  7. Summary of Achievements

Alp Yalay

Portfolio of products, websites, and bilingual systems from Istanbul.

Pages

HomeWorkCase StudiesResume

Focus

  • Personal products
  • Client websites
  • Mobile apps
  • Bilingual web systems

© 2026 Alp Yalay. All rights reserved.