Skip to main content

simple FastAPI server to host TTS plugins as a service

Project description

OpenVoiceOS TTS Server

Turn any OVOS TTS plugin into a microservice — a small, stateless FastAPI app that exposes a TTS plugin over HTTP.

Install

pip install ovos-tts-server

# Optional: enable non-WAV output (mp3, ogg, flac, ...) via pydub
pip install "ovos-tts-server[audio]"

Companion plugin

Use in your voice assistant via the companion TTS plugin.

Configuration

The plugin is configured the same way as if it were running inside the assistant — through mycroft.conf:

{
  "tts": {
    "module": "ovos-tts-plugin-piper",
    "ovos-tts-plugin-piper": {
      "model": "alan-low"
    }
  }
}

Usage

ovos-tts-server --help
usage: ovos-tts-server [-h] [--engine ENGINE] [--port PORT] [--host HOST] [--cache]

options:
  -h, --help       show this help message and exit
  --engine ENGINE  tts plugin to be used
  --port PORT      port number (default: 9666)
  --host HOST      host (default: 0.0.0.0)
  --cache          save every synth to disk

Example — serve the GladosTTS plugin:

ovos-tts-server --engine neon-tts-plugin-glados --cache

Then GET http://localhost:9666/synthesize/hello.

Endpoints

Method Path Description
GET /status Plugin name, supported languages, default voice/model
GET /v2/synthesize?utterance=<text>[&lang=...][&voice=...] Primary synthesis endpoint — returns WAV audio
GET /synthesize/<utterance> Legacy path-based synthesis endpoint

CORS is enabled for all origins.

Third-party API compatibility

The server can additionally expose its underlying TTS plugin behind drop-in compatibility endpoints for popular cloud TTS APIs — MaryTTS, ElevenLabs, OpenAI, Coqui, Google Cloud TTS, Amazon Polly, Azure, and Piper. Each vendor lives under its own URL prefix so multiple compat layers coexist with no path collisions. Auth tokens are accepted and silently ignored — wrap behind a reverse proxy if you need real auth.

See docs/api-compatibility.md for the full reference.

Documentation

Docker

Build a small image that serves any plugin:

FROM python:3.11-slim

RUN pip install --no-cache-dir "ovos-tts-server[audio]" {PLUGIN_HERE}

ENTRYPOINT ["ovos-tts-server", "--engine", "{PLUGIN_HERE}", "--cache"]
docker build . -t my_ovos_tts_plugin
docker run -p 8080:9666 my_ovos_tts_plugin

Then GET http://localhost:8080/synthesize/hello.

Each plugin can ship its own Dockerfile in its repository using ovos-tts-server.

Development

pip install -e ".[audio,test]"
pytest test/ -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_tts_server-1.1.0a1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_tts_server-1.1.0a1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file ovos_tts_server-1.1.0a1.tar.gz.

File metadata

  • Download URL: ovos_tts_server-1.1.0a1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ovos_tts_server-1.1.0a1.tar.gz
Algorithm Hash digest
SHA256 f0f0f8daad0a06f136b6a215acd2747b9d4ee97245412ab217d1955b7c5d95c9
MD5 817a5d4a5acd6e102eaf8f2f7176b32e
BLAKE2b-256 d8cf50d8d9674f55807187aa711a3b0f24931397f31944d2aa9d59dc63d5dad4

See more details on using hashes here.

File details

Details for the file ovos_tts_server-1.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_tts_server-1.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c9c204b778bbe4dcfee58e1ca1f1671267fe47b34b142bece90f7e18859b037
MD5 5e172f1a108009d29f4cceb32c65b843
BLAKE2b-256 fc1bc7e535c43e80f9d1521457a195d72ab4acf71b58cacd1049967a060b821d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page