Dev.to
7/24/2026

Building browser-only AI tools: debugging broken ONNX exports and ONNX Runtime fusion bugs
Original: Context Compression: Making AI Agents Forget Without Losing the Plot
Short summary
A developer shipped three browser-only AI tools (background removal, stem separation, speech-to-text) and documents what broke. A broken HTDemucs ONNX export produced physically impossible output (stems at 145% mix magnitude), solved by exporting from the official checkpoint. An ONNX Runtime fusion bug crashed Whisper due to tied embeddings, requiring a workaround. The post is a detailed debugging log with concrete data and hard-won lessons for on-device AI.
- •A broken ONNX export of HTDemucs produced physically impossible stem magnitudes, proven by comparing against the PyTorch reference
- •ONNX Runtime's graph optimizer crashes on Whisper's tied embeddings during quantized session creation
- •All three tools run entirely client-side with no file uploads, using transformers.js and onnxruntime-web
Generated with AI, which can make mistakes.
Is this a good recommendation for you?


