Skip to main content

flockspeech

Tiny text to speech that runs on your own device. No GPU, no cloud and no PyTorch: just ONNX Runtime and numpy.

This first release ships Junco v0.1, one English (US) voice at 24 kHz.

pip install flockspeech
flockspeech "Hello! I'm Junco, and I run on your own computer." -o hello.wav --play
from flockspeech import Junco

tts = Junco()                          # loads in under a second
audio = tts("Hello there.")            # float32 numpy array, 24 kHz mono
tts.save("Hello there.", "hello.wav")

for chunk in tts.stream(long_text):    # sentence by sentence: the first audio arrives fast
    play(chunk)

Why it suits small devices

Model files 44 MB, bundled in the package; nothing is downloaded at run time
Runtime onnxruntime + numpy; works offline
Memory about 265 MB peak
Start-up about 0.7 s
Speed on an Apple M1 8.7× real time on 1 thread, 19× on 4 threads
First audio when streaming about 0.25 s on 4 threads

Speed was measured on typical one-sentence replies, vocoder included. Add steps=4 (CLI --steps 4) for 1.5× more speed with slightly rougher audio.

Quality

Quality was measured on 40 unseen LibriTTS-R sentences with UTMOS (a predictor of listener ratings from 1 to 5):

Version UTMOS
Original model (PyTorch, fp32) 4.21
This package (int8 decoder, fp16 storage) 4.18 (difference not significant)
This package with steps=4 4.12

In our wider benchmark of 150 sentences, Junco scored a word error rate of 1.71% with Whisper. Real recordings of the same sentences scored 2.30%.

Options

Option CLI Default Effect
speed --speed 1.0 1.2 talks 20% faster
steps --steps 8 flow-matching steps: fewer is faster
seed --seed 0 fixes the small random variation in delivery
threads --threads up to 4 CPU threads for ONNX Runtime
coreml --coreml off Apple silicon only: runs the vocoder with CoreML. Faster on 1 thread, but uses twice the memory

The CLI also reads text from a file (-f story.txt) or from standard input (echo hi | flockspeech -).

Limits

  • One voice, English (US) only, in a read-aloud style.
  • No text normalisation yet. Write numbers, money and abbreviations out in words ("five dollars", not "$5"; "Doctor", not "Dr.").
  • Long text is split into sentences, and very long sentences are split at commas.
  • Platforms: macOS (Apple silicon and Intel), Linux (x86-64 and ARM64, which includes a 64-bit Raspberry Pi OS) and Windows, wherever onnxruntime and espeakng-loader have wheels.

How it works

  1. espeak-ng turns the text into phonemes.
  2. A transformer encoder and a duration predictor read the phonemes.
  3. A flow-matching decoder draws a mel spectrogram in 8 guided steps.
  4. The Vocos vocoder turns the spectrogram into sound.

The acoustic model has 11.4M parameters and was trained from scratch on LJ Speech.

Licence

The code and the Junco weights are Apache-2.0. The bundled Vocos vocoder weights are MIT (Charactr Inc.). Phonemes come from phonemizer and espeak-ng (through espeakng-loader). Both are GPL-3.0 and are installed as separate dependencies, not included in this package. See NOTICE.

Metadata

Release files for flockspeech 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flockspeech 0.1.0
File Size Uploaded Provenance Actions
flockspeech-0.1.0.tar.gz 39.9 MB Without provenance Details for flockspeech-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flockspeech 0.1.0
File Interpreter ABI Platform Actions
flockspeech-0.1.0-py3-none-any.whl Python 3 none any Details for flockspeech-0.1.0-py3-none-any.whl

Total release size: 79.9 MB

Release files / flockspeech-0.1.0.tar.gz

Download URL flockspeech-0.1.0.tar.gz
Size 39.9 MB
Tags Source
SHA-256 checksum
How to use checksums
7675f42844e3733966ebeccfe49ff493a1c5df02b6558566107d5e0fa7537c61
BLAKE2b-256 checksum
How to use checksums
135845f4e28429ce15dc79068a00400b2ad24419800d649fc165789ae1dbf39d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

Release files / flockspeech-0.1.0-py3-none-any.whl

Download URL flockspeech-0.1.0-py3-none-any.whl
Size 39.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
418387c561f6d09a62288d95945f4324a61501196e32a14b2c40f0910f045cf1
BLAKE2b-256 checksum
How to use checksums
7260b7990f7bd54bc5b0781afe5a06359abc63e1cb03118e69eacf00a2d60772
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

Security for flockspeech 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page