Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 4, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Transcription (MEET-2 / #367) had no local backend — the product default must work with zero cloud keys (owner directive: cloud supported, local default). Board: MEET-3.
Solution
LocalWhisperengine behind MEET-2'sTranscriptionEngineseam: spawns host-installedwhisper.cppwhisper-cli+ffmpegsubprocesses (shell-less, literal argv, private mkdtemp scratch, SIGKILL on abort, cleanup on all paths) — no native npm addon, no ABI coupling; CI needs neither binary. ffmpeg normalizes any browser audio to 16 kHz mono WAV; whisper JSON is strictly validated. Default model: multilingual Whisper base (~142 MiB) via the existing owner-gated download flow (now hardened: filename traversal guard, can't clobber the chat model). Concurrency clamp: engine-level semaphore (2 jobs, distinct busy error) + per-IP rate limit on the local path → 429 + Retry-After. Settings → AI shows runtime/model state + download affordance (i18n ×4). Env overrides:OPENBOOK_WHISPER_BIN,OPENBOOK_FFMPEG_BIN. Setup docs:docs/local-transcription.md. Stacked on #367 — merge after it.Key files:
packages/server/src/ai/{whisper.ts,service.ts,routes.ts},packages/server/src/ai/whisper.test.ts,packages/server/src/transcription.test.ts,packages/ui/src/components/AiSettings.tsx.Before / After
OPENBOOK_TEST_WHISPER=1) incl. real-speech smokeNo visual change beyond one new Settings section (text-only, i18n'd).
Test procedure
VITEST_MAX_WORKERS=1 pnpm verify(green, exit 0, no native deps). Native: install whisper.cpp + ffmpeg, thenOPENBOOK_TEST_WHISPER=1 OPENBOOK_MODELS_DIR=... pnpm --filter @book.dev/server exec vitest run src/transcription.test.ts.Operational notes
Hosts wanting local transcription install
whisper-cli+ffmpeg(PATH or env overrides) and download the model in Settings → AI — seedocs/local-transcription.md. No migration. Local path is reachable by anonymous readers of public pages (consistent with existing AI-route policy) — bounded by the new clamp. Accepted risk (documented): ffmpeg protocol whitelist retainsfile(requires writer privilege to matter). Binary packaging/distribution is follow-up work.Verify: green serialized. Reviews cleared: security (Sasha — BLOCK→CLEAR after concurrency clamp), code (Quinn). Final HEAD 0a49bb1.
🤖 Generated with Claude Code