Guide
Free local text to speech for AnythingLLM
AnythingLLM’s OpenAI Compatible speech provider works with loudness-tts, so answers are read aloud by natural voices running on your own machine, free. It works with the desktop app and with Docker.
1Start the speech server
With Docker, which includes FFmpeg (AnythingLLM 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. For the desktop app on the same computer, the default address is enough:
python -m pip install loudness-tts loudness-tts serve --port 8880If AnythingLLM runs in Docker, start it with
--host 0.0.0.0instead, and add--api-keywith a secret on shared networks.2Choose the provider
In AnythingLLM, open Settings → Voice & Speech. Under Text-to-speech Preference, set Provider to OpenAI Compatible.
3Fill in the fields
- Base URL:
http://127.0.0.1:8880/v1for the desktop app, orhttp://host.docker.internal:8880/v1when AnythingLLM runs in Docker - API Key: leave it empty, unless you started the server with
--api-key - TTS Model:
tts-1 - Voice Model:
nova, or a voice id
Then select Save changes.
- Base URL:
4Test it
Open a workspace chat and press the speaker icon under an answer. The first answer can take a few seconds longer while the voice downloads.
5Optional: set it with environment variables
For AnythingLLM in Docker, the same settings can go in its
.envfile:TTS_PROVIDER="generic-openai" TTS_OPEN_AI_COMPATIBLE_ENDPOINT="http://host.docker.internal:8880/v1" TTS_OPEN_AI_COMPATIBLE_MODEL="tts-1" TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL="nova" # TTS_OPEN_AI_COMPATIBLE_KEY="choose-a-secret" (only with --api-key)See AnythingLLM’s text-to-speech documentation for the other providers.
Common problems
AnythingLLM cannot connect
From Docker, use http://host.docker.internal:8880/v1 and start the server with --host 0.0.0.0. On Linux, run the AnythingLLM container with --add-host=host.docker.internal:host-gateway.
No sound
AnythingLLM plays MP3. Use the Docker image, or install FFmpeg on the computer that runs the Python server.
Error 401
Enter the same key as the server’s --api-key, or start the server without one.
Other languages
Enter a voice id as the Voice Model, such as fr_FR-gilles-low or best:de-DE. loudness-tts voices --language fr lists them. 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 LibreChatConfigure librechat.yaml so LibreChat reads messages aloud with free local voices.