Files
ai-spel-frontend/docs/adr/0002-single-thread-onnx-for-mobile-tts.md
T
Ein Anderssono a4f89f2b82
Build and publish frontend / publish (push) Successful in 50s
Use single-thread ONNX runtime for mobile speech
2026-10-16 08:51:08 +02:00

909 B

ADR 0002: Run ONNX with one thread inside the Piper worker

Decision

Configure ONNX Runtime Web to use one thread and stop backend initialization after 60 seconds. Piper already runs in a dedicated worker, so ONNX does not need to create another worker pool.

Context

On iPad, the threaded ONNX WASM file downloaded fully, but the runtime did not report that initialization had completed. Nested worker startup and shared-memory setup are a likely compatibility boundary on mobile Safari. The available production assets currently include the threaded ONNX build.

Consequences

This removes ONNX's additional worker pool and bounds initialization failures with a visible error. It may reduce inference throughput on desktop devices. CI and Kubernetes release verification must confirm that Piper still initializes and speaks on supported browsers; iPad acceptance remains a manual device check.