Tiny Vanya
▶ Try it in your browser — makeitbeta.ru/tinyvanya (runs on your device, no server) · Landing page
По-русски — Малёк Ванёк: попробовать в браузере.
Tiny Vanya is a compact Russian text-to-speech model with two voices, M1 (male) and F1 (female). Since v0.4 it also reads English sentences and English words inside Russian ones. It builds on tiny-voca and was distilled from synthetic Russian speech by Qwen3‑TTS 1.7B Base. It runs on CPU, Apple GPU and the Neural Engine, and needs no network for inference. tiny-voca · Qwen3‑TTS 1.7B Base
Tiny Vanya — компактный синтез русской речи с двумя голосами: мужским M1 и женским F1. С v0.4 читает и английские фразы, и английские слова в русском тексте. Модель работает на устройстве: CPU, GPU и Neural Engine в iPhone и Mac. Сеть не нужна.
| Voices | M1 (male), F1 (female) |
| Architecture | two stages: acoustic transformer → 80‑band log‑mel → Vocos‑style vocoder (iSTFT) |
| Parameters | 28.5M acoustic + 7.7M vocoder = 36.2M |
| Output | 24 kHz mono |
| Input | Russian text → phonemes and stress (eSpeak NG ru + stress dictionary); Latin words → English phonemes (dizione: CMUdict + G2P) |
| Speed | ×77 real time with ONNX Runtime on 4 CPU threads, ×93 with Core ML (Mac mini M4 Pro) |
| Intelligibility | Russian CER 0.25–0.3 % with Whisper large‑v3‑turbo on 60 held‑out sentences; English WER 2.2 % (M1) / 2.7 % (F1) on 120 held‑out sentences |
| Pretrained weights in the student | none; trained from random initialization |
M1 uses the acoustic checkpoint A‑Mb2 and F1 uses A‑Mb1, both fine-tuned from the v0.3 checkpoints on a bilingual corpus. They share a vocoder. Either acoustic checkpoint can speak both voices.
What's new in v0.4
-
English. The phoneme set grows from 100 to 116 tokens: 16 English phones join the Russian ones, and the first 100 ids are unchanged. Latin words go through dizione (American English, CMUdict and a G2P model); Russian words keep the v0.3 front end. Each new phone started from the embeddings of the nearest Russian sounds.
-
Corpus. Qwen3‑TTS 1.7B Base read 4,000 English sentences (Tatoeba, Common Voice) and 3,000 Russian sentences with English words (Russian Wikipedia, Tatoeba) in both voices. 11,504 clips (14.6 h) passed screening and alignment and were added to the v0.3 corpus for a six-hour fine-tune.
-
Results against v0.3.1 on held-out sentences:
v0.3.1 v0.4 English WER, Whisper (M1 / F1) 23.6 / 19.6 % 2.2 / 2.7 % Acronyms in Russian sentences recognised 16 / 44 33 / 44 English words in Russian sentences written back in Latin by Parakeet Ultra (teacher ≈ 50 %) 18 / 17 % 35 / 33 % Russian CER, Whisper 0.31 % 0.25–0.3 % Rise on yes/no questions, semitones 6.7 / 8.0 6.6 / 7.8 In a blind listening test v0.4 won 6 of 6 English pairs and 5 of 7 mixed pairs; the 4 Russian control pairs were ties.
-
Acronyms inside Russian sentences are read with Russian letter names (
API→ «эй пи ай»,CI/CD→ «си ай си ди»); in English sentences they keep English letter names. Roman numerals in Russian sentences are read as numbers (XIX век→ «19 век»). -
Homographs by context. For 232 ambiguous words (
стороны,дорогой,белки,руки…) a small per-word classifier reads the neighbouring words and picks the stress (со сторон+ы/ст+ороны договорились,дорог+ой друг/пойдём другой дор+огой). It was trained on 75,000 sentences labelled by RUAccent and agrees with RUAccent 91 % of the time, against 70 % for the most frequent reading. The model is a 1 MB JSON file shared by Python and the browser. -
Compound words with видео-, аудио-, радио-, фото-, медиа- and стерео- take the stress of their second part (
видеои́грами,аудиокни́га). v0.4.1 (28.11): in 0.4.0 such words outside the dictionary stopped the whole phrase with «нет проверенного произношения»; they are now read as the unstressed prefix followed by the dictionary word, in Python and in the browser. The models are unchanged. -
dizioneand its built data now ship with the Python package (no extra setup). -
v0.4.3 (28.11): 49,145 word forms outside the stress dictionary, where eSpeak puts the stress on the wrong vowel (
саундтрекаread «са́ундтрека»), now take RUAccent's stress (its form dictionary, or its stress model for forms of dictionary words), compiled with the same eSpeak sources as the main table (tiny_vanya/stress_forms.json, synthesis only). About one Wikipedia sentence in ten has such a word. Python and the browser alike; the models are unchanged. -
v0.4.4 (28.11): English abbreviations keep their full stop (
Plants vs. Zombies→ «versus»,Apple Inc. иwithout a pause); the homograph classifier now also reads the beginnings of nearby words (5-fold cross-validated, 182 words, 91.8 % agreement with RUAccent) and tells «за́мок» from «замо́к» (вор взломал замок); Greek letters are read by their Russian names (α-углерод→ «альфа-углерод»). The models are unchanged. -
v0.4.5 (28.11): 300 more homographs from RUAccent's list (the most frequent in our texts) got context labels and the stress options the dictionary lacked (
замка́/за́мка,за́мке/замке́,войска́,Жуко́в); a word enters the classifier only if it beats what the front end did without it (table default or eSpeak) by 3 points in 5-fold cross-validation. Now 232 words, 93.5 % agreement with RUAccent against 76.5 % without the classifier. The models are unchanged. -
v0.4.2 (28.11): the browser copies shrink from 100 to 44 MB per voice (int8 weights in blocks of 32,
web/make_web_onnx.py --durations int8b --rest int8b). Whisper scores on 270 held-out phrases are unchanged, and in a blind test of 12 pairs the listener heard no difference in 8, preferred the smaller copy in 3 and the old one in 1. The models are unchanged.
What's new in v0.3
-
v0.3.2 (28.11): dates, years and numbers after a preposition are read in the right case (
3 мая→ «третьего мая»,в 2026 году,с 5 до 7), in Python and in the browser alike. The models are unchanged. -
v0.3.1 (28.11): English words in Russian text no longer stop synthesis with «нет фонем в словаре»: eSpeak's English phones outside the model inventory (ɒ, iə, eə, əl, ʊə, aɪə) are read with the nearest learned sounds. The models are unchanged.
-
The fine-tuning corpus adds 3,237 clips of Russian yes/no questions, including 1,369 clips with a lead-in clause. During fine-tuning, yes/no questions had three times the sampling weight of other clips.
-
On 400 held-out syntheses, the pitch guard triggered 27 times, down from 33 in v0.2.1. Whisper CER on the 60-sentence control set was 0.21% for both releases.
-
The text front end restores «ё» in «о всём» and «обо всём», in Python and the browser.
-
Earlier releases are available under their tags. v0.2.1
Samples
| Text | M1 | F1 |
|---|---|---|
| Здравствуйте! Это Тини Ваня, маленькая модель синтеза русской речи, которая работает прямо на устройстве. | ||
| Встречу перенесли на 15:30, четырнадцатого марта, так что у нас осталось около сорока пяти минут. | ||
| Ты правда думал, что я забуду про твой день рождения? | ||
| Осенью в парке особенно тихо: листья медленно падают на дорожки, а воздух пахнет дождём и дымом. | ||
| Hello! I can read English too: this small speech model runs right on your device. | ||
| Мы обновили API, и теперь приложение работает в Windows и на iPhone. |
Files
| Path | Size | Contents |
|---|---|---|
onnx/m1.onnx, onnx/f1.onnx | 150 MB each | Text‑to‑waveform graph (acoustic + vocoder), float32, opset 17 |
onnx/m1.json, onnx/f1.json | 4.5 MB | Metadata: voices, phoneme symbols, front end, stress dictionary |
coreml/{m1,f1}-durations.mlpackage | 43 MB | Core ML part 1: phonemes → token states and durations (float32) |
coreml/{m1,f1}-speech.mlpackage | 50 MB | Core ML part 2: frames → waveform, float16, fixed lengths 128…3000 frames (iOS 18 / macOS 15) |
coreml/{m1,f1}.json | Core ML metadata | |
swift/TinyVanyaCoreML.swift | Swift runner for the Core ML packages (phonemes in, audio out) | |
pytorch/acoustic-m1.pt, pytorch/acoustic-f1.pt, pytorch/vocoder.pt | 115 / 115 / 31 MB | PyTorch weights (torch.load(..., weights_only=True)) |
code/tiny_vanya-0.4.5-py3-none-any.whl | 3 MB | Python package: front end (with the dizione English data), ONNX and PyTorch inference, export, training code |
web/v0.4.2/m1.onnx, web/v0.4.2/f1.onnx | 44 MB each | Browser copies (v0.4.2): int8 weights with a scale per channel and block of 32, cast to float32 at load (onnxruntime-web); web/v0.4/ keeps the 100 MB float16 copies |
samples/ | The audio on this page | |
SHA256SUMS | Checksums for the v0.4 release files |
Usage
ONNX Runtime (no PyTorch)
pip install "tiny-vanya[onnx] @ https://huggingface.co/region23/tiny-vanya/resolve/v0.4.5/code/tiny_vanya-0.4.5-py3-none-any.whl"
hf download region23/tiny-vanya --revision v0.4 --include "onnx/*" --local-dir tiny-vanya
python -m tiny_vanya.onnx_infer --model tiny-vanya/onnx/m1.onnx --voice M1 \
--text "Здравствуйте! Встречу перенесли на 15:30." --output hello.wav
From Python:
from pathlib import Path
import soundfile as sf
from tiny_vanya.onnx_infer import Speech
speech = Speech(Path("tiny-vanya/onnx/f1.onnx"))
audio = speech.speak("Ты правда думал, что я забуду про твой день рождения?", voice="F1", speed=1.0)
sf.write("question.wav", audio, 24000)
Text of any length works. It is read sentence by sentence and the audio is joined. Numbers, times and dates are spelled out in Russian. Latin words are read in English. The audio is scaled to peak at most 0.99.
The graph itself takes phoneme ids. If you call it directly, use tiny_vanya.text.phonemize with the front end and dictionary from onnx/*.json:
| Input | Type | Shape | Meaning |
|---|---|---|---|
tokens | int64 | [1, N] | Phoneme ids including the edge tokens (symbols in the JSON) |
stress | int64 | [1, N] | 0 none, 1 primary, 2 secondary |
voice | int64 | [1] | Index in voices: 0 = F1, 1 = M1 |
speed | float32 | [1] | 1.0 as predicted, larger is faster (0.25–4) |
pitch_shift | float32 | [1] | Added to log F0; 0.058 ≈ one semitone |
pitch_range | float32 | [1] | Scales pitch movement around the mean (0–3) |
pitch_offset | float32 | [1, N] | v0.2: log‑F0 offset per token (0 = the model's own intonation) |
Outputs: audio float32 [1, samples], durations int64 [1, N] (frames of 256 samples per token) and, since v0.2, prosody float32 [1, T, 2] (log F0 and voicing per frame). One call speaks at most 3000 frames (32 s). Speech.speak splits longer sentences by itself.
Marking up text
- Stress: put
+before the stressed vowel (з+амок,зам+ок), or a combining acute (U+0301) after it. A marked word keeps your stress. - ё: write it where it belongs. The front end also restores it in «о всём», «обо всём» and words the dictionary knows only with «ё».
- Intonation follows punctuation:
?raises the end of a question,!exclaims,,—:…make pauses. - Question focus: put
^before the word the question is about:Ты купил ^хлеб?. If that word does not rise, the runtime raises its stressed syllable. Without^the focus is the last stressed word. - Numbers: times, amounts and counts are spelled out;
$,€,£,₽amounts become words with the right form ($906 тысяч→ «906 тысяч долларов»). Dates, years and numbers after a preposition take their case:3 мая→ «третьего мая»,в 2026 году→ «в две тысячи двадцать шестом году»,с 5 до 7→ «с пяти до семи». - Words with two dictionary stresses take their stress from context for 232 words (v0.4.5); the rest (
воды) take the reading RUAccent chose most often in the training texts. Mark stress with+where it matters. - English: write English words in Latin letters (
Windows,iPhone). Acronyms in a Russian sentence are read with Russian letter names; to have one read as a word, write it in Cyrillic (НАСА).
PyTorch
pip install "tiny-vanya[torch] @ https://huggingface.co/region23/tiny-vanya/resolve/v0.4.5/code/tiny_vanya-0.4.5-py3-none-any.whl"
hf download region23/tiny-vanya --revision v0.4 --include "pytorch/*" --local-dir tiny-vanya
python -m tiny_vanya.infer --checkpoint tiny-vanya/pytorch/acoustic-m1.pt --vocoder tiny-vanya/pytorch/vocoder.pt \
--voice M1 --text "Добрый вечер! Как дела?" --output hello.wav
Options: --speed, --pitch-shift, --pitch-range, --device (cpu, cuda, mps).
Core ML (iPhone, Mac)
Core ML needs every tensor size to follow from the input sizes. The number of audio frames depends on the predicted durations, so the model is split into two packages, with a short step between them:
*-durations.mlpackage:tokens, stress, voice, speed → hidden, durations.- Host: lay frames out over tokens (
frame_layoutintiny_vanya/export_coreml.py; the Swift port is inswift/TinyVanyaCoreML.swift). Pad to the nearest fixed length. *-speech.mlpackage:hidden, tokens, voice, index, features, pitch_shift, pitch_range → audio. Cut the audio to the real length.
On a Mac mini M4 Pro, Core ML puts the speech graph on the Neural Engine for lengths up to 2048 frames. In a listening test, float16 sounded the same as PyTorch. Text → phonemes is not yet ported to Swift: phonemize on the host with tiny_vanya.text.phonemize (eSpeak NG, the dictionary from the JSON and dizione for English).
How it was trained
- Voices. Qwen3‑TTS VoiceDesign made one reference clip per voice from a text description.
- Corpus. Qwen3‑TTS Base read about 31 500 Russian sentences in each voice (63 000 clips): Common Voice (CC0), Tatoeba, Wikipedia, dialogue texts, plus templates for numbers, questions and names. Whisper screened every clip. 53 668 clean clips (72 h) were used.
- Front end. eSpeak NG
rugives the phonemes. Stress comes from RUAccent and a hand‑checked dictionary (about 300 corrections). Numbers are spelled out withnum2words. - Student. The acoustic model is trained on mel targets with mel critics on the full band and on the band below 2 kHz. Its decoder is conditioned on recorded pitch, and a harmonic comb built from that pitch tells it where the harmonics belong. This removed the "robotic" buzz the earlier versions had. The vocoder is trained separately on recorded mels.
- English (v0.4). 7,000 English and mixed sentences read by the same teacher in both voices, screened with Whisper in the sentence's language; English words are phonemized with dizione. Both checkpoints were fine-tuned for six hours with English and mixed clips sampled twice as often.
What's new in v0.2
- Question guard. On some word combinations the model read a yes/no question as a statement. After synthesis the runtime now checks the rise on the question's focus syllable and, if it is under 3 semitones, raises the pitch there and synthesizes once more (
tiny_vanya/intonation.py, the same in the browser). Questions that already rise are left alone. ^focus markup (the word the guard checks) and thepitch_offsetinput /prosodyoutput in every graph (ONNX, browser, Core ML).- Front end: ё restored from the dictionary, the usual stress of dictionary homographs, English words with Russian sounds, currency amounts (
$906 тысяч→ «906 тысяч долларов»), a line break ends a sentence, a dash pauses. - v0.2.1: the pitch offset is smoothed over about 0.2 s inside the graph (a step at token edges was heard as a warble), and
^only picks the word to check, without pulling the words after it down. - The v0.1 files stay under the git tag
v0.1.
Limitations
- Two fixed voices; no voice cloning.
- English is American only. English words inside Russian sentences are clearer than in v0.3 but still less clear than in the teacher's speech; rare names may be read with the wrong stress.
- In the browser demo the English front end (dizione in Pyodide, about 15 MB) loads at the first text with Latin letters.
- Questions rise less at the end than in the teacher's speech.
- Rare words outside both stress dictionaries take eSpeak NG stress, which is wrong in about 3–4 % of long words. Homographs outside the 232 context words are not resolved by context.
- The models are larger than the original tiny‑voca (36M vs 4.5M parameters): 150 MB per voice in float32.
License
- Code (
code/,swift/): Apache‑2.0, derived from tiny-voca (Apache‑2.0). SeeLICENSEandNOTICE. - Weights and the stress dictionary: the dictionary includes stress marks derived from the Dialogs corpus, and the models were trained on phonemes from it. They are therefore distributed under the Dialogs OpenRAIL license with its use restrictions (
LICENSE-Dialogs-OpenRAIL.md). Commercial use is allowed; the use restrictions in Section 2 apply to you and to anyone you pass the model on to. - The English front end, dizione, is Apache‑2.0; its built data in the wheel includes CMUdict (BSD-style licence,
LICENSE.cmudict) and homograph data (Apache‑2.0). - v0.4 training texts: Tatoeba (CC BY 2.0 FR), Common Voice (CC0), Russian Wikipedia (CC BY-SA 4.0). The texts are not redistributed.
- The teacher, Qwen3‑TTS, is Apache‑2.0. eSpeak NG (installed by
espeakng-loader) is GPL‑3.0 and is a separate runtime dependency; it is not included in this repository.
Please do not use the voices to impersonate real people or to mislead listeners about whether speech is synthetic.