zeekayandHanzo Dev 6d9aca2b3a speech: decode the talking, not the room
A decoder costs the same for silence as for speech, so an attendant in a
quiet room occupied a worker and billed a tenant for text that came back
empty. Silero already ships inside faster-whisper and already runs inside
every decode; running it in FRONT of the decoder — 0.67 ms per 250 ms push,
measured — turns that second into no decode and no charge at all.

It is a squelch rather than a per-window classifier, because the classic
way to lose more than you save is to start at the trigger: the voice is
not detected until it is under way. Sliding a word across a push shows the
size of it — with no lead-in, 8 of 32 alignments clip up to 71.8 ms off
the front of the word, and with LEAD they keep 428 ms of margin.

`duration` on the ack becomes the seconds that reached a decoder, so the
plane meters what we listened to. It can exceed one push's own length, on
the push that hands over the lead-in, and can never exceed the audio a
session was sent.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-09 11:33:49 -07:00

speech

CPU speech for the Hanzo platform: STT (faster-whisper, CTranslate2 int8) and TTS (kokoro-onnx, 82M) behind one OpenAI-shaped surface.

Routes

  • POST /v1/audio/transcriptions — multipart file + model (+language, response_format) → {"text": …}
  • POST /v1/audio/speech — {model, input, voice, response_format} → audio bytes (mp3 default, wav native)
  • GET /v1/models, GET /healthz

Trust model

No auth of its own, in-cluster only. api.hanzo.ai fronts it through the ai plane, which authenticates and meters every caller — a provider row pointing at http://speech.hanzo.svc/v1 is the whole integration. Weights bake into the image at build; the container boots without the network.

Run

uv sync && uv run uvicorn main:app --port 8000

Phase 2 is /v1/realtime: websocket full-duplex (silero-vad segmentation, partial transcripts, kokoro frames, barge-in) plus camera-frame relay into the multimodal models.

S
Description
CPU speech service: STT (faster-whisper) + TTS (kokoro) behind api.hanzo.ai /v1/audio
Readme Apache-2.0
361 KiB
Languages
Go 98.8%
Dockerfile 1.2%