Skip to content

How-ToOS

How to Use Text-to-Speech in Ollama With the Phonon Model

How to use Ollama's text-to-speech feature with the Phonon model: update to v0.40.9 or later, pick a voice, read a chat model's answers aloud, save WAV files and call the OpenAI-compatible speech API.

By , Systems & Technical Editor

3 min read

How to Use Text-to-Speech in Ollama With the Phonon Model

Ollama, the free app for running AI models on your own PC, can now turn text into speech as well as generate it. Its speech feature uses a model called Phonon, and Ollama's documentation shows it running through the same ollama run command and local API as its chat models. This guide follows Ollama's official speech documentation.

For other local voice tools, see how to run text-to-speech locally, and for the reverse job, how to transcribe audio locally with Whisper.

Step 1: Update Ollama

Ollama says you need v0.40.9 or later. On Windows, see how to update Ollama on Windows. Check your version with:

ollama --version

Step 2: Download Phonon

Pull the model as you would any other:

ollama pull phonon

Ollama says Phonon uses Gradium's 31M English checkpoint and comes with Gradium's English voices, such as Zoey, Easton and Freya. Without a voice set, it uses the checkpoint's own voice, called default. To list every voice, run:

ollama show phonon

Ollama says voice names work in any case and with or without accents.

Step 3: Speak from the terminal

ollama run plays the audio through your PC's speakers:

ollama run phonon "Hello from Ollama."
ollama run phonon --voice Zoey "Hi, this is Zoey."

On Windows, Ollama says audio plays through PowerShell; on Linux it uses the first of paplay, pw-play, aplay or ffplay that's installed, and on macOS afplay. If you hear nothing, check your output device; see how to fix no sound in Windows 11.

Run ollama run phonon with no text to get a >>> prompt where each line is spoken when you press Enter. Press Ctrl+C to stop speaking, and type /bye or press Ctrl+D to exit.

Step 4: Have a chat model's answer read aloud

You can pipe text from another program, including another Ollama model, into Phonon. Ollama's example is:

ollama run gemma4 --hidethinking "Tell me a fun fact about owls in two sentences." | ollama run phonon

Ollama says piped text is spoken as it arrives, so a chat model's answer starts playing after its first sentence or two. This example uses the gemma4 chat model; for downloading and managing models, see how to manage Ollama models.

Step 5: Save speech to a file

When you redirect the output, ollama run writes a WAV file instead of playing it:

ollama run phonon "Save this to a file." > speech.wav

Ollama says this also works on servers without speakers. To use a speech model running on another machine, set OLLAMA_HOST to that server, and the audio plays where the command runs.

Step 6: Use the speech API in your own apps

Ollama provides an OpenAI-compatible /v1/audio/speech endpoint. A minimal request is:

curl http://localhost:11434/v1/audio/speech -H "Content-Type: application/json" -d '{"model": "phonon", "input": "Hello from Ollama.", "voice": "default"}' --output speech.wav

Ollama's documentation also shows Python and JavaScript examples using the OpenAI libraries with base_url set to http://localhost:11434/v1. For more on that approach, see how to use Ollama's OpenAI-compatible API.

The default output is a 16-bit, mono, 24kHz WAV file; pcm gives raw samples with no header.

Limits to know about

  • Length: Ollama says input can be up to 4,096 characters per request through the API; ollama run splits longer text at paragraph and sentence breaks for you.

  • Numbers and dates: prices, numbers, symbols, email addresses and URLs are spelled out, but Ollama says numeric dates are read as written, so write dates out in full.

  • Formatting: emoji, bullet characters and markdown markers are skipped.

  • Language: Phonon's voices are English.

  • Speech only: chat, completion and embedding requests to Phonon return an error, and unsupported options such as speed return a 400 error rather than being ignored.

Our verdict

If you already use Ollama, Phonon is the quickest way to add local text-to-speech: update to v0.40.9 or later, pull phonon, and either pipe text into it or call the OpenAI-compatible speech endpoint. It comes with English voices and has a few formatting quirks, and it runs on your own PC or a server you point it at.

The bottom line

If you already use Ollama, Phonon is the quickest way to add local text-to-speech: update to v0.40.9 or later, pull `phonon`, and either pipe text into it or call the OpenAI-compatible speech endpoint. It comes with English voices and has a few formatting quirks, and it runs on your own PC or a server you point it at.

Sources

  1. 01Ollama: Speech

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Run LM Studio Headless With llmster (No GUI Needed)

How-To

How to Run LM Studio Headless With llmster (No GUI Needed)

How to run LM Studio as a background service without its window: install the llmster daemon, start it with lms daemon up, load models and start the server, or run the desktop app's server on login, plus JIT loading.

Marcus Thorne3 min

How to Run Ollama in Docker With NVIDIA or AMD GPU Support

How-To

How to Run Ollama in Docker With NVIDIA or AMD GPU Support

How to run Ollama in Docker on Linux using Ollama's official commands: CPU only, NVIDIA GPUs via the NVIDIA Container Toolkit, AMD GPUs with the ROCm image, Vulkan, then running a model and connecting other apps.

Marcus Thorne3 min

How to Update the Intel NPU Driver on a Core Ultra PC

How-To

How to Update the Intel NPU Driver on a Core Ultra PC

How to update the Intel NPU (AI Boost) driver on a Core Ultra PC: which processors and Windows 11 versions Intel supports, how to check your version, installing 32.0.100.5600 and rolling back if an AI app misbehaves.

Marcus Thorne2 min