Guide
Free local text to speech for LibreChat
LibreChat reads messages aloud through any OpenAI-compatible speech server. With loudness-tts the voices run on your own machine, free. You edit librechat.yaml once and restart LibreChat.
1Start the speech server
Docker is the easiest choice: the image includes FFmpeg, and LibreChat plays MP3 audio.
docker run -d --name loudness-tts -p 8880:8880 -v loudness-tts:/data ghcr.io/loudness-ai/loudness-ttsOr with Python, after installing FFmpeg (see the installation guide):
python -m pip install loudness-tts loudness-tts serve --host 0.0.0.0 --port 8880 --api-key choose-a-secret2Add the speech settings to librechat.yaml
speech: tts: allowedAddresses: - "host.docker.internal:8880" openai: url: "http://host.docker.internal:8880/v1/audio/speech" apiKey: "${TTS_API_KEY}" model: "tts-1" voices: ["nova", "shimmer", "onyx", "echo", "alloy"]The
urlis the full speech address, ending in/v1/audio/speech. LibreChat blocks addresses on your own network unless they are listed underallowedAddresses, written as host and port only. People can choose only the voices in the list.3Set the API key
In LibreChat’s
.envfile, add the key that the settings refer to: the secret you passed to--api-key, or any text if the server has none.TTS_API_KEY=choose-a-secret4Restart LibreChat
docker compose down docker compose up -dLibreChat reads librechat.yaml when it starts. With Docker, the file must be mounted into the api container, as described in LibreChat’s speech documentation.
5Turn on text to speech
In LibreChat, open Settings → Speech, turn on Text to Speech, choose the OpenAI engine and a voice from your list. Then use the read-aloud button under a message.
6Optional: run the server inside LibreChat’s Docker Compose
Add loudness-tts to
docker-compose.override.yml, next to LibreChat:services: loudness-tts: image: ghcr.io/loudness-ai/loudness-tts volumes: ["loudness-tts:/data"] volumes: loudness-tts:Then use
url: "http://loudness-tts:8880/v1/audio/speech"andallowedAddresses: ["loudness-tts:8880"].
Common problems
“Voice … is not available”
The selected voice must be in the voices list in librechat.yaml. Add it there and restart LibreChat.
Requests to the server are blocked
Add the server’s host and port, without http:// or a path, under speech.tts.allowedAddresses.
No sound and no error
LibreChat plays MP3. Use the Docker image, or install FFmpeg on the computer that runs the Python server.
Other languages
Add voice ids such as es_ES-mls_9972-low or best:de-DE to the voices list. loudness-tts voices --language es lists the ids. OpenAI voice names map to strong English (US) voices: nova, shimmer, coral, sage and marin are female; echo, onyx, ash, ballad, verse and cedar are male; alloy and fable are the top voices overall.
Next steps
More guides
- Install the AI Noise Remover SDKPython and FFmpeg on Windows, macOS and Linux, your first noise removal and the JavaScript build.
- Install loudness-ttsPython or JavaScript on Windows, macOS and Linux, first speech with subtitles, the speech server, Docker and offline use.
- Free local text to speech for Open WebUIRead Open WebUI answers aloud with natural voices that run on your own machine.
- Free local text to speech for AnythingLLMUse AnythingLLM’s OpenAI Compatible provider with free voices on your own machine.