AI

Ollama Text to Speech: Run Phonon on a Mac (Tested)

Ollama text to speech with Phonon works today, but only on a Mac with Apple Silicon. Pull the model, pass it a sentence, and you get a 24 kHz WAV back from the same server that runs your chat models, through either ollama run or an OpenAI-style /v1/audio/speech endpoint.

Original content from computingforgeeks.com - post 202999

If you’re on Linux or Windows, Phonon is a no: it needs the MLX runtime, and a stock Linux install refuses to even pull it. You can still drive a Mac’s Phonon from a Linux box over the network, and Ollama’s release notes point to Liquid AI’s LFM3 audio models for speech on Linux and Windows. Both are covered near the end, with two other Linux options.

This guide pulls each tag, checks the licence each one ships under, scripts the API with curl and Python, triggers every 400 error the endpoint returns, and times cold and warm requests. Run on a Mac mini with an M4 chip and 24 GB of memory, macOS 27.2.1 and Ollama 0.40.19 in December 2026.

Understand Ollama speech models

A speech model in Ollama is a model whose capability list says speech instead of completion. It takes text and returns audio, nothing else, so there is no prompt template, no context to manage and no tokens to count. Phonon, from Gradium, is the first one in the library. Ollama describes it as Gradium’s 31M English checkpoint, while ollama show counts 43.49M parameters in the default tag, and either way it fits in under 200 MB of memory once it’s loaded. Because it is that small, you can leave it running beside a chat model without planning memory around it.

Because it isn’t a chat model, the chat endpoints reject it outright. You talk to it through three doors, and each one suits a different job:

  1. ollama run phonon "text" speaks through the speakers when stdout is a terminal.
  2. ollama run phonon "text" > file.wav writes a WAV when stdout is redirected.
  3. POST /v1/audio/speech returns WAV or raw PCM to any HTTP client.

Ollama’s speech capability docs say the text is normalised before synthesis: numbers and prices get spelled out and markdown markers are skipped. Times and numeric dates are read as written, though, and the library page warns that headings may still be read aloud, so ask a chat model for plain sentences before you pipe its answer in.

Check the requirements first

Hardware is where most attempts fail. Phonon runs on Ollama’s MLX runner, and the Phonon library page states that its packages require Apple Silicon. Ollama does publish an MLX add-on built on CUDA for Linux and Windows, but the standard install script never fetches it, and neither the library page nor any release note lists Phonon as supported there. On a stock install, an Intel Mac, a Linux server or a Windows desktop won’t load it, however much memory or VRAM it has. If your Ollama box is a GPU server, skip ahead to the Linux section before you pull anything.

RequirementWhat you needWhere it’s stated
ChipApple SiliconOllama library page for Phonon
OllamaA current 0.40.x buildrequires line in ollama show
MemoryAbout 180 MB for the default tag once loadedollama ps in this lab
Disk104 to 148 MB per tagOllama tags page

Version numbers disagree a little between sources. The docs and the model metadata ask for a slightly older minimum than the launch announcement does, which matters only if you’re pinned to an old build. Do not chase the difference: install the current release and you clear both. If Ollama is not on the Mac yet, the Homebrew cask is the quickest route:

brew install --cask ollama-app

Get the server up before pulling anything:

  1. Open the Ollama app once so the server starts in the background.
  2. Run ollama --version and check that it prints a version, not a connection warning.
  3. Run sw_vers if you’re unsure which macOS the machine is on.

Both outputs from the test Mac appear in the first screenshot below.

Pull Phonon and pick a tag

Most people want the default tag. It is small, it carries every voice, and its licence lets you use the audio commercially. Pull it:

ollama pull phonon

The download took just under 19 seconds here, and ollama list shows a 112 MB model:

ollama pull phonon on macOS, the pull timing and ollama list output

Next, read the model card from the CLI. ollama show lists the capability, the full voice list and the licence in one go, which saves a trip to the website:

ollama show phonon

Look for speech under Capabilities and the Voices block. There are 38 entries, counting default, from plain names like Freya and Hugh to character voices like Grub the Ogre:

ollama show phonon listing the speech capability, 38 voices and the Apache 2.0 licence

Your app reads from this same voice list. Any name in that block works as the voice field, and matching is not case sensitive: zoey and Zoey both returned 200. Names with spaces, such as Grub the Ogre, need quotes on the CLI, so test those once before you wire them into a script.

Read the licence before you pick a tag

