feat: configurable STT language and optional LLM normalization - #12
Open
kt315 wants to merge 3 commits into
Open
feat: configurable STT language and optional LLM normalization#12kt315 wants to merge 3 commits into
kt315 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the speech-to-text (STT) pipeline more flexible by (1) allowing the local whisper-cli language to be configured and (2) making LLM-based transcription normalization optional so STT can run with an empty plugin config.
Changes:
- Add
sttLanguageoption (default"auto") and pass it to localwhisper-clivia-l. - Make LLM normalization conditional on LLM configuration (
endpoint+model), while keeping the raw-transcription fallback for real LLM failures. - Extend
createClient()to reportisConfigured, thread that through plugin initialization, and add tests/docs for the new behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/stt.js | Adds buildWhisperCliArgs() with -l, and skips normalization when LLM isn’t configured. |
| lib/llm-client.js | Returns isConfigured alongside complete. |
| index.js | Wires isConfigured into registerSTT so normalization becomes optional. |
| test/stt.test.js | Adds unit tests for buildWhisperCliArgs() language flag behavior. |
| test/llm-client.test.js | Adds unit test coverage for isConfigured behavior. |
| README.md | Documents sttLanguage and that STT works without LLM configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Two backwards-compatible improvements to the STT pipeline:
sttLanguageoption.endpoint/model.1.
sttLanguage(local whisper)Local
whisper-clipreviously ran without an explicit language, defaulting toEnglish, so non-English speech was transcribed as English. The language is now
configurable via a new option:
sttLanguage, default"auto"(auto-detection).whisper-clias-l <sttLanguage>(e.g.-l ru,-l auto).2. Optional LLM normalization
Previously the plugin required an LLM
endpoint/model, otherwise everytranscription warned or errored. Now:
endpointandmodelare configured — normalization runs as before.This is a supported mode, not an error/fallback, and produces no warnings.
raw-input fallback.
The minimal config for STT-only is now just:
["@renjfk/opencode-voice", {}]Changes
lib/stt.js—buildWhisperCliArgs(adds-l), skip normalization when LLM unconfigured.lib/llm-client.js—createClientnow returnsisConfigured.index.js— threadisConfiguredintoregisterSTT.README.md— documentsttLanguageand optional LLM.buildWhisperCliArgsandisConfigured.Verification
npm test— 12 passnpm run check— clean