Skip to content

feat: configurable transcription model for OpenAI-compatible backends#91

Open
paoloantinori wants to merge 1 commit into
six-ddc:mainfrom
paoloantinori:feat/configurable-transcribe-model
Open

feat: configurable transcription model for OpenAI-compatible backends#91
paoloantinori wants to merge 1 commit into
six-ddc:mainfrom
paoloantinori:feat/configurable-transcribe-model

Conversation

@paoloantinori

Copy link
Copy Markdown
Contributor

Closes #90.

What

Add CCBOT_TRANSCRIBE_MODEL (default gpt-4o-transcribe) so the voice-transcription model is configurable, mirroring OPENAI_BASE_URL / OPENAI_API_KEY. This lets ccbot use any OpenAI-compatible /audio/transcriptions backend, not just OpenAI's hosted API.

Why

See #90. OPENAI_BASE_URL already made the endpoint configurable, but the hardcoded model name blocked OpenAI-compatible backends that serve different model names. Use case: a local Speaches instance running Whisper large-v3-turbo (faster-whisper) on the LAN, for private/offline transcription.

Changes

  • src/ccbot/config.py: self.transcribe_model = os.getenv("CCBOT_TRANSCRIBE_MODEL", "gpt-4o-transcribe")
  • src/ccbot/transcribe.py: use config.transcribe_model instead of the hardcoded literal; module docstring generalized.

Minimal and backwards compatible (2 files, ~11 lines). No behaviour change when the var is unset.

Verification

  • ruff check + pyright: clean.
  • End-to-end against a local Speaches (Whisper large-v3-turbo): a Telegram voice message was transcribed correctly and forwarded to the Claude session.

Notes

  • Naming: used the CCBOT_ prefix for consistency with CCBOT_SHOW_*. Happy to rename if you prefer e.g. OPENAI_TRANSCRIBE_MODEL.
  • The existing guard in voice_handler requires a non-empty OPENAI_API_KEY even for no-auth backends; workaround is any dummy value. Decoupling auth from enablement is left as a possible follow-up, out of scope here.

Voice transcription hardcoded the gpt-4o-transcribe model, which blocked reuse of OPENAI_BASE_URL against OpenAI-compatible backends serving different model names (e.g. a self-hosted Whisper server).

Add CCBOT_TRANSCRIBE_MODEL (default gpt-4o-transcribe) so the model is configurable, mirroring the existing OPENAI_BASE_URL / OPENAI_API_KEY overrides. Verified end-to-end against a local Speaches instance running Whisper large-v3-turbo. Backwards compatible: unset preserves existing OpenAI behaviour.
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.

Configurable transcription model for OpenAI-compatible backends (local Whisper)

1 participant