Babylon.cpp
Local G2P and Neural TTS
A free, open-source C and C++ library for grapheme-to-phoneme conversion and neural text-to-speech synthesis. Kokoro (54+ voices) and VITS/Piper engines — all running locally via ONNX Runtime, zero internet required.
Features
Fully Local Inference
All G2P and TTS inference runs on-device via ONNX Runtime. No internet connection is required and no text or audio ever leaves the host machine.
Kokoro Engine
High-quality multi-voice neural TTS at 24 kHz. 54+ voices across English (US/UK), German, French, Japanese, Chinese, and more.
VITS / Piper Engine
End-to-end neural TTS compatible with Piper model files. Sample rate is determined by metadata embedded in the model.
Open Phonemizer G2P
Text is phonemized via a ~130,000-entry pronunciation dictionary and an ONNX neural G2P model for out-of-vocabulary words.
REST API & Web UI
Built-in HTTP server with a single-page web frontend. Supports /phonemize and /tts endpoints — ideal for local integrations.
C and C++ APIs
A stable C API for FFI use from any language, plus higher-level C++ session classes for OpenPhonemizer, Kokoro, and VITS.
Python Bindings
Pre-built Python package bundling compiled libraries for Linux, macOS, and Windows. Drop-in access to all G2P and TTS functions.
Cross-Platform
Builds on Linux (x86_64), macOS (universal), Windows (x86_64), and Android (arm64-v8a, x86_64) from a single CMake project.
Platform Support
| Platform | Architecture | Library |
|---|---|---|
| Linux | x86_64 | libbabylon.so |
| macOS | Universal (x86_64 + arm64) | libbabylon.dylib |
| Windows | x86_64 | babylon.dll |
| Android | arm64-v8a, x86_64 | libbabylon.so |
Quick Start
Build from source with a single command. Requires CMake 3.18+, a C++17 compiler, and Git.
git clone --recursive https://github.com/Mobile-Artificial-Intelligence/babylon.cpp.git cd babylon.cpp make cli
All output goes to bin/. The cli target builds the library, CLI binary, and copies runtime files.
Guides
Step-by-step guides for building, integrating, and using Babylon.cpp.
Getting Started
Build babylon.cpp from source, set up model files, and run your first synthesis.
Read guide →CLI Usage
Use the babylon CLI to phonemize text, synthesise speech, and serve the REST API.
Read guide →REST API
Integrate local TTS and G2P into any app via the built-in HTTP endpoints.
Read guide →C / C++ API
Embed babylon.cpp directly in your C or C++ project using the native library API.
Read guide →Python Wrapper
Use the pre-built Python package for G2P and TTS without compiling anything.
Read guide →