Practical · site photo + voice memo queue · WebGPU q2f16 / fp16 · 2,603.9 MB · Apache-2.0

Inspection queue — a site photo and a voice memo in, field-report JSON out

Each queue item pairs a photo of a piece of equipment with a spoken memo. Gemma 4 E2B reads the plate and hears the memo in one omni pass on your GPU, then returns one JSON object with asset_id, reading, status, issues, memo_transcript and recommended_action. Pause, resume or cancel the queue, add your own photo + memo pair, and export the reports — nothing leaves this tab.

Run the inspection queue

Memo handling:

Fusing the photo and the raw memo in one pass is Gemma 4's headline capability, and the single-pass mode stays here so you can see it. In our runs, though, the 2-bit QAT E2B model often ignores the audio when it also gets a long JSON instruction: it writes "the audio is not provided" even though hundreds of <|audio|> tokens are in the prompt. So the default splits the work. Pass A gets only the memo and the instruction "Transcribe the audio exactly." Pass B gets only the photo, the field-report instruction and pass A's transcript, which it copies into memo_transcript. Both passes run on the same model.

Start runs every item from the top. Pause lets the current item finish, then halts; Resume continues with the items still queued. Cancel stops the current item mid-generation and clears everything left.

0 / 0 processed

Checking for a local copy of Gemma 4 E2B…

Current item — live output

The JSON for the running item streams here.

Prompt token mix of the current item

Counted from the real input_ids once an item prefills.

Queue

Add your own photo + voice memo

Pending photo

No photo chosen.

Pending voice memo

No memo chosen.

…or drop a photo and an audio clip here together. Files are decoded in this tab and never uploaded; audio is resampled to 16 kHz mono and capped at 30 s (Gemma 4's audio limit).

Parsed field reports

Parsed with extractStructuredJson() and checked with validateFieldReport(). "Plate facts" and "Memo keywords" compare the report with the known text on each preset plate and the reference transcript of each ledgered clip.

Why one model for photo + memo

How it works

For each queued item the page rasterises the photo to RGBA (≤840 px) and calls Gemma4Engine.generate() in a Web Worker. In the default mode, pass A sends only the memo with "Transcribe the audio exactly." (maxNewTokens: 96). Pass B then sends only the photo, with the field-report instruction and pass A's transcript (maxNewTokens: 256). In single-pass mode, one audio → image → text message carries everything. Cancel stops whichever pass is running, and the page yields to the main thread between items so it stays responsive.

Show the code — gemma4-core.mjs: buildFieldReportPrompt() (single omni pass instruction)
Show the code — gemma4-core.mjs: buildPhotoReportPrompt() (pass B: photo + pass A transcript)
Show the code — gemma4-core.mjs: extractStructuredJson() (fenced or bare JSON → object)
Show the code — gemma4-core.mjs: validateFieldReport() (required-key check)

References