Speech
Revised
Speech models read text aloud. Ollama streams the audio as it's1 generated, so playback can start before the whole text has been spoken.
Setup
Start Ollama version 0.40.92X10 or later, then download Phonon:
ollama pull phonon
Phonon uses Gradium's 31M English checkpoint and comes with Gradium's English voices, such as Zoey, Easton, and Freya. Without a voice, it speaks with the checkpoint's own voice, default. ollama show phonon lists every voice. Voice names work in any case and with or without accents.
Speak from the terminal
ollama run plays the audio through your computer's speakers:X41
# Speak some text
ollama run phonon "Hello from Ollama."
# Choose a voice
ollama run phonon --voice Zoey "Hi, this is Zoey."
# Speak text from another program
echo "Text from another program works too." | ollama run phonon
# Speak a chat model's answer
ollama run gemma4 --hidethinking "Tell me a fun fact about owls in two sentences." | ollama run phonon
Piped text is spoken as it arrives, so a chat model's answer starts playing after its first sentence or two.
Run 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 Waveform Audio File Format (WAV)3 file instead of playing it. This also works on servers without speakers:
ollama run phonon "Save this to a file." > speech.wav
To hear a remote server, run ollama on your own computer and point it at the server. The audio plays where the command runs:X31
OLLAMA_HOST=my-server:11434 ollama run phonon "Hello from the server."
Generate speech with the API
Use the OpenAI-compatible /v1/audio/speech endpoint:
cURL
curl http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "phonon",
"input": "Hello from Ollama.",
"voice": "default"
}' --output speech.wav
Python
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="default",
input="Hello from Ollama.",
response_format="wav",
) as response:
response.stream_to_file("speech.wav")
JavaScript
import fs from 'node:fs'
import OpenAI from 'openai'
const openai = new OpenAI({ baseURL: 'http://localhost:11434/v1', apiKey: 'ollama' })
const response = await openai.audio.speech.create({
model: 'phonon',
voice: 'default',
input: 'Hello from Ollama.',
response_format: 'wav',
})
fs.writeFileSync('speech.wav', Buffer.from(await response.arrayBuffer()))
The response streams while audio is generated, so you can start playing it right away:
curl -sN http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "phonon", "input": "Playback starts while the rest is still being generated."}' \
| ffplay -nodisp -autoexit -loglevel error -
Audio formats
response_format |
Output |
|---|---|
wav (default) |
A WAV file: 16-bit, mono, 24 kHz. The header is written before the length is known, so its size fields hold the maximum value. |
pcm |
Raw 16-bit little-endian samples, mono, 24 kHz, with no header. |
Limits
inputcan be up to 4,096 characters per request.ollama runsplits longer text at paragraph and sentence breaks for you.- Prices, numbers, symbols, email addresses, and URLs are spelled out before speaking, so
$4.59is read as "4 dollars and 59 cents". Times and numeric dates are read as written, so write dates out (October 23, not10/23) for a natural reading. Emoji, bullet characters, and markdown markers such as*and#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, and its voices (voices in /api/show). See OpenAI compatibility for every supported field.
Notes on this page
1 Wording Audit: improved Uses the contraction "it's".
Was:
it is generatedPronounContractionsAuditor: Using “it's” makes the sentence shorter and keeps its meaning.
2 Wording Audit: improved Writes "version" before the number in prose.
Was:
v0.40.9VersionWordAuditor: Writing “version 0.40.9” makes clear that the number is a version.
3 Wording Audit: regression Spells out the abbreviation at its first use.
Was:
WAVSpellOutFirstAuditor: Expanding WAV adds a factual claim, contrary to the instruction not to add facts.
Questions for the owner
X10 Minimum version for speech. The Speech page asks for v0.40.9, while the OpenAI compatibility page says the speech endpoint was added in v0.40.8. Which version first supports
/v1/audio/speechand Phonon?Pages: Speech, OpenAI compatibility
X31 Client use of OLLAMA_HOST is not documented. The FAQ documents OLLAMA_HOST only as the server bind address, while Speech and Goose use it to point a client at another server. Should the FAQ or CLI reference document OLLAMA_HOST as the client's target server too?
Pages: Local FAQ, Speech, Use Goose with Ollama
X41 Decision and speech CLI examples in the CLI reference. The CLI reference repeats the --ask, --choice, --level and --voice examples from the Decision and Speech pages. Should the CLI reference keep one line each and link to the capability pages?
Pages: CLI reference, Decision, Speech
Original
Speech models read text aloud. Ollama streams the audio as it is generated, so playback can start before the whole text has been spoken.
Setup
Start Ollama v0.40.9 or later, then download Phonon:
ollama pull phonon
Phonon uses Gradium's 31M English checkpoint and comes with Gradium's English voices, such as Zoey, Easton, and Freya. Without a voice, it speaks with the checkpoint's own voice, default. ollama show phonon lists every voice. Voice names work in any case and with or without accents.
Speak from the terminal
ollama run plays the audio through your computer's speakers:
# Speak some text
ollama run phonon "Hello from Ollama."
# Choose a voice
ollama run phonon --voice Zoey "Hi, this is Zoey."
# Speak text from another program
echo "Text from another program works too." | ollama run phonon
# Speak a chat model's answer
ollama run gemma4 --hidethinking "Tell me a fun fact about owls in two sentences." | ollama run phonon
Piped text is spoken as it arrives, so a chat model's answer starts playing after its first sentence or two.
Run 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 run phonon "Save this to a file." > speech.wav
To hear a remote server, run ollama on your own computer and point it at the server. The audio plays where the command runs:
OLLAMA_HOST=my-server:11434 ollama run phonon "Hello from the server."
Generate speech with the API
Use the OpenAI-compatible /v1/audio/speech endpoint:
cURL
curl http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "phonon",
"input": "Hello from Ollama.",
"voice": "default"
}' --output speech.wav
Python
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="default",
input="Hello from Ollama.",
response_format="wav",
) as response:
response.stream_to_file("speech.wav")
JavaScript
import fs from 'node:fs'
import OpenAI from 'openai'
const openai = new OpenAI({ baseURL: 'http://localhost:11434/v1', apiKey: 'ollama' })
const response = await openai.audio.speech.create({
model: 'phonon',
voice: 'default',
input: 'Hello from Ollama.',
response_format: 'wav',
})
fs.writeFileSync('speech.wav', Buffer.from(await response.arrayBuffer()))
The response streams while audio is generated, so you can start playing it right away:
curl -sN http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "phonon", "input": "Playback starts while the rest is still being generated."}' \
| ffplay -nodisp -autoexit -loglevel error -
Audio formats
response_format |
Output |
|---|---|
wav (default) |
A WAV file: 16-bit, mono, 24 kHz. The header is written before the length is known, so its size fields hold the maximum value. |
pcm |
Raw 16-bit little-endian samples, mono, 24 kHz, with no header. |
Limits
inputcan be up to 4,096 characters per request.ollama runsplits longer text at paragraph and sentence breaks for you.- Prices, numbers, symbols, email addresses, and URLs are spelled out before speaking, so
$4.59is read as "4 dollars and 59 cents". Times and numeric dates are read as written, so write dates out (October 23, not10/23) for a natural reading. Emoji, bullet characters, and markdown markers such as*and#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, and its voices (voices in /api/show). See OpenAI compatibility for every supported field.
What Changed
Fixed the three wording findings: a contraction, "version" before the version number, and the first use of WAV spelled out. Everything else is unchanged. Three inventory questions attach to the minimum version, the repeated CLI examples, and the use of OLLAMA_HOST by a client.
Content type: task. The page shows how to set up a speech model and generate audio from the terminal and the API, which is one job done in steps.
Automated check, original: 0 errors, 2 warnings, 1 suggestions. Revised: 0 errors, 0 warnings, 0 suggestions.
Independent audit (GPT-6): mixed. The revision is clearer in two places: it shortens a sentence and writes the minimum version in prose. Overall, it is slightly better, but spelling out WAV adds a fact despite the instruction not to add facts.
Regressions:
- The WAV expansion adds a factual claim that is absent from the original.
What the revision missed:
- The standard says a page that gives the reader something to do should end with an action; this page ends with a capabilities reference and link instead.