Phonon ships under two licences. The launch post puts phonon under Apache 2.0 and the 40M models, the tags starting with 40m-, under CC BY-NC 4.0, which bars commercial use. Pulling the two English variants side by side shows a second catch:

ollama pull phonon:31m-en
ollama pull phonon:40m-en
ollama show phonon:31m-en --license | head -5
ollama show phonon:40m-en --license | head -5
ollama run phonon:31m-en --voice Zoey "Hello" > x.wav

The 31m-en tag is Apache 2.0, while 40m-en points to Gradium’s Hugging Face repo under CC BY-NC 4.0. The last line asks the small tag for a named voice:

Phonon tags compared: 31m-en under Apache 2.0, 40m-en under CC BY-NC 4.0, and the voice not found error on 31m-en

Notice the last error. The 31m-en tag has one voice, default, so asking it for Zoey fails with exit code 1 and leaves an empty file behind. A script that only checks whether the file exists would carry on with zero bytes of audio, so check the exit code too. Side by side, the three tags look like this:

TagParametersSizeVoicesLicence
phonon (latest)43.49M112 MB38Apache 2.0
phonon:31m-en41.12M103 MB1 (default)Apache 2.0
phonon:40m-en52.93M131 MB38CC BY-NC 4.0

Only the default phonon tag is both commercially usable and voiced. The library readme calls it an alias of 31m-en, but the tags page and ollama show give it a different digest and 38 voices, so treat it as a separate build. Watch phonon:en, though: the tags page gives it the same digest as 31m-en, so it has the single voice too. The German, Spanish, French, Portuguese and multilingual tags are 40M checkpoints under CC BY-NC 4.0 per the readme; English 31M is the only Apache 2.0 checkpoint. Run --license on whichever tag you ship. Audio made with a CC BY-NC tag cannot go into a paid product or a client’s app.

Speak text with ollama run

The CLI decides what to do with the audio based on where stdout goes. Redirect it and you get a WAV file. Pick a voice with --voice:

ollama run phonon --voice Zoey "Your build finished in four minutes and twelve seconds." > zoey.wav

Check the file with afinfo, which ships with macOS. You’re looking for one channel at 24000 Hz, 16-bit:

afinfo zoey.wav | grep -E "File type|Data format|estimated duration|audio bytes"

The first run took 2.8 seconds because it was the very first load after the pull, and later runs were far quicker. Drop the redirect and Ollama plays the clip through the default output instead, returning once it finishes:

ollama run phonon with --voice Zoey saving a 24 kHz mono WAV, checked with afinfo

Scripts can hit one trap here. Ollama reads piped stdin as text to speak, so a command launched over a non-interactive SSH session or from a wrapper that leaves stdin open can sit waiting for input that never comes. That happened in this lab when commands ran over plain ssh host 'command'. Adding < /dev/null whenever the text comes from the argument rather than a pipe fixed it, and the command returned as soon as the WAV was written.

Pipe a chat model into Phonon

That stdin behaviour is also what makes chaining work. A chat model’s answer can go straight into Phonon, and tee keeps a text copy. This uses the small Gemma 4 model, but any chat model you’ve pulled will do:

ollama run gemma4:e2b --hidethinking "In two sentences, why should I rotate SSH keys?" < /dev/null | tee answer.txt | ollama run phonon --voice Hugh > answer.wav

The whole chain took 15.5 seconds, and most of that was loading the 7.4 GB chat model cold, since Phonon itself renders that much speech in well under a second. It produced 15.8 seconds of audio, and ollama ps showed both models on the GPU at once:

gemma4:e2b answer piped into ollama run phonon to produce a spoken WAV

Keep --hidethinking on reasoning models so only the final answer reaches Phonon. For picking a chat model that fits next to Phonon in memory, the Ollama models by VRAM cheat sheet has the sizes.

Call the speech API with curl

Apps talk to /v1/audio/speech, the HTTP route. It follows OpenAI’s speech request shape on Ollama’s usual port, with no API key needed locally:

curl -s http://localhost:11434/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model":"phonon","voice":"Zoey","input":"Hello from Ollama on a Mac mini."}' \
  --output speech.wav

Add "response_format":"pcm" to the body if you’d rather have raw samples with no header, in the same 24 kHz mono 16-bit layout. The WAV response is worth a closer look, because it’s streamed:

curl call to the Ollama /v1/audio/speech endpoint returning a chunked audio/wav response

