No description
  • TypeScript 98.6%
  • JavaScript 0.9%
  • Dockerfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Morten Olsen c97896fc20
Some checks failed
ci/woodpecker/push/build Pipeline failed
refactor(voice): serve TTS from speaches, drop in-process kokoro-js
In-process TTS was chosen to remove a ~50-100ms HTTP roundtrip per chunk.
That holds on a many-core dev machine and inverts completely under the
deployment's CPU quota. Measured in the pod, same sentence, same model:

  in-process (kokoro q4)  first frame 7809 ms
  speaches (HTTP)         first frame 1414 ms cold, 622 ms warm

The pod gets a 2-core quota while os.cpus() reports the host's 20, so ONNX
sized its pools for 20 and ran 26 threads into ~50% scheduler throttling
(cpu.stat: nr_throttled 1841 / nr_periods 3702). There is no knob to fix
it from here: OMP_NUM_THREADS and ORT_INTRA_OP_NUM_THREADS had no effect,
and kokoro-js forwards only {dtype, device, progress_callback}, so
session_options can't reach onnxruntime. Both adapters also returned
total ≈ first frame, so the sub-sentence streaming the in-process path was
supposed to buy never materialised.

Moving synthesis out of the job process also removes the ONNX-vs-FFI
contention that corrupted the room handle on connect, and takes phonemizer
out of the dependency tree — the Emscripten handler hijack that turned
every async failure into a bare exit code 7.

- worker.ts constructs Tts (speaches) instead of LocalTts; no preload, so
  ttsReady and its retain() are gone
- delete audio.tts.local.ts and tts.local.smoke.ts; drop kokoro-js and
  @huggingface/transformers from packages/voice
- TTS_BASE_URL / TTS_API_KEY / TTS_MODEL are required config again;
  TTS_MODEL_ID / TTS_DTYPE / HF_CACHE_DIR are gone, including from the
  Dockerfile
- installCrashDiagnostics() and retain() stay, with their comments
  rewritten: they no longer claim a dependency that isn't there. The
  exit-7 hazard is now history rather than a live condition, but Node
  still kills the process on an unhandled rejection and the next native
  dep can hijack the handlers again.
2026-08-17 15:34:16 +02:00
.claude composable agent 2026-06-09 11:58:56 +02:00
.woodpecker update 2026-06-11 00:05:13 +02:00
apps refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
docs refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
packages refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
plugins refactor: move background work out of plugin construction 2026-08-17 14:13:44 +02:00
.dockerignore consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
.gitignore fix: make async failures visible instead of a bare exit code 7 2026-08-17 13:50:40 +02:00
.npmrc consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
.prettierrc init 2026-06-02 08:40:06 +02:00
CLAUDE.md refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
docker-compose.yml consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
Dockerfile refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
eslint.config.mjs init 2026-06-02 08:40:06 +02:00
foo update 2026-06-11 00:05:13 +02:00
mise.toml consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
package.json consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
pnpm-lock.yaml refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
pnpm-workspace.yaml switch sqlite to pglite 2026-06-09 23:41:30 +02:00
renovate.json consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
Taskfile.yml refactor(voice): serve TTS from speaches, drop in-process kokoro-js 2026-08-17 15:34:16 +02:00
turbo.json consolidate server into instance, dockerize, add ci 2026-06-09 23:01:19 +02:00
vitest.workspace.ts init 2026-06-02 08:40:06 +02:00