work/tts-queue

Speech jobs for agents

TTS queue

Any agent or script drops text into a queue; a GPU voice engine on another PC is switched on only when there is work, and the finished audio lands on the network share.

Live

After the drainer ran: three done with players, one rejected by the (fake) provider.

Narration, read-alouds and spoken alerts all want a good GPU voice, and the GPU lives on a workstation that should not hum all day for one sentence. The TTS queue solves that. Jobs arrive over a small REST API, a one-file CLI or an agent skill and get a job id and a share path back straight away. A drainer then wakes the voice engine through nomarch, waits until it reports healthy, works through the queue, and always switches it off again. With an empty queue, nothing is ever called.

Runs on
Service on the home server; the voice engine runs on a Windows GPU workstation
Built with
Node 22 with node:sqlite and no dependencies, nomarch's run-command tool
Started
October 2026

The loop

Submit, drain, deliver

  1. Submit, drain, deliver: the whole loop in one diagram.
    Submit, drain, deliver: the whole loop in one diagram.

Built for the bad days

The provider might be busy (it answers 503 with a retry time), too hot (there is a GPU temperature limit), or simply gone (a 15-minute give-up and a 5-minute cooldown). The share might be a dead network mount that looks like an empty folder, so the queue refuses to write unless it is a real mount. Finished audio is never auto-deleted.

The status page filters by state, plays results inline, offers downloads and the share path, cancels queued jobs and shows the on/off log for the provider. Voices are synced read-only from the folder the voice-cloning wizard writes.

The queue

Jobs in, audio out

  1. Four demo jobs waiting in the queue.
    Four demo jobs waiting in the queue.
  2. After the drainer ran: three done with players, one rejected by the (fake) provider.
    After the drainer ran: three done with players, one rejected by the (fake) provider.
  3. The provider on/off log expanded.
    The provider on/off log expanded.

How it's built

  • All state on the server: SQLite plus a folder per job. Requests are validated strictly; unknown fields are rejected and ranges checked.
  • The drainer ticks every 15 seconds under an SQLite lease lock and drives the workstation through nomarch's MCP client, with a Windows console start-up quirk handled.
  • Tests run the drainer on virtual time, so backoff and give-up finish instantly, plus an end-to-end run on a throwaway instance with a fake provider. The screenshots here come from exactly that setup.
  • The first live job took 47 seconds end to end, including a cold model load.

1 / 4

Submit, drain, deliver: the whole loop in one diagram.
Submit, drain, deliver: the whole loop in one diagram.