MagpieTTS Web β PT-BR TTS running entirely in your browser
Neural Brazilian Portuguese text-to-speech with 100% local inference using WebGPU.
No server-side inference. No audio leaves your device. After the first download, the model is cached by the browser for offline use.
Built by Ottema AI from NVIDIA MagpieTTS v2607 for browser-native inference.
π Live demo: ottema/magpie-tts-web
Why this project?
Modern neural TTS models normally depend on Python, CUDA and a backend inference server.
This project explores a different deployment target: the web browser itself.
We restructured, converted and optimized the MagpieTTS inference pipeline for ONNX Runtime Web and WebGPU β including its autoregressive decoder β allowing high-quality neural TTS to run directly on the user's GPU.
The result is a ~507 MB INT8 model that executes entirely client-side.
To our knowledge, this is the first public browser-native WebGPU implementation of NVIDIA MagpieTTS.
Highlights
- π§π· Brazilian Portuguese TTS
- π Runs directly in modern browsers
- β‘ WebGPU accelerated
- π 100% local inference
- π¦ ~507 MB INT8 download
- πΎ Browser cache / offline reuse
- π§ Autoregressive MagpieTTS decoder
- ποΈ 5 voices (Sofia, Aria, Jason, John, Leo)
- π₯οΈ No Python, CUDA or inference server required
Architecture
The original MagpieTTS inference pipeline was decomposed into WebGPU-friendly ONNX components:
Browser / WebGPU
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Text β G2P β Text Encoder β Prefill β
β β β
β βΌ β
β ββββββββββββββββββββββ β
β β AR Megablock Γ8 β β
β β + joint sampling β β
β β + KV state β β
β βββββββββββ¬βββββββββββ β
β βΌ (chunks, while AR β
β Neural Codec still runs) β
β βΌ β
β 22.05 kHz Audio β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
No inference server
INT8 pipeline
| Component | Role | Size |
|---|---|---|
text_encoder_int8.onnx |
Text encoder | 103 MB |
prefill_int8.onnx |
AR decoder prefill | 111 MB |
megablock_x8n64_int8.onnx |
AR decoder Γ8 + sampler | 201 MB |
codec_decoder_web_fp16.onnx |
Neural audio decoder | 62 MB |
| G2P lexicon + embeddings + voices | Auxiliary assets | ~7 MB |
Total browser download: ~507 MB
A FP16 variant (~881 MB) is also available for GPUs with efficient native FP16 support.
The megablock
The autoregressive decoder is the hot loop of the pipeline: one forward pass per audio frame. Calling a small ONNX graph once per frame from JavaScript spends more time in runtime overhead than in math.
The main optimization was therefore not just model quantization, but reducing the number of WebGPU/ONNX Runtime dispatches in the autoregressive loop.
megablock_x8n64 is a single graph that executes 8 decoder steps per
invocation (unrolled) β 16 audio frames, since each step produces 2 frames β
sampling all codeplanes jointly and updating the KV cache in place. The result:
a 7-second sentence needs ~10 graph calls instead of ~150 frame-by-frame
dispatches, keeping the AR loop close to realtime even inside a browser tab.
The _n64 variant additionally de-int64s the attention bookkeeping, which ran
~2x faster on WebGPU in our benchmarks.
Performance
Measured with the in-browser pipeline (Chrome + WebGPU). RTF = generation time / audio duration (lower is better). The codec decodes in chunks while the AR loop is still generating β first audio starts playing after ~2.5 s of buffer, well before synthesis ends.
| GPU | Precision | AR loop RTF | End-to-end RTF |
|---|---|---|---|
| RTX A4500 (Ampere, desktop) | INT8 | 0.88 | ~1.3 |
| MacBook Air M2 (8-core GPU, Metal) | INT8 | 2.0 | ~2.9 |
| MacBook Air M2 (8-core GPU, Metal) | FP16 Γ16 | 1.12 | ~1.9 |
Short sentences ("OlΓ‘, bom dia!") synthesize in ~2 s including codec. First synthesis is slower: WebGPU shaders are compiled and cached by the browser.
100% local
Once the model has been downloaded, text-to-speech synthesis happens entirely on the user's device. Input text and generated audio never reach an inference API.
This makes the project particularly interesting for:
- private voice assistants
- edge AI and local-first applications
- healthcare and enterprise environments
- offline applications
- browser-based conversational agents
Browser requirements
A browser with WebGPU support is required.
Recommended: Chrome / Chromium (113+) or Edge, with a recent desktop GPU. Performance depends strongly on GPU architecture and WebGPU implementation.
Try it
π Launch the MagpieTTS Web demo
Example text (Portuguese):
Uma vez rei ou rainha em NΓ‘rnia, sempre rei ou rainha... Aslan estΓ‘ a caminho.
Model provenance
Base model: NVIDIA MagpieTTS v2607.
This repository contains ONNX/WebGPU-compatible artifacts produced for the browser implementation. Please consult the original MagpieTTS model license and documentation in addition to the license information associated with this repository.
About Ottema AI
This project is part of Ottema AI's research into local and edge-native speech AI, including ASR, TTS and real-time conversational systems.
Ottema AI β InteligΓͺncia que opera.