MakHam (มะขาม) Thai Text-to-Speech

MakHam (มะขาม) is an ultra-lightweight, high-performance open Thai Text-to-Speech (TTS) model family developed by PyThaiNLP.

MakHam combines Kokoro-82M multi-voice architecture with the Paradee 1.1 single-voice distillation framework, supporting accurate 5-tone Thai phonology and standalone ONNX deployment across servers, CPUs, edge devices, and web browsers.


Model Highlights

  • Ultra-Compact Size: 7.88M parameters (~8.07 MB INT8 ONNX file) — reduced from 325 MB Kokoro-82M.
  • Blazing Fast: > 45x Real-Time Factor (RTF) on a single modern CPU thread without requiring GPU acceleration.
  • 5-Tone Thai Phonology: Explicit tone representation (→ mid, ↓ low, ↘ falling, ↑ high, ↗ rising) powered by FastThaiG2P with a 115-token Kokoro vocabulary.
  • Self-Contained ONNX Graph: The female acoustic style representation is baked directly into the graph. No external .npy voicepack tensor or dynamic tensor slicing is needed at runtime.
  • Natural Voice Timbre: Warm, natural Thai female voice trained on verified conversational, news, and everyday spoken Thai datasets (~50 hours).

Benchmarks & Specifications

Property MakHam Paradee (INT8) MakHam Paradee (FP32) Kokoro-82M Thai Base
Parameters 7,877,918 (~7.88M) 7,877,918 (~7.88M) 82,000,000 (82M)
Model Size 8.07 MB 33.17 MB 325.5 MB
Architecture TextStudent (s+mlp) + VDecoder (v2) TextStudent (s+mlp) + VDecoder (v2) StyleTTS2 + iSTFTNet
Sample Rate 24,000 Hz 24,000 Hz 24,000 Hz
Vocab Size 115 tokens (5-tone) 115 tokens (5-tone) 115 tokens (5-tone)
Voicepack Required No (Embedded) No (Embedded) Yes (ref_s [510, 1, 256])
Speed (CPU) ~45x Real-Time ~28x Real-Time ~4.5x Real-Time

Quick Start & Installation

Requirements

pip install onnxruntime soundfile huggingface_hub
pip install https://github.com/awslabs/FastThaiG2P/archive/refs/heads/main.zip

Python (Direct ONNX Runtime & FastThaiG2P)

import json
import numpy as np
import onnxruntime as ort
import soundfile as sf
from huggingface_hub import hf_hub_download
from fastthaig2p import G2P, ipa_to_kokoro

# 1. Download model and config from Hugging Face
model_path = hf_hub_download(
    repo_id="pythainlp/MakHamTTS",
    filename="paradee_thai/paradee_thai_int8.onnx"
)
config_path = hf_hub_download(
    repo_id="pythainlp/MakHamTTS",
    filename="paradee_thai/config.json"
)

# 2. Initialize G2P and ONNX session
g2p = G2P()
with open(config_path, "r", encoding="utf-8") as f:
    cfg = json.load(f)

session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])

# 3. Convert Thai text to Kokoro phoneme IDs
text = "สวัสดีค่ะ ยินดีต้อนรับสู่ระบบเสียงสังเคราะห์ภาษาไทย มะขาม"
phonemes = ipa_to_kokoro(g2p.convert(text))
token_ids = [0] + [cfg["vocab"][c] for c in phonemes if c in cfg["vocab"]] + [0]

# 4. Synthesize speech
audio = session.run(None, {
    "input_ids": np.array([token_ids], dtype=np.int64),
    "speed": np.array([1.0], dtype=np.float32),
})[0][0]

# 5. Save output audio (24 kHz)
sf.write("output.wav", audio, 24000)
print("Saved audio to output.wav")

Training & Dataset Curation

MakHam was trained using the verified pythainlp/MakHamTTS-dataset:

  • Over 94,200 verified utterances (~100 hours of 24 kHz audio) curated from Thai Wikipedia, conversational logs, code-switching corpora, and Common Voice.
  • Filtered through automated quality gates: duration trimming (>2.0s), SpeechBrain ECAPA-TDNN speaker verification, and Whisper CER consistency scoring.
  • Kokoro base trained via two-stage StyleTTS2 with WavLM SLM adversarial prosody tuning.
  • Distilled via the Paradee 1.1 framework into a unified TextStudent + VDecoder architecture.

Citation & Acknowledgements

If you use MakHam in your research or application, please cite:

@misc{makham2026,
  author       = {Wannaphong Phatthiyaphaibun},
  title        = {MakHamTTS},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/pythainlp/MakHamTTS}}
}

Credits

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train pythainlp/MakHamTTS

Paper for pythainlp/MakHamTTS