Ollama sends the WAV with Transfer-Encoding: chunked, and the hex dump shows the side effect: both size fields in the WAV header are ffffffff, because the server starts sending before it knows the length. First audio arrived after 66 ms here, which is what makes streaming worth it. afinfo handled the file fine, but a parser that trusts those header sizes may not, so read to the end of the stream and work out the length from the bytes you got.

Use the OpenAI Python SDK

Because the endpoint speaks OpenAI’s format, the official openai package works once you change the base URL. The key can be any string, since a local Ollama server does not check it. Set up a virtual environment first:

python3 -m venv .venv
.venv/bin/pip install openai

Then save this as speak.py. It’s the exact script from the lab, using the streaming response so the WAV lands on disk as it arrives:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")

with client.audio.speech.with_streaming_response.create(
    model="phonon",
    voice="Freya",
    input="Disk usage on the backup volume crossed eighty five percent.",
    response_format="wav",
) as response:
    response.stream_to_file("alert.wav")

print("saved alert.wav")

Run it with .venv/bin/python speak.py. It printed saved alert.wav about a second later, and the file came out at 3.6 seconds of 24 kHz audio:

OpenAI Python SDK script calling Ollama text to speech with the Freya voice and saving alert.wav

Porting existing OpenAI code takes up to three changes, because code written for OpenAI usually asks for mp3 and a voice such as alloy, and Phonon rejects both:

  1. Point base_url at http://localhost:11434/v1.
  2. Change any mp3 format to "wav" or "pcm", or drop the argument, since WAV is Ollama’s default.
  3. Swap the voice for a name from ollama show phonon.

Anything else your code sends, such as speed or instructions, has to go as well, and the next section shows what each one returns.

Fix the 400 errors

The endpoint accepts OpenAI’s request shape but only part of its options, and it says so with a 400 instead of ignoring them. Every error below came back from the same server, with U set to the speech URL:

Ollama speech API 400 errors for mp3 format, speed, instructions, the 4096 character limit and chat requests

Each message names its own fix, so you can work through them by what you change in the request.

Error: response_format “mp3” is not supported, use wav or pcm

Only wav and pcm exist. If your app needs MP3 or Opus, request WAV and convert it on your side, since the server won’t encode anything else.

Error: only speed 1 is supported

Drop the speed field or set it to 1. A client library that always sends a speed value will need that line removed, because even 1.5 gets a hard 400.

Error: instructions are not supported

OpenAI’s newer speech models accept a style prompt, and Phonon doesn’t. Pick a voice for the tone you want instead: the character voices are where the variety lives.

Error: voice “alloy” not found

OpenAI’s voice names don’t map to anything. The error lists every valid voice, so copy one from it. Leaving the voice field out entirely still returns 200.

Error: input must be at most 4096 characters

Exactly 4,096 characters returned 200 and 4,097 got the 400. According to the docs, ollama run splits longer text for you, but over HTTP you split it yourself, ideally on sentence boundaries so the joins don’t land mid-word.

Error: “phonon” does not support chat

Both /api/chat and /v1/chat/completions return this. If a chat frontend offers Phonon in its model picker, selecting it there produces this error. A model you haven’t pulled gives a 404 with try pulling it first instead.

Measure cold start and warm latency

Latency decides whether Phonon fits a voice assistant or just batch narration, so the lab timed it from curl. The script sends a 44-character sentence and a 1,114-character paragraph three times each while the model is loaded. Then it runs ollama stop phonon and sends each one again cold:

Phonon warm and cold latency on an Apple M4 Mac mini, short and long inputs, with ollama ps showing the mlx runner

Add a server restart and two CLI timings, and you get the full picture:

CaseFirst byteDoneAudio produced
Warm, short sentence14 to 19 ms91 to 106 ms2.7 s
Warm, long paragraph8 to 101 ms1.33 to 1.58 sabout 63 s
Cold after ollama stop, short337 ms424 ms2.7 s
Cold after ollama stop, long339 ms1.73 s63.3 s
First request after server restart332 ms410 ms2.7 s
ollama run to WAV, cold / warmn/a319 ms / 82 ms2.7 s

A cold start costs about a third of a second on this M4. The server log shows the MLX runner going from start to ready in roughly 200 ms, so there is little reason to pin the model in memory with a long keep-alive. Warm, a minute of speech renders in about 1.4 seconds, or roughly 40 to 48 times faster than real time. That is fast enough for a voice reply that starts before the user notices a pause, as long as you send it a sentence at a time.

