Skip to content

OpenAI STT model is hardcoded to whisper-1 — make it configurable #25

Description

@jason-shen

Problem

The OpenAI STT client hardcodes the model:

// internal/stt/openai.go
const (
	whisperModel   = "whisper-1"
	...
)

[openai] model exists in config but is only consumed by the LLM client, so there is no way to select OpenAI's newer transcription models — gpt-4o-transcribe and gpt-4o-mini-transcribe — which are more accurate than whisper-1 and, in the mini case, cheaper. For a voice runtime the transcription model is one of the highest-leverage quality knobs available, and right now it is welded shut.

Proposed change

Add a dedicated STT model setting rather than overloading [openai] model — the same [openai] block feeds both LLM and STT, and a single model key cannot mean gpt-4o-mini for chat and gpt-4o-transcribe for transcription at the same time.

  1. internal/config/config.go — add STTModel string \toml:"stt_model"`toOpenAIConfig, mirroring how DeepgramConfigcarries bothmodelandtts_model`.
  2. Default it to whisper-1 in Load() via setDefault, so behaviour is unchanged for existing configs.
  3. internal/stt/openai.go — replace the whisperModel constant with a field on openaiClient, plumbed through NewOpenAIClient.
  4. internal/stt/stt.go — pass cfg.OpenAI.STTModel at the case "openai": call site.
  5. config.toml.example and the README provider table — document the accepted values.

Worth checking while you're in there

gpt-4o-transcribe and whisper-1 are both batch endpoints, so the existing buffer-until-silence approach in this file still applies unchanged. No VAD or streaming work is needed for this issue — keep the scope to model selection.

Acceptance criteria

  • [openai] stt_model = "gpt-4o-transcribe" is used for transcription requests.
  • A config with no stt_model still transcribes with whisper-1.
  • Config test covers the default and the override.

Pointers

  • internal/stt/openai.gowhisperModel const ~L16, NewOpenAIClient ~L56
  • internal/stt/stt.goNewClient, case "openai":
  • internal/config/config.goOpenAIConfig ~L206, Load() defaults ~L300

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueScoped small, with enough context in the issue to start

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions