logo

Mobile Artificial IntelligenceMobile AI

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

PlatformArchitectureLibrary
Linuxx86_64libbabylon.so
macOSUniversal (x86_64 + arm64)libbabylon.dylib
Windowsx86_64babylon.dll
Androidarm64-v8a, x86_64libbabylon.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.

View all guides →

Babylon.cpp is MIT licensed and actively developed.

Contribute on GitHub →