Setup
Start Ollama v0.40.8 or later, then download Phonon:setup.sh
Freya (the default), Harper, Sterling, and Toby. Voice names are case-sensitive.
Speak from the terminal
ollama run plays the audio through your computer’s speakers:
examples.sh
ollama run phonon without any text to type lines at a >>> prompt. Each line is spoken when you press Enter. Press Ctrl+C to stop speaking, and type /bye or press Ctrl+D to exit.
Audio plays with your system’s built-in player: afplay on macOS, the first of paplay, pw-play, aplay, or ffplay that is installed on Linux, and PowerShell on Windows.
Save audio to a file
When the output is redirected,ollama run writes a WAV file instead of playing it. This also works on servers without speakers:
ollama on your own computer and point it at the server. The audio plays where the command runs:
Generate speech with the API
Use the OpenAI-compatible/v1/audio/speech endpoint:
- cURL
- Python
- JavaScript
Audio formats
Limits
inputcan be up to 4,096 characters per request.ollama runsplits longer text at paragraph and sentence breaks for you.- Text is spoken as written. Numbers, dates, and abbreviations are not expanded into words, so write them out (
twenty-one, not21) for predictable results. Emoji, bullet characters, and*emphasis markers are skipped. - Options the model doesn’t support, such as other formats, speeds, or
instructions, return a400error instead of being ignored. An unknown voice returns a400error that lists the available voices. - Speech models only generate speech: chat, completion, and embedding requests to them return a
400error.
ollama show phonon and /api/show list the model’s capabilities as speech. See OpenAI compatibility for every supported field.
