Speech models in Ollama

Source: Ollama•

Speech models in Ollama

Ollama now supports speech models, starting with Phonon from Gradium. Read text aloud in five languages and dozens of voices, streamed as it is generated, over 100 times faster than real time on Apple Silicon.

Ollama can now turn text into speech. The first speech model is Phonon, a family of small, state-of-the-art text-to-speech models from Gradium. Speech models are now available for macOS, with Windows and Linux support coming soon.

Unedited output from Ollama 0.40.11 on a MacBook Pro with M5 Max.

Performance on Apple Silicon

On Apple Silicon, Ollama is accelerated by MLX, Apple’s machine learning framework, for state-of-the-art throughput. On a MacBook Pro with M5 Max, Ollama was 35% faster than the next fastest engine, Gradium’s own runtime.

Throughput

Times faster than real time

Measured on a MacBook Pro with M5 Max, generating 45 seconds of speech. Median of 10 runs. Gradium's own runtime, ptts, uses 8-bit weights on the CPU, fp16 on the Neural Engine and f32 on the GPU; Ollama runs the model in bf16.

Ollama’s implementation is just as accurate, matching the word error rate of the reference implementation in Hugging Face Transformers:

Accuracy

Word error rate

Lower is better. 200 sentences from the Seed-TTS English test set, transcribed with Whisper large-v3.

Voices

Choose a voice with --voice, or voice in the API:

The voices come from Gradium’s voice catalog. ollama show phonon lists them all.

Languages

phonon is released under Apache 2.0. The 40M models are released under CC BY-NC 4.0, which limits them to noncommercial use.

Pipe a chat model’s reply into Phonon. Text is spoken as it arrives, so the reply starts playing after its first sentence:

Run ollama run phonon with no text to type lines at a prompt, or redirect the output to save a WAV file:

API

Phonon works with the OpenAI-compatible /v1/audio/speech endpoint, so existing code that uses the OpenAI SDK only needs a new base URL.

The response streams while the audio is generated, so it can play right away:

Audio is 24 kHz mono, returned as WAV by default or as raw 16-bit samples with "response_format": "pcm".

Get started

Speech models run on Apple Silicon Macs. Download Ollama 0.40.11 or later, then pull Phonon:

For more information, see:

  • Phonon model page
  • Speech documentation
  • OpenAI compatibility
  • Gradium’s voice catalog

What this article says