Skip to content

feat: add tiny-voca, a 4.5M-parameter English TTS model with its own phonemizer - #1311

Merged
0xShug0 merged 3 commits into
0xShug0:mainfrom
n4ze3m:tiny-voca
Nov 16, 2026
Merged

0xShug0 merged 3 commits into
0xShug0:mainfrom
n4ze3m:tiny-voca

Conversation

@n4ze3m

@n4ze3m n4ze3m commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Adds tiny-voca as the community family tiny_voca, as discussed in #1296. It is an English text-to-speech model with 4.5 million parameters and two voices. It makes 24 kHz audio and is meant for the CPU.

What is in it

  • The model, with model spec v1 and a spec-backed loader. The three transformer stacks are ggml graphs built from framework modules (LinearModule, LayerNormModule, GeluModule, RoPEModule, ScaledDotProductAttentionModule, DepthwiseConv1dModule).
  • The small steps between the stacks and the source-filter waveform head run on the host; the head uses the framework's real FFT. If you would rather have the duration predictor on modules, I can move it.
  • The model's phonemizer, dizione, in C++ with the standard library only (src/community_models/tiny_voca/dizione). No other text frontend is used.
  • A converter, a docs page, catalog rows, a long-form path test and a unit test that needs no model files. No framework changes.

Try it

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF
cmake --build build --parallel --target audiocpp_cli
python tools/model_manager_v2.py install tiny_voca_orig --models-root models
build/bin/audiocpp_cli --task tts --family tiny_voca --model models/tiny-voca-GGUF/tiny-voca-orig.gguf \
  --backend cpu --text "Hello! This is tiny voca." --voice-id M2 --out hello.wav

The model file is hosted at gguf/tiny-voca-orig.gguf in n4ze3m/tiny-voca: 23.6 MB, sha256 6940a20162d7e6a31141ad42aaa552b4fdb5182edeff9402e5ffaf66adfd72a0. tools/community_models/convert_tiny_voca.py makes the same bytes from the released checkpoint.

Tests

Linux x86-64, CPU backend, FP32.

Check Result
ctest on a full Debug build, gcc 13 and clang 18 114 of 114
Phonemizer against the Python package same phoneme ids on the 8,749 training sentences and on 300,000 generated texts
Audio against PyTorch, 700 utterances, same noise durations equal in 700; waveform within 0.12% of the peak (median), 1.5% (worst)
Long-form path test passes: three requests in one session, 9 sentences each, through the framework chunker
Speed and memory, 4 threads real-time factor 0.017; 33 MB loaded, 52 MB peak over 2,100 utterances in one session

Limits

  • English only, offline only, FP32 weights only.
  • With MSVC it is built but not run. On macOS it is built and unit-tested, but its audio is not compared. No GPU backend was tried.
  • A seed gives different noise than in the Python package, because the framework's noise generator is used.

More numbers are in docs/models/tiny_voca.md, and the tools that repeat the comparisons are in tests/community_models/tiny_voca.

English text to phonemes for the tiny-voca model: a port of the Python
package dizione (https://github.com/n4ze3m/dizione) at commit 8cd889e.
It lives in src/community_models/tiny_voca/dizione, uses the C++
standard library only and includes no audio.cpp code.

For the same data files it gives the same phoneme ids as Python.
tests/community_models/tiny_voca/reference.py writes what Python gives
and dizione_probe compares the C++ code with it.

The dictionary is kept as the text of its file with an index of four
bytes a word, so its 125,000 words take 4 MB.
A 4.5M-parameter English text-to-speech model with two voices
(https://huggingface.co/n4ze3m/tiny-voca), as the community family
tiny_voca with model spec v1.

The three transformer stacks are ggml graphs built from framework
modules (linear, layer norm, GELU, RoPE, scaled dot-product attention,
depthwise convolution). The duration predictor, the frame expansion,
the pitch rules and the source-filter waveform head run on the host;
the head uses the framework's real FFT. Text goes through the framework
chunker and then sentence by sentence through dizione.

Memory is kept low: attention scores are worked out for blocks of rows
(4 MB at most), graphs are made for each sentence and freed after it,
and the waveform head works through the audio in blocks. A session
stays near 50 MB however many requests it serves.

tools/community_models/convert_tiny_voca.py packs the released files
into one GGUF. tiny_voca_synth_probe and reference_audio.py compare the
audio with the PyTorch model for the same phoneme ids and noise.
tiny_voca_unit_test covers the parts that need no model files.
docs/models/tiny_voca.md describes the model, its options, how it was
checked against PyTorch, and its speed and memory. README.md,
docs/tts.md and docs/model_licenses.md get their rows, and the path
tests get a case with three long-form requests in one session.
@0xShug0

0xShug0 commented Nov 16, 2026

Copy link
Copy Markdown
Owner

@n4ze3m Thanks for the PR! No major issues found during my tests on CUDA/Vulkan/Metal.

Two things could be addressed in follow-up PRs:

  • Graph lifecycle: all three transformer graphs are rebuilt per sentence. They should use bounded session-owned.
  • Ignored language option: options.language=ja returns HTTP 200 and English speech instead of rejecting it.

@0xShug0
0xShug0 merged commit 8ac02f3 into 0xShug0:main Nov 16, 2026
7 checks passed
@n4ze3m

n4ze3m commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and for testing on CUDA, Vulkan and Metal!

I'll send a follow-up PR for both: a bounded session-owned graph cache, and rejecting languages other than English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants