Spectra: An iPhone storage assistant: it tells you

Demo video

Watch the product walkthrough

CompletedSwiftSwiftUIiOS 26+10 more

Spectra

An iPhone storage assistant: it tells you which photos are safe to delete, and why, with on-device AI through Firebase AI Logic hybrid inference. Not one photo is uploaded

Timeline

November 2026

Role

Creator

Team

Solo

Status

Completed

Technology Stack

Swift
SwiftUI
iOS 26
Firebase AI Logic
Apple Foundation Models
Gemini
Firebase App Check
Vision
Core ML (CLIP)
WidgetKit
App Intents
Next.js 16
Vercel

Key Challenges

  • AI That Explains but Never Deletes
  • On-device First, Cloud Only With Consent
  • Masking Before Anything Leaves the Phone
  • IDs Found With Checksums, Not a Model
  • Typed Output From a Small Model
  • Freeing Space Without Risk

Key Learnings

  • Firebase AI Logic Hybrid Inference
  • Apple Foundation Models and Guided Generation
  • Privacy as a Visible Feature
  • On-device Image Search With CLIP
  • Testing on a Real iPhone
  • Launch Film and Landing Page

Spectra: know which photos can go, and why

Overview

Spectra is a storage assistant for the iPhone. It reads the photo library on the phone and gives every photo a reason: keep it, lock it, or let it go. It splits real photos from clutter (duplicates, WhatsApp forwards, expired OTP and payment screenshots, big videos, AI-made images), then frees space only after you review and slide to confirm.

I built it solo for #BuildHybridAI 2026, around Firebase AI Logic hybrid inference: Apple's on-device model does the AI work, and Gemini is a fallback that only ever receives masked text, with your consent. Not one photo is uploaded.

The 90-second launch film. Every screen in it is the real app on an iPhone, running on a demo library.

Why I built this

Apple Photos can find your duplicates. It cannot tell you what is safe to delete. A full iPhone is mostly not memories: it is old screenshots of OTPs, forwarded good-morning images, the same photo three times and a few huge videos. People know this, but going through thousands of photos one by one is the job nobody does.

Cloud clean-up apps solve it by uploading your library. For photos that include IDs, bank screenshots and family pictures, that is the wrong trade. So the rule for Spectra was simple: the photos stay on the phone, and the app must explain every pick.

What it does

FeatureWhat happens
Sort the rollReal photos, duplicates, blurry shots, forwards, expired OTP and payment screenshots, receipts, IDs, big videos and AI-made images, each with a plain reason.
Get me spacePick a target such as 1 GB. Spectra builds a plan from the least risky items, you review it, then slide to confirm. Real photos, favourites and IDs are never pre-selected.
Ask your photos"What's the Wi-Fi password?" Spectra finds the screenshot, answers on the iPhone and shows the photo the answer came from.
Search by meaning"dog at the beach", "receipts from Swiggy", "Goa trip": words, what is in the picture, and dates.
Albums from a sentence"Bills and receipts go to Tax 2026" becomes a real Photos album that keeps itself up to date.
Lock IDsAadhaar, PAN, cards and passports are found with checksums and moved to the Hidden album. Their text never reaches any model.
Everywhere on iOSA full gallery, a home-screen widget, Siri and Shortcuts, a weekly digest, light and dark mode, VoiceOver and Dynamic Type.

Results

  • One demo run: 322 photos sorted into seven folders, 287 real photos kept, 1.11 GB freed in one slide, 0 photos uploaded.
  • The scan sorts about 500 photos in 63 seconds on an iPhone 17, all on the phone.
  • 164 automated tests: 107 core tests, 39 app tests on a real iPhone (including the real on-device model and a real Gemini call) and 18 UI flows.

How the hybrid AI works

Technical architecture

Core components, runtime flow, and durability boundaries.

Every structured AI call goes through one Firebase AI Logic session with a hybrid model: Apple's system model first, Gemini second. Guided generation (@Generable types) means the output always fits the app's own types, from a smart-album rule to the answer to a question.

Engineering decisions

The AI explains; rules decide

Every keep, review or junk call comes from deterministic rules on the phone, not from a model. That makes the result predictable, fast and testable, and it means no model can ever delete a photo. The model's job is the language around the decision: titles, the reason you read, saved info such as bookings and addresses, album rules from a sentence and answers to questions.

On-device first, the cloud only with consent

On an iPhone with Apple Intelligence, everything runs on the phone. Without it, Spectra asks before it uses Gemini. Every AI answer carries a badge, On this iPhone or Gemini · masked text, so you always know where it was made.

Mask before anything leaves

Numbers, emails, phone numbers and UPI IDs are masked on the phone before a request can leave it. ID photos and the text read from photos for Ask never go to the cloud. Each cloud request appears in a privacy log with the exact text that was sent. A demo switch simulates an iPhone without Apple Intelligence, so the fallback and the masking can be seen working.

IDs by checksum, not by guess

An Aadhaar or PAN number is found with its real format and checksum, so a random 12-digit number is not flagged and a real ID is not missed. IDs are locked in the Hidden album and never shown to a model.

Freeing space without regret

"Get me space" ranks items by risk, starts with the safest, and never pre-selects real photos, favourites or IDs. A slide to confirm replaces a delete button, and big videos can be re-saved in HD instead of deleted.

Picture search on the phone

An on-device image-text model (OpenAI CLIP ViT-B/32, converted to Core ML) indexes what photos look like, so search works by meaning without uploading a pixel. Vision and CLIP only turn pixels into searchable data; every generative step goes through Firebase AI Logic, protected by App Check.

The launch

I also made the landing page (Next.js 16, static export on Vercel, Lighthouse 98 to 100 on mobile) and the 90-second launch film, built frame by frame in code with a voiceover and music mixed to streaming loudness.

Access

Spectra is open source under Apache-2.0. Download the .ipa for iOS 26 and install it with AltStore or Sideloadly, or build it with Xcode from GitHub.

“A man who is master of patience is master of everything else.”

~ George Savile

© 2026 Mohit Goyal