mirror of
https://github.com/hanzoai/speech.git
synced 2026-10-04 07:37:19 +00:00
7830dedfb21e1d72e55d2b0997cb69eb609c6f2a
0.1.10 built, tested and pushed green, and then stranded itself. The pin step asks KMS for UNIVERSE_PIN_TOKEN, took a single 503, and exited — so the newest image sat in the registry unreferenced while the cluster kept serving 0.1.6. That is precisely the failure pin.sh was written to end, arriving one step earlier than the step it guards. The 503 was not a fault. api.hanzo.ai serves KMS from ONE replica on a ReadWriteOnce volume — only one pod can mount it — so every deploy of that service is a minute or so with nothing answering, and it deploys often. Any release whose pin lands in that window loses, at random, for no reason of its own. Reading a secret is idempotent, so the fix is to ask again: six tries over ~100s, which outlasts a rollout. A KMS that is genuinely down still fails the build and still says which endpoint and org it asked. Proven three ways before shipping, because an untested retry is worse than none — it turns a loud failure into a slow one. A URL that answers passes straight through with no retries; a URL that always 503s gives up after six and reports it; and a stand-in that refuses twice then answers recovers on the third call. Co-authored-by: Hanzo Dev <[email protected]>
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— multipartfile+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.
Description
CPU speech service: STT (faster-whisper) + TTS (kokoro) behind api.hanzo.ai /v1/audio
361 KiB
Languages
Go
98.8%
Dockerfile
1.2%