Commit Graph
3 Commits
Author SHA1 Message Date
Hasan BasbunarandClaude Opus 5.5 e8ed9126ff speech lane: a voice that is not a string is a 400, not a dropped connection
A speech request whose "voice" was a list or an object raised in the handler (its lookup in
a set of names), so the client got no answer at all and the journal a traceback. It is now
refused with a 400 that says what the field takes, before the voice runs.

Test: two such requests among the bad requests refused before the voice runs; both errored
on the old code (TypeError: unhashable type), both are a 400 now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:59:12 +02:00
Hasan BasbunarandClaude Opus 5.5 b2668276c8 speech lane: a body length that is not one is refused, and every cut moves forward
A negative Content-Length read the body until the client hung up, and one that is not a
number ended the handler on a traceback: both are a 413 now, at once. The piece cutter
bounds its search to the piece, so that no setting can put a cut at or before the piece's
start and stop it moving forward.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:59:12 +02:00
Hasan BasbunarandClaude Opus 5.5 63bfa392c4 speech lane: Qwen3-ASR and Kokoro on the CPU, behind OpenAI's audio routes
./install-speech.sh, opt-in: llama.cpp's llama-server built for the CPU at a pinned
commit runs Qwen3-ASR (0.6B by default, 1.7B with SPEECH_ASR=1.7b), and speech-server.py
serves /v1/audio/transcriptions and /v1/audio/speech in front of it, with Kokoro-82M in
onnxruntime. One unit, qwen38-speech.service, on loopback, the GPU hidden, the small cores
only (0-4 for the recognizer, 10-14 for the voice), so that it runs beside any lane. Not
started at boot unless SPEECH_BOOT=1. Every model is pinned by sha256, every package of
the venv by exact version, wheels only.

What the reference box showed, and the routes do about it (2026-10-05):
- a recording sent whole came back cut with a 200 past the context (582 s: 353 words
  of 1482), and passes of 120 s skipped 61 words; uploads are read by ffmpeg (m4a, webm,
  ogg as well), cut into pieces of 30 s at quiet moments and heard one by one: 9.7% WER
  on 291 s of French at 0.51 of real time, the same as the clips heard one by one;
- llama-server's prompt cache in host memory (8 GiB by default) took the lane from 1.6 to
  4 GiB: --cache-ram 0, and 2.7 GB resident at work;
- Mandarin and Japanese are refused rather than spoken wrong: espeak's phonemes are not
  the ones those voices were trained on (21% and 15% of characters heard back wrong);
- the phonemizer's copies of espeak go with a private /tmp, emptied at every stop.

uninstall.sh lists and removes the unit and the runtime, and keeps the models with a
reclaim command, as for every checkpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:59:12 +02:00