Build speech-to-text into the bridge; add droplet deployment examples

STT_PROVIDER now defaults to "builtin": Whisper (onnx-community/whisper-base,
q8) runs in the bridge process on the CPU via @huggingface/transformers, so
no provider account is needed and recordings stay on the bridge host. Silent
captures are detected by level before the model runs. The external
OpenAI-compatible adapter remains available.

Tests: 130 unit/integration; 4 scenarios with the real model on a real
speech recording (npm run test:real-stt). Not tested on audio from the
glasses or on a droplet.

deploy/ and docs/deploy-droplet.md are examples that have not been run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-18 18:31:30 -08:00
co-authored by Claude Fable 5.2
parent 3c9e094977
commit 6d74f9e121
29 changed files with 1602 additions and 42 deletions
+10 -6
View File
@@ -99,10 +99,15 @@ a suspended stream. The microphone is never reopened without a new tap.
|---|---|---|
| The public SDK has no speech-to-text API. | **unsupported** | No ASR in `sdk:` types, docs or skills. The official `asr` template says "The STT client itself is a blank stub... You pick your own provider". |
Decision: one server-side adapter for any service that implements the OpenAI
`POST /audio/transcriptions` contract (hosted or self-hosted Whisper). It is exercised only
against a test fake so far. **No real STT provider has been run**; none was available on the
development machine and choosing a paid one is Dan's decision (see "Decisions needed").
Decision (updated after Dan asked for speech-to-text to be built in and to run on a droplet):
the bridge runs OpenAI's Whisper model itself, on the CPU, through ONNX Runtime
(`@huggingface/transformers` 4.3.2, model `onnx-community/whisper-base`, 8-bit weights). No
provider account, and recordings never leave the bridge host. An adapter for any external
OpenAI-compatible transcription endpoint remains as an alternative.
Status: **tested with a real speech recording** (an 11 s archive clip, transcribed correctly in
about 1.6 s on the development desktop; see `docs/test-evidence.md`). **Not tested** with audio
from a G2 microphone, with background noise, with other languages or accents, or on a droplet.
### 4. Input events
@@ -267,8 +272,7 @@ permissions and approval policy are unverified.
1. **Device access.** Nothing here is device-tested. The checklist is `docs/device-test-plan.md`.
Lock-screen capture comes first because it can invalidate the product's first outcome.
2. **STT provider.** Hosted (per-minute cost, audio leaves your network) or self-hosted Whisper
(free, needs a machine). The adapter is the same either way.
2. ~~STT provider.~~ Decided 2026-11-18: built into the bridge.
3. **Target Hermes.** Which deployment and profile the bridge should point at, and a safe
read-only test profile for the first real run.
4. **Distribution model**, given the per-build network whitelist: one build per deployment, or a