Crash Telemetry for AI Models That Run in the Browser: What We Built and What It Caught A developer at PixVibe, a browser-based image tools suite, built a crash telemetry system for ONNX background-removal models that run client-side via WebGPU or WASM, capturing device, stage, backend, memory and breadcrumb data per failure while sending only the first 16 bytes of a user's image to detect its real format. The system records fallback events where GPU inference fails and CPU succeeds, and in its first month surfaced that the biggest bug was in the team's own code rather than the model or hardware. I run PixVibe, a set of image tools. Background removal runs an ONNX model directly in the user's browser: WebGPU when it works, WASM when it doesn't. Run that way, the photo is never uploaded. We never see it. There's also a server-side option that does upload the photo. Users pick it themselves. That also means when it breaks, it breaks on a machine I can't see. I found this out watching Microsoft Clarity recordings. I saw people upload a photo, wait, and leave. Some got an error. Some just watched the page reload itself. Our error logs had almost nothing. I didn't know if it was the model, the GPU, the phone, or our code. So we built crash telemetry for the model runs. It records what was going on when a run failed, but it never uploads the image. The only bytes of the file it sends are the first 16, to detect the real format. Below is how it works, with simplified code, and what it found in the first month. The biggest bug it found was ours. window.onerror wasn't enough A normal error tracker catches exceptions and sends a stack trace. With a model running in the browser, most of what went wrong for us never showed up there: InvalidStateError: The source image could not be decoded and show "We couldn't read this image". If you report the friendly text, the real cause is gone. With four UI languages it's worse: one bug becomes four. failed to allocate on a 2 GB Android phone and on a 32 GB desktop are two different problems. You need to know what the device looked like at that moment. We call one failure an incident. Our rule: collect more than you think you need. Every time I sat down to dig into a problem, I wanted some detail we hadn't captured, and you can't go back for it later. The limit is privacy, which I cover at the end. Each incident has: | Group | Fields | |---|---| | What failed | incident kind, the original error name and message, first 10 lines of the stack | | Where | stage decode, model download, model init, inference, encode , backend webgpu or wasm , model | | The file | size, MIME type, extension, dimensions; for failed jobs and killed pages also the first 16 bytes and the real format detected from them. Never the file name, and nothing of the file beyond those 16 bytes | | The moment | JS heap used, tab visible or hidden, online or not, time since page load | | The device | browser and OS, cores, memory, GPU, WebGPU status, screen, network, cross-origin isolation | | The history | the last 50 breadcrumbs | We keep a separate device profile table too, but every incident carries its own copy of the device snapshot. One row has the whole picture, no joins. An incident is also broader than an error. If the GPU fails and the CPU fallback succeeds, the user sees nothing wrong, and we still record it. That fallback is where the speed goes. The reporter, simplified: js const API = '/api/incident' const MAX BODY = 60 1024 const MAX PER PAGE = 40 const MAX PER KIND = 10 const sent = { total: 0, byKind: new Map