# I ran a self-hosted AI radio station

> A novelty build with Black Mirror-ish fun

By Zsolt Bizderi · Published 2026-11-20
Canonical: https://ambientnode.uk/i-ran-a-self-hosted-ai-radio-station

AI radio stations play music with an AI "host" talking over the top like a DJ, reading the weather, back-announcing tracks, filling the silence between songs and building the playlist dynamically, based on various attributes (vibe/genre/etc.). I had a gathering coming up and wanted better background audio than another Spotify playlist. A station that reacts to the actual room is a good conversation starter, and I could host the whole thing myself.

## How the host talks over the music

The host doesn't talk between songs, it talks over them. The music plays underneath the voice and comes back up afterwards. That effect is called audio ducking, and it's what makes the result sound like radio rather than a playlist with interruptions in-between.

The whole thing is a chain of a few pieces:

* An LLM writes the DJ segments: the links, idents, and time and weather reads.
* A TTS engine turns that text into a voice clip.
* Liquidsoap handles the music rotation, the crossfades, and the ducking. It drops the music bed about 10 to 15 dB under the voice clip and brings it back.
* Icecast serves the result as a single streaming mount.
* Anything that plays an internet radio stream picks it up. In my case, Sonos.

[Liquidsoap](https://www.liquidsoap.info/) is the same broadcast-automation tool internet stations have used for years, and the "talk over the bed" behaviour is native. Everything else just supports it.

## The project: subwave

A while back I found [subwave](https://www.getsubwave.com/) on Reddit, an open-source vibe-coded stack that bundles the whole pipeline, the architecture is sound and it's image-first, so there's almost nothing to build. For something used for one evening, it is more then enough.

The stack, all in Docker:

* **caddy**: the edge, and the only exposed port (7700). Reverse-proxies the stream and the web UI.
* **broadcast**: Icecast and Liquidsoap, internal only.
* **controller**: the DJ logic. A Node service that picks tracks, writes the patter, and renders TTS.
* **web**: a Next.js admin and onboarding UI.
* An optional heavier TTS sidecar you can leave switched off.

Music comes from your own library over the Subsonic API, so you point a Navidrome instance at a folder of tracks. The LLM provider is swappable at runtime (Ollama, OpenAI, Anthropic, and others), and TTS can be local (Piper, Kokoro) or cloud (OpenAI, ElevenLabs). I do want to mention that the music is not AI-generated, it's using real tracks with AI host over the top.

## The hardware

For a permanent install I'd use proper hardware. This was a one-night thing, so I used a small fanless box I had spare: an ex-ChromeOS mini PC reflashed with MrChromebox (coreboot) so it boots plain Debian instead of ChromeOS. Quad-core mobile i7, 24 GB RAM, a 500 GB NVMe, no discrete GPU. Once it's running Linux it's a normal low-power x86 machine, which is fine for an always-on background service, and the NVMe meant the whole music library could live locally on the same box. Inference is CPU-only, which turned out not to matter.

## The build

Install Docker from the official repo, clone the repo, and add the two services it doesn't come with, Ollama for the model and Navidrome for the music, in a `docker-compose.override.yml`. Compose merges that with the project's own compose file automatically, so the whole stack comes up as:

```
# docker-compose.override.yml
services:
  ollama:
    image: ollama/ollama:latest
    container_name: sub-wave-ollama
    restart: unless-stopped
    volumes:
      - ollama-models:/root/.ollama

  navidrome:
    image: deluan/navidrome:latest
    container_name: sub-wave-navidrome
    restart: unless-stopped
    environment:
      ND_MUSICFOLDER: "/music"
    volumes:
      - "/srv/radio/music:/music:ro"
      - navidrome-data:/data
    ports:
      - "4533:4533"

volumes:
  ollama-models:
  navidrome-data:
```

A three-line `.env` (admin user, admin pass, site URL), `docker compose up -d`, and everything else (music source, LLM endpoint, TTS engine, DJ persona) is set in a first-run wizard at `/onboarding`. The internal services, the model can reach them over at `http://ollama:11434` and the library at `http://navidrome:4533`, not localhost.

## The model: small, on CPU, and fine

My first instinct was an 8B model. On a GPU-less mobile i7 that's super slow. A 1B, at the other end, couldn't follow a persona. I ended up testing and sticking to 3/4b models like `qwen3:4b`, `gemma3:4b`, or `llama3.2:3b`. They're coherent, they follow instructions, and they run at a usable speed on CPU.

The reason CPU inference is a non-issue here is because the DJ segment for the next track is written while the current one is still playing. You have a whole song, three or four minutes, to generate a couple of sentences. Even a slow local model finishes in seconds against that budget. It isn't a real-time voice agent racing your ear, it's a scheduler with minutes of slack. If you use a Qwen model, turn off thinking mode, so it doesn't burn tokens reasoning before writing a one-liner.

## Making it not sound like an AI

Out of the box the host sounded like every early GPT models with "calm", "wistful", "find a quiet spot and let the music wash over you." cringe. Not the right tone for a party. Telling a 4B to "be witty" did not really do anything, so had to do a bit of prompt engineering:

* A handful of worked examples in the exact register you want (few-shot).
* An explicit list of the failure mode to ban: naming the words and moves it keeps reaching for ("unwind", "cozy", "good vibes", exclamation marks, explaining the joke).
* Anti-examples. Showing it what bad output looks like steers as hard as the good examples.
* Rules about the mechanics of the humour rather than the vibe: deadpan over zany, one joke per break, end on the funniest word, understatement over enthusiasm.

Once I stopped describing the tone and started demonstrating it, with a block of good and bad example lines, the output got actually hilarious. Still the occasional dud, because it's a 4B, but that's the tier, not the prompt. The move is to let the live model handle the low-stakes connective patter and pre-render the guaranteed laughs (idents, recurring bits) to fixed audio, so the best moments are reliable.

## TTS issues

I wanted a cloud voice for quality, so went with Elevenlabs after testing Kokoro locally. The logs showed `Unauthorized` on every segment, falling back to local Piper. The key was in `.env`, the provider dashboard said the key was valid, and still I kept getting 401'd. A few notes on this:

* **`docker restart` doesn't reload `.env`.** Env files are read when a container is created, not started. Restarting, or even rebooting the host, reuses the existing container and keeps the old environment. You need `docker compose up -d --force-recreate`.
* **A redacted API view sent me chasing ghosts.** The admin API returns settings with secrets masked and the object wrapped in an envelope. My quick `curl | python` checks were reading the wrong nesting level and reporting everything as null.
* **There was an actual bug too, a stale key shadowing the working API key.** The credential precedence is stored settings key over env key; it only falls back to the environment variable if the stored key is empty. An old, dead API key was baked into `state/settings.json` from earlier testing, and that was being sent to the provider instead of the fresh one in `.env`. The fix was a one-liner to clear the stored key so it fell through to the environment.

## Getting it onto Sonos

The last part is easy, albeit annoying. subwave exposes a standard Icecast MP3 mount through Caddy at `http://<host-ip>:7700/stream.mp3`, and Sonos plays MP3 streams natively. A few notes:

* Use the desktop Sonos controller, not the phone app. Sonos removed custom-URL entry from mobile a while back after their S2 "upgrade". On desktop it's Manage > Add Radio Station, paste the stream URL, name it, done. It then plays on any speaker or group, including from your phone afterwards usin TuneIn (old). Annoyingly, even after adding the service on desktop, it was completely removed from the mobile app, so I had to use a spare laptop to actually start the casting.
* If your speakers are on a separate VLAN (mine are), the speakers pull the stream directly, so they need a firewall rule to reach the host on 7700/tcp. It's the speakers that need the route, not just the controller. Give the host a DHCP reservation too, because that IP is now hardcoded in a Sonos favourite.
* Open the stream URL in VLC on a machine on the same network as the speakers. If VLC plays it, Sonos will.

Then group the rooms and it plays in sync across the house.

## Closing Notes

I have my Frigate connected to Home Assistant and two automation running; every are of the house has a Sonos speaker and presence sensors. When you walk into a room, the speaker joins the playing group, making it feel like the music follows you around the house. The second automation takes a snapshot of the Frigate live feed every 1-2 minutes, it sends it to the a vision model that describes the individual seen, feeding it into the sysprompt from Subwave, so the DJ is kinda aware of who is in the room. This created the perfect opportunity to set my host's personality to roast people, as it could "see them". The results were hilarious with friends having a drink at the garden bar and the AI DJ telling them to slow down on the cocktails. Definitely a one-night novelty thing, but it created a Black Mirror-ish eye-opener moment for many guests on how far AI got in the last few years.
