2.2 KiB
2.2 KiB
Manual verification: server engine (M5, D-013)
The dev environment has no Python package manager and no browser, so — like
tests/offline.md and tests/live.md — the real-inference path needs a
manual run on a machine with Python ≥ 3.9. Everything protocol- and
HTTP-level is already covered by bun test (tests/transcribe.test.ts
exercises the real Bun.spawn supervisor against
tests/fixtures/fake_sidecar.py, plus the degradation paths against the real
server-py/sidecar.py).
1. Install the sidecar dependencies
python3 -m pip install -r server-py/requirements.txt
2. Opt-in automated pass (no browser needed)
FW_INTEGRATION=1 bun test tests/transcribe.test.ts
Runs the real sidecar end to end (spawn → ready handshake → tiny.en load →
transcribe → done). First run downloads ~75 MB of weights from the Hub.
- The
real faster-whisper sidecardescribe block passes.
3. In-browser run (both engines, same audio)
bun run dev, open the app, register/sign in.GET /api/transcribe/status(with the session cookie) returns{"available": true}— e.g. check the Network tab.- Pick
Whisper Tiny (English); transcribe a short clean English clip (e.g. the JFK "ask not…" sample) on device. Note the transcript. - Switch the engine toggle to Server (visible only while signed in;
requires the M5 UI wiring — until that lands, drive it manually:
curl -X POST --data-binary @audio.f32 -b "sid=…" \ "http://localhost:3000/api/transcribe?model=onnx-community/whisper-tiny.en"whereaudio.f32is raw float32 mono 16 kHz PCM). - Transcribe the same clip through the server engine.
- Segments stream in as JSON lines (not one blob at the end).
- Both transcripts agree in content (minor punctuation/casing drift between Transformers.js and faster-whisper is expected).
- Signed out, the toggle is gone and
POST /api/transcribeanswers 401. - Second request on the same model is visibly faster (no reload — warm-up strategy).
AUTH_ENABLED=false bun run dev:/api/transcribe*answers 404 and the anonymous browser flow is unaffected.
When this passes, check off the M5 integration item in WorkBreakdown.md.