Skip to main content
Use casesBeginner6 min read

Ollama voice: local speech synthesis, from the command line to the OpenAI API

i
iaLocale Team
•
Ollama voice: local speech synthesis, from the command line to the OpenAI API

Text to speech is no longer an experiment waiting in line behind the model: it is a command. ollama run phonon "Hello, this is my local AI" generates spoken audio locally, no cloud, no API key — and it can even speak while the model is still answering, sentence by sentence, before the reply is finished. This is the step where your AI stops being a text box and starts existing in the world: like a car you no longer just watch on a dashboard, but actually hear in the garage, running and ready.

How it works: one line, and the voice starts

The first speech model in Ollama is Phonon, the family of compact TTS models from Gradium. Setup is two lines:

ollama pull phonon
ollama run phonon "Hello from Ollama."

That's it, audio comes out. You pick a voice with --voice:

ollama run phonon --voice Hadley "Hello from Ollama."

Every available voice is listed with ollama show phonon. Two commands, zero configuration, and the WAV lands in the console — to save it, ollama run phonon "Text" > speech.wav is all it takes.

For the interface crowd, the reply of any chat model can be piped into Phonon, and here is the detail that changes the experience: the text is spoken as it arrives. The first sentence plays not when the model finishes, but when the first sentence is ready.

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

The numbers: how fast, how small

On Apple Silicon, Ollama accelerates Phonon with MLX, Apple's machine learning framework. The number that matters: on a MacBook Pro M5 Max, Ollama was 35% faster than Gradium's own reference runtime — the vendor's own engine — with no quality loss: the word error rate matches the reference implementation in Hugging Face Transformers.

The model family:

ModelLanguageLicense
phononEnglishApache 2.0
phonon:40m-frFrenchCC BY-NC 4.0
phonon:40m-deGermanCC BY-NC 4.0
phonon:40m-esSpanishCC BY-NC 4.0
phonon:40m-ptPortugueseCC BY-NC 4.0
phonon:40m-multilingualall fiveCC BY-NC 4.0

"Compact" is not marketing: the multilingual variant is a GGUF of just over 60 MB (q4k) — a model that fits in the pocket of any Mac. Audio comes out at 24 kHz mono, WAV by default, or raw 16-bit samples if you ask for "response_format": "pcm".

From the OpenAI-compatible endpoint to your code

For builders, Phonon is already wired where your code expects voice to be: the /v1/audio/speech endpoint, the one from the OpenAI API. Existing code using the OpenAI SDK only changes the base URL:

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

In Python it's a handful of lines, streaming included: the client opens the response and saves the file while the audio is generated, so the app can start playing immediately. In Node.js, same story. And for console playback, the pairing that never goes out of style:

curl -sN http://localhost:11434/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model": "phonon", "input": "Playback starts right away."}' \
  | ffplay -nodisp -autoexit -loglevel error -

Three ways to use the same voice — command line, pipe, API — and none of them touch the network: text and audio stay on the machine.

And the limits?

Three, and they come before everything else.

No Italian yet. The languages are English, French, German, Spanish and Portuguese. For Italian speech today, you lean on the TTS already in the catalog, like NVIDIA's MagpieTTS; the watch item is that the Phonon family was born multilingual by design, so a 40m-it tag is the most likely next move, not a miracle.

macOS only, for now. Windows and Linux are announced but not out yet. On Mac it runs on Ollama 0.40.11 or later; first thing, ollama -v.

Mind the licenses. The main English model is Apache 2.0, but the 40M variants — the multilingual ones — are CC BY-NC 4.0: non-commercial use. If the use case is a business, the model to use today is phonon in English; the 40M languages are the right pick for personal use.

And one last format limit: 24 kHz mono is a solid listen for an assistant or content narration, not studio audio. Those chasing top naturalness stay with the bigger TTS models — but you cannot have it all: speed, compactness and studio quality on a laptop do not fit in one package.

Getting started

1. Update Ollama. ollama -v must show 0.40.11 or later; if it's older, download the new version from the Ollama site. If it fails: after the update, ollama pull phonon must download; a 404 on the pull means the version is still too old.

2. First voice. ollama run phonon "If you can hear this voice, local text-to-speech works." You hear a WAV: the shell prints nothing, the sound arrives on its own. If it fails: check the system audio output — the file is there, the shell does not play it for you.

3. Pick the language. English is phonon; for French, German, Spanish and Portuguese use the 40m-fr, 40m-de, 40m-es, 40m-pt tags, or phonon:40m-multilingual to cover them all. If it fails: ollama show phonon lists the tags and voices actually available on your install.

4. Make it speak while it answers. The pipe: ollama run gemma4 "Two sentences about APIs." | ollama run phonon. The first sentence starts sounding before the reply is complete.

5. Wire it into code. Point the OpenAI endpoint at http://localhost:11434/v1 with api_key: "ollama" and call audio.speech with model: "phonon". If the project is in Python or Node, the examples above copy straight in.

Sources

In summary

Ollama now generates speech locally with Phonon: one command to start, an OpenAI-compatible endpoint to integrate, and streaming read-aloud of any chat model's reply. On Apple Silicon it is 35% faster than the vendor's reference runtime, at the same accuracy. The 40M multilingual variants cover French, German, Spanish and Portuguese (non-commercial); English is Apache 2.0. Italian, Windows and Linux are coming; for audio today, the local voice is already in your command line.

Article generated with AI

In these reading paths

Share:

Enjoyed this article?

Subscribe to the newsletter for new tutorials and guides.

After signing up you receive a confirmation email (double opt-in). Without confirmation we send nothing. No spam, we promise.

Related Articles