StreamTTS uses Kokoro ONNX for speech and S2 Lite as the local record store. Each cast is a sequence of records with sentence text, duration, and MP3 bytes.
- Jetson with CUDA
- Python 3.10
uvffmpegs2CLI- Model files:
models/kokoro-v1.0.onnxmodels/voices-v1.0.bin
uv sync --frozen
uv pip install --force-reinstall onnxruntime-gpu \
--extra-index-url https://pypi.jetson-ai-lab.dev/jp6/cu126uv run streamttsOpen http://localhost:7878.
By default this starts S2 Lite, creates a local basin, and runs the web, worker, and fanout roles in one process.
Useful flags:
uv run streamtts --lite-root var/s2lite-data
uv run streamtts --lite-url http://127.0.0.1:4002 --no-spawn
uv run streamtts --role web
uv run streamtts --role worker
uv run streamtts --role fanoutCopy the example environment file:
cp deploy/systemd/streamtts.env.example deploy/streamtts.envRun S2 Lite, web, worker, and fanout separately:
s2 lite --local-root var/s2lite-data --port 4002 --no-cors
uv run streamtts --role web --no-spawn --host 127.0.0.1 --port 7878
uv run streamtts --role fanout --no-spawn --host 127.0.0.1 --port 7879
uv run streamtts --role worker --no-spawn --host 127.0.0.1 --port 7880Deployment files:
deploy/systemd/*.servicedeploy/systemd/streamtts.env.exampledeploy/cloudflared-streamtts.ymldeploy/observability/
S2 Lite has no auth. Keep it private:
sudo ./scripts/jetson_secure.shExpose only the web and fanout roles through your tunnel or reverse proxy.
| stream | use |
|---|---|
jobs |
queued generation requests |
jobs/_cursor |
committed worker offset |
progress/done |
completed cast receipts |
jobs/dead |
failed jobs |
catalog/<id> |
private cast recipe |
pub/casts/<id> |
public cast records |
Public cast records:
| event | body |
|---|---|
meta |
title, voice, character count, created time |
start |
generation attempt marker |
audio |
sentence index, text, duration in headers; raw MP3 in the body |
eos |
terminal record |
The browser reads /s2/records?stream=pub/casts/<id>&seq_num=0. Replay and
live playback use the same read path.
echo "hello" | uv run python scripts/infer.py
uv run python scripts/infer.py "read this" --out out.mp3
uv run python scripts/infer.py --watchcd deploy/observability
sudo docker compose up -dPrometheus scrapes:
http://127.0.0.1:7878/metrics/promhttp://127.0.0.1:9101/metrics