DEV Community

Cover image for Ollama Local TTS: Audio with LFM3-Audio on Linux & Windows
KAMAL KISHOR
KAMAL KISHOR

Posted on

Ollama Local TTS: Audio with LFM3-Audio on Linux & Windows

TL;DR: This guide demonstrates how to run local text-to-speech using Ollama and the LFM3-audio model from Liquid AI on Linux and Windows. Readers will learn the exact commands to get high-quality speech output directly on their machines without cloud dependencies.

Dealing with cloud text-to-speech (TTS) APIs can be a real pain. You're constantly thinking about latency, data privacy, and the monthly bill that creeps up. Building multimodal agents that need to speak without an internet connection, or just wanting to add an accessible voice feature to a local app, often means a compromise: either use lower-quality local options or pay for external services.

Ollama's recent v0.40.13 update changes that, bringing Liquid AI's LFM3 family of models, including lfm3-audio, to Linux and Windows users. This extends the high-performance local inference capabilities previously available only on Apple Silicon, making robust text-to-speech accessible on standard workstations. This is a compact, fully-featured 2B parameter audio model that can run locally on laptops and edge devices. It takes text or audio as input and can respond with text, speech, or both. As someone who prefers free, local AI tools when the quality is good enough, this update is a big win for offline development and reducing cloud reliance.

Getting Started with LFM3-audio

First, ensure you have Ollama installed and updated to at least version 0.40.13. You can check your version by running ollama --version. If you need to update, the process is straightforward:

# If installed via Homebrew (macOS)
brew update && brew upgrade ollama

# If installed via script (Linux)
curl -fsSL https://ollama.com/install.sh | sh

# For Windows, download the latest installer from ollama.com/download
Enter fullscreen mode Exit fullscreen mode

Once Ollama is up to date, pulling the lfm3-audio model is a single command:

ollama pull lfm3-audio
Enter fullscreen mode Exit fullscreen mode

This command downloads the 2.1 GB model to your local machine.

Running Text-to-Speech

With the model downloaded, you can now generate speech directly from your terminal. The ollama run command plays the audio through your computer's speakers.

To generate speech from a simple text prompt:

ollama run lfm3-audio "Hello from your local text-to-speech model!"
Enter fullscreen mode Exit fullscreen mode

The model can handle various inputs and tasks, including multilingual speech synthesis in 18 languages. To specify a language and gender for the voice, you can use a system prompt:

ollama run lfm3-audio "Perform TTS in English using a female voice. Hello, how are you today?"
Enter fullscreen mode Exit fullscreen mode

The lfm3-audio model also supports streaming replies in text and speech for voice chat applications.

You can also save the audio output to a WAV file instead of playing it directly. This is particularly useful for integrating TTS into applications or when working on a server without speakers:

ollama run lfm3-audio "This text will be saved to a file." > speech.wav
Enter fullscreen mode Exit fullscreen mode

For programmatic access, Ollama provides an OpenAI-compatible /v1/audio/speech endpoint. You can interact with it using curl to generate audio files:

curl http://localhost:11434/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{ "model": "lfm3-audio", "input": "This is an example from the API.", "voice": "default" }' \
  --output api_speech.wav
Enter fullscreen mode Exit fullscreen mode

Common Considerations

While running local TTS with Ollama and LFM3-audio is powerful, there are a few things to keep in mind. The lfm3-audio model handles up to 32K tokens for context length (input + output). Longer texts might need to be split, though ollama run often handles this automatically at paragraph and sentence breaks. Also, be aware that numbers, prices, and URLs are often spoken in expanded form, and markdown symbols or emojis are typically skipped.

A potential trade-off with local models is the initial download size and the computational resources required. While lfm3-audio is a compact 2B parameter model, a 2.1 GB download might take a little time depending on your internet connection. On the resource front, it's designed to run on laptops and edge devices, but its performance will still scale with your hardware, especially if you're running other models concurrently. For agentic coding or complex multi-step reasoning, LFM3-Audio-2B is not recommended due to its small size; it's better suited for local agents, tool calling, structured outputs, and domain-specific fine-tuning.

Sources


Written by **Kamal Kishor* (@koolkamalkishor) — Sr. Frontend Developer building AI agents (React, TypeScript, LangChain). LinkedIn · GitHub · Portfolio*

Published: 04 Nov 2026. This article was generated with AI (Google Gemini + web search). Please check important details against the sources above.

Top comments (0)