A Malay text-to-speech model that is 8.5 MB. One ONNX file, one voice, runs in a browser tab (transformers.js, WebGPU or WASM) or on a single CPU thread in Python.
v0.4 is trained on roughly twice the speech of v0.3 (1,281 aligned sentences, about 118 minutes, instead of 634 / 49 minutes). General text improves by another 8% relative, the overall error is the lowest of any version, and the held-out score is the best so far. The muffled sound is unchanged (see Limitations).
Voice: Yati (female, the default voice in the Kecil-TTS demo). The same architecture also drives the male voice, Michael.
examples/gradio_app.py (pip install gradio, then python examples/gradio_app.py)| Model file | onnx/model_quantized.onnx, 8.46 MB (int8 weights) |
| Parameters | 7.9 M |
| Output | 24 kHz mono |
| Speed | about 25x real time on one CPU thread (onnxruntime); about 15x in a browser tab on WebGPU (6x on the first call) |
| Language | Bahasa Melayu (Malaysia), with common English words used in Malaysian speech |
| Inputs | input_ids (int64 [1,T], phoneme ids with a 0 at each end, T up to 402) and speed (float32 [1]) |
Python (onnxruntime + numpy; no PyTorch):
pip install onnxruntime numpy huggingface_hub soundfile
pip install https://huggingface.co/Suarify/kecil-tts-yati-v0.4/resolve/main/dist/kecil_tts_8m-0.3.0-py3-none-any.whl
import soundfile as sf
from kecil_tts import SAMPLE_RATE, KecilTTS
tts = KecilTTS.from_pretrained("Suarify/kecil-tts-yati-v0.4")
sf.write("hello.wav", tts("Selamat pagi, boleh saya bantu encik hari ini?"), SAMPLE_RATE)
Browser or Node (transformers.js 3.x):
import { KecilTTS } from './js/kecil-tts.js'; // see the web Space for a complete page
const tts = await KecilTTS.load({ model: 'Suarify/kecil-tts-yati-v0.4', g2pBase: './js/g2p/' }); // WebGPU if available, else WASM
const { audio, sampleRate } = await tts.speak('Selamat pagi, boleh saya bantu encik hari ini?');
examples/ has runnable Python and Node scripts. The ONNX file is WebGPU-safe: no float64 operators (the pitch-phase accumulator runs in float32), clamped 64-bit slice bounds, and the pointless noise reversal removed. Voice conversion to a second speaker only needs the pitch/loudness path, which this export keeps intact.
Measured by playing the model's speech to Whisper large-v3 and comparing what it heard with the text (character error rate, CER; lower is better). All three versions were scored in the same session on the same 200 test sentences, so the comparison has no cross-run noise. The recogniser itself misreads about 9% of the characters of the training clips, so no model scores 0; treat differences under about 1.5 points as noise.
All 200 test sentences (median / capped mean CER):
| Category | n | v0.2 | v0.3 | v0.4 |
|---|---|---|---|---|
| General text (Wikipedia-style, names, places) | 70 | 9.9% / 13.1% | 6.4% / 11.2% | 5.9% / 10.2% |
| Call-centre style (appointments, bills, delivery) | 60 | 5.2% / 6.5% | 4.9% / 7.3% | 4.3% / 6.2% |
| Numbers and money | 30 | 5.0% / 6.5% | 0% / 5.8% | 2.2% / 6.0% |
| Malay with English words | 20 | 18.4% / 23.9% | 19.2% / 26.2% | 17.9% / 24.9% |
| Questions | 10 | 1.7% / 3.3% | 0% / 2.4% | 0% / 4.3% |
| Short phrases | 10 | 13.5% / 15.9% | 0% / 15.4% | 4.0% / 10.2% |
| Overall | 200 | 7.5% / 10.8% | 5.9% / 10.5% | 5.5% / 9.5% |
On the separate 60-sentence held-out set: v0.4 4.8% / 8.5%, v0.2 4.9% / 8.9%, v0.3 5.6% / 10.3%. v0.4 is the best of the three on the held-out set, which is the number that matters most for unseen text.
Listen to samples/ (three sentences it got right, three typical held-out ones; samples/sentences.txt lists the text and score of each).
v0.3 dropped the 120 of 742 training clips the recogniser could not read back. v0.4 keeps that cleaned set and adds 767 newly generated clips (about 69 minutes) aimed at the weak categories: 295 general-text sentences, 136 Malay-with-English sentences, 174 conversational, 142 with numbers, 20 questions. Every new clip was generated twice with different seeds and the variant the recogniser read better was kept (31 sentences were dropped because neither variant was readable). The decoder was trained for 12,000 steps and the text side for up to 10,000 with checkpoint selection on duration + recognition, on 1,281 aligned sentences in total.
The training clips were scored with the recogniser and the 120 worst were dropped before retraining: −15% capped-mean error against v0.2, mostly general text and numbers.
Half of the phoneme boundaries inside words in v0.1's training data were more than one frame (25 ms) off, because they were guessed from proportions. v0.2 times the phonemes of every Malay word from a letter-level forced alignment of the training audio.
Code and weights: Apache-2.0. kecil_tts/lexicon_e.json and js/g2p/lexicon_e.json are derived from Wiktionary data and are CC BY-SA 4.0. See NOTICE for all credits: Paradee-8M (Sahil Mahendrakar), Kokoro-82M (hexgrad), Chatterbox Multilingual (Resemble AI), misaki, WikiPron, g2p-id, Tatoeba and Malay Wikipedia.