Memory is just as light. ollama ps puts the default tag at 177 MB and 31m-en at 119 MB, both fully on the GPU, so you can keep Phonon loaded next to a chat model on a 16 GB Mac without pushing either one out. The only multi-second wait in the whole lab was the very first run after the pull. For working with MLX models directly, outside Ollama, see mlx-lm on Apple Silicon.

Run Ollama TTS on Linux and Windows

On a stock Linux install Phonon doesn’t run, and it fails at the pull, before any audio is attempted. On a fresh Ubuntu VM with Ollama from the official install script, same release as the Mac, the pull stops on MLX:

curl -fsSL https://ollama.com/install.sh | sh
ollama pull phonon

You’ll get Error: this model requires MLX support, but the MLX runtime is not available, and the API then answers with a 404 because nothing was downloaded. The launch post says Windows and Linux support is coming soon, and no release note since then mentions Phonon on either.

Ollama TTS on Ubuntu failing with the MLX runtime error, then working through OLLAMA_HOST pointed at a Mac

Below the error is the workaround. If you have a Mac on the network, the Linux CLI can use the Mac’s server, and the WAV is written on the Linux side, because only synthesis needs MLX. An SSH tunnel is the safest way in, since Ollama has no authentication and you’d rather not open port 11434 to the LAN:

  1. Turn on Remote Login on the Mac under System Settings > General > Sharing, since macOS ships with SSH off.
  2. Forward a local port on the Linux box to the Mac’s port 11434.
  3. Point OLLAMA_HOST at that local port.
  4. Run Phonon as usual and redirect to a file.

On the Linux side you run these three lines. Swap joshua@qs-01 for your Mac’s username and hostname or IP:

ssh -f -N -L 11500:127.0.0.1:11434 joshua@qs-01
export OLLAMA_HOST=http://127.0.0.1:11500
ollama run phonon --voice Zoey "This audio was generated on the Mac and saved on Linux." > remote.wav

That returned in 0.4 seconds with a valid 24 kHz WAV. The Ollama commands cheat sheet covers OLLAMA_HOST and the other client variables if you’d rather bind the Mac’s server to the network directly.

With no Mac in the picture, Ollama itself has one other route. The release notes from late October say Liquid AI’s LFM3 models, including the speech output in lfm3-audio and lfm3-omni, run on Linux and Windows as well as Apple Silicon. LFM3-Audio is a 2B model that can reply in text, speech or both, so it’s a voice chat model rather than a drop-in replacement for Phonon. Its library page documents /api/chat rather than the speech endpoint, so plan on different client code.

Outside Ollama, two engines run natively on Linux and expose the same /v1/audio/speech path, so the curl and Python code above carries over with a new base URL, model, voice and an API key header:

  • LocalAI serves text to speech next to chat models in one OpenAI-compatible API, on CPU or GPU.
  • VoiceStudio adds voice cloning and its own speech endpoint, in Docker.

If what you actually need is the other direction, speech to text on Linux, Yogurt transcribes recorded meetings locally and turns them into notes.

Keep this reference card

Everything above in one table, for when you just need the call:

TaskCommand or value
Pull the voiced, Apache 2.0 modelollama pull phonon
List voices and licenceollama show phonon
Speak aloudollama run phonon --voice Hugh "text"
Save a WAVollama run phonon --voice Zoey "text" > out.wav
HTTP endpointPOST http://localhost:11434/v1/audio/speech
Formatswav, pcm (24 kHz, mono, 16-bit)
Input limit4,096 characters per request
Rejected optionsmp3, speed other than 1, instructions, OpenAI voice names
Phonon platformsmacOS on Apple Silicon only; a stock Linux install fails on MLX

Pick the default tag unless you need the non-commercial 40m model, and keep your request bodies to the fields this card lists.

Keep reading

Run Amazon Ergo Locally: Hardware Requirements and vLLM Setup AI Run Amazon Ergo Locally: Hardware Requirements and vLLM Setup Open Source LLM Comparison Table (2026) AI Open Source LLM Comparison Table (2026) Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI NAS Explained: Is Local AI on a NAS Worth It? AI AI NAS Explained: Is Local AI on a NAS Worth It? MedGemma 2 vs Gemma 4 vs MedGemma 1.5: Local Benchmark AI MedGemma 2 vs Gemma 4 vs MedGemma 1.5: Local Benchmark Best AWS AI Practitioner and ML Engineer Books for AIF-C01 and MLA-C02 AI Best AWS AI Practitioner and ML Engineer Books for AIF-C01 and MLA-C02

Leave a Comment

Press ESC to close