Gemma on the glasses: Edge AI with no cloud
Our R&D prototype runs Gemma 4 E2B through Google AI Edge LiteRT-LM on the phone paired with Ray-Ban Meta glasses, to suggest the right guide for what you're looking at. Here's what broke.
In August 2026 we built an R&D prototype for a simple idea. A technician wearing Ray-Ban Meta glasses looks at a piece of equipment, and a voice in their ear asks, "Did you mean the guide for this?" Then it reads the steps aloud, waits for "next", and records photos and video of each step from their point of view.
The hard constraint was the one we set ourselves: no cloud. No images, audio or work data leave the device. The recognition runs on Gemma 4 E2B, a multimodal model of about 2.4 GB, through Google AI Edge LiteRT-LM on the iPhone paired with the glasses. We verified it on an iPhone 16 Pro Max running iOS 26.6 with Ray-Ban Meta glasses.
This post is about what it took, which was mostly finding out what breaks.
The problem
- The glasses are a camera, a microphone and speakers, not a computer. Every model has to run on the phone in the person's pocket.
- A phone is not a server. A 2.4 GB multimodal model has to load, fit in memory and answer quickly enough that a person standing at a switchboard doesn't give up.
- The obvious tools fell short. Apple's Vision framework returns labels from a fixed taxonomy. On our test desk it said things like "consumer electronics, machine, computer". Apple's on-device Foundation Models were text-only on iOS 26, so they couldn't look at anything.
- Voice in a work environment is noisy and ambiguous, and the command words overlap.
Architecture
Ray-Ban Meta glasses --(Meta Wearables Device Access Toolkit, Bluetooth)--> iPhone app
camera photo --> GemmaLookRecognizer (LiteRT-LM: text on Metal GPU, vision on CPU)
--> object list --> guide library matcher --> "Did you mean ...?"
mic (Bluetooth HFP) --> on-device speech recognition --> voice commands
read-aloud: on-device text-to-speech --> glasses speakers
guides: Knowby guides bundled as JSON Everything in that diagram runs on the phone or the glasses. Speech recognition is forced on-device wherever the phone supports it.
The engineering
A backend ladder, found by experiment
LiteRT-LM lets you choose where the text decoder and the vision encoder run: Metal GPU or CPU. Our first attempt put both on the GPU. The engine initialised, then creating a conversation returned nil, and the C API gave no reason.
So we stopped guessing and wrote a ladder. The recogniser tries combinations in order and keeps the first one that can actually create a conversation:
private static let backendLadder: [(text: Backend, vision: Backend)] = [
(.gpu, .cpu()),
(.cpu(), .cpu()),
(.gpu, .gpu),
] Running the matrix on hardware showed why. With vision on the Metal delegate, the encoder fails to compile with a STABLEHLO_COMPOSITE node that "failed to prepare". On the CPU it compiles cleanly. Text on the GPU and vision on the CPU is the combination that works. The ladder also means a phone or runtime where that pair fails still falls back to something that runs.
To find this without glasses or a tester, we added a --gemma-selftest launch mode that runs the backend matrix and a vision inference on the device and logs the result.
Two settings that changed everything
- The right model file. There are two builds of the model. The
-gpuone is smaller only because it leaves out the vision encoder, which you discover when images silently do nothing. We use the full build. - Thinking off. With reasoning enabled, Gemma spent its whole budget thinking: we saw 197 reasoning tokens and an empty answer. Turning thinking off made answers short and immediate.
Short prompts, small images, fresh context
Decoding is the slow part on a phone, so the prompt asks for as little text as possible:
private static let prompt = """
List the distinct physical objects you can see in this image. \
Reply with only a comma-separated list of short noun phrases, \
at most six, ordered most to least prominent. No other text.
""" The glasses capture at 1080×1440, but the model consumes any image as 280 soft tokens and resizes internally. Sending the full frame only costs encode time, so we downscale to 896 pixels on the long edge first. Each capture gets a fresh conversation, so the previous photo can't bias the answer.
Measured on the device: engine load 1.8 seconds, inference 2.9 seconds. On the same desk where Apple Vision said "consumer electronics", Gemma said "Monitor, Keyboard, Mouse, Desk, Papers, Yellow sticky notes". That is something you can match to a guide.
From objects to the right guide
The object list goes to a small token matcher over the guide library. A guide's terms score highly when they all appear in an observed object, and partly when some do. Nothing is suggested below a minimum score, because a wrong suggestion in someone's ear is worse than none.
Voice commands that don't misfire
Small details decide whether voice works at all. "Yes" and "no" are matched on whole words, because "no" is inside "know", "knowby", "not" and "now", and a substring match fires constantly. "Stop" is checked before "video", because "stop video" contains "video". From the command matcher:
let words = Set(heard.split { !$0.isLetter }.map(String.init))
if !words.isDisjoint(with: ["yes", "yeah", "yep", "yup", "sure", "please"]) {
return .yes
}
if !words.isDisjoint(with: ["no", "nope", "nah"]) {
return .no
}
if heard.contains("stop") { return .stop } The glasses themselves
The Meta Wearables Device Access Toolkit handles registration, sessions and the camera stream. Microphone input routes over Bluetooth HFP. There's no recording API in the toolkit, so we wrote an H.264 recorder that builds video from the raw frame stream. And because device logs are hard to read from a Mac, the app mirrors its own log to a file on the phone that we can pull after a session.
We vendored the LiteRT-LM Swift wrapper and framework into the project, because a package checkout failed on missing large-file objects. Not glamorous, but it's the difference between a build that works next month and one that doesn't.
Where AI fits
This one is all AI, in two senses.
The product is Edge AI: a multimodal language model doing visual recognition on a phone, with on-device speech in and out. That's the same reasoning behind our self-hosted AI work on servers, taken to the device. No AI vendor sees the images, there's no per-call cost, and it works on a site with no signal.
The build was AI-assisted too. The prototype's commit was co-authored with an AI coding agent, and the README reads as a runbook: setup, installing on a device, pulling logs, and the gotchas, each with the exact error string we hit. When the failure is a bare nil from a C API, writing down precisely what was tried is how you avoid trying it again.
What it taught us
- Measure on the hardware. The working configuration, the latencies and the model-file trap were all found on a real phone, not in documentation.
- Build the self-test before you need it. A launch flag that runs the matrix on the device saved a person standing around wearing glasses.
- Ask the model for less. A short answer format did more for latency than any tuning flag except turning thinking off.
- Be honest about what it is. It's an R&D prototype: no unit tests, no CI, findings documented rather than proven at scale. We haven't measured real-world accuracy, battery or heat over a working day, and that's the next work before anyone relies on it.
Why it still matters
Hands-free, eyes-up work instructions are useful anywhere people need both hands and can't trust the signal: plant rooms, roofs, substations, farms. The interesting part isn't the glasses. It's that a capable multimodal model now fits on the phone in your pocket, so the privacy and connectivity arguments stop being trade-offs. Our wearables and Edge AI page covers where we take it from here.