Skip to content

feat: configurable STT language and optional LLM normalization - #12

Open
kt315 wants to merge 3 commits into
renjfk:mainfrom
kt315:feat/stt-language-and-optional-llm
Open

feat: configurable STT language and optional LLM normalization#12
kt315 wants to merge 3 commits into
renjfk:mainfrom
kt315:feat/stt-language-and-optional-llm

Conversation

@kt315

@kt315 kt315 commented Aug 15, 2026

Copy link
Copy Markdown

Summary

Two backwards-compatible improvements to the STT pipeline:

  1. Configurable language for local whisper — new sttLanguage option.
  2. LLM normalization is now optional — STT works with no endpoint/model.

1. sttLanguage (local whisper)

Local whisper-cli previously ran without an explicit language, defaulting to
English, so non-English speech was transcribed as English. The language is now
configurable via a new option:

["@renjfk/opencode-voice", { "sttLanguage": "auto" }]
  • New option sttLanguage, default "auto" (auto-detection).
  • Passed to local whisper-cli as -l <sttLanguage> (e.g. -l ru, -l auto).
  • Does not affect the remote STT API path or runtime model selection.

2. Optional LLM normalization

Previously the plugin required an LLM endpoint/model, otherwise every
transcription warned or errored. Now:

  • If endpoint and model are configured — normalization runs as before.
  • If LLM config is absent — the raw Whisper transcription is used directly.
    This is a supported mode, not an error/fallback, and produces no warnings.
  • Real LLM failures (endpoint configured but API down) keep the existing
    raw-input fallback.
  • TTS behavior is unchanged (still reports unavailability if LLM is not configured).

The minimal config for STT-only is now just:

["@renjfk/opencode-voice", {}]

Changes

  • lib/stt.jsbuildWhisperCliArgs (adds -l), skip normalization when LLM unconfigured.
  • lib/llm-client.jscreateClient now returns isConfigured.
  • index.js — thread isConfigured into registerSTT.
  • README.md — document sttLanguage and optional LLM.
  • Tests — buildWhisperCliArgs and isConfigured.

Verification

  • npm test — 12 pass
  • npm run check — clean

Copilot AI lite review requested due to automatic review settings August 15, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sttLanguage option (default "auto") and pass it to local whisper-cli via -l.
  • Make LLM normalization conditional on LLM configuration (endpoint + model), while keeping the raw-transcription fallback for real LLM failures.
  • Extend createClient() to report isConfigured, 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.

Comment thread lib/stt.js Outdated
Comment thread lib/llm-client.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants