feat: configurable transcription model for OpenAI-compatible backends#91
Open
paoloantinori wants to merge 1 commit into
Open
feat: configurable transcription model for OpenAI-compatible backends#91paoloantinori wants to merge 1 commit into
paoloantinori wants to merge 1 commit into
Conversation
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.
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.
Closes #90.
What
Add
CCBOT_TRANSCRIBE_MODEL(defaultgpt-4o-transcribe) so the voice-transcription model is configurable, mirroringOPENAI_BASE_URL/OPENAI_API_KEY. This lets ccbot use any OpenAI-compatible/audio/transcriptionsbackend, not just OpenAI's hosted API.Why
See #90.
OPENAI_BASE_URLalready 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 Whisperlarge-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: useconfig.transcribe_modelinstead 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.large-v3-turbo): a Telegram voice message was transcribed correctly and forwarded to the Claude session.Notes
CCBOT_prefix for consistency withCCBOT_SHOW_*. Happy to rename if you prefer e.g.OPENAI_TRANSCRIBE_MODEL.voice_handlerrequires a non-emptyOPENAI_API_KEYeven for no-auth backends; workaround is any dummy value. Decoupling auth from enablement is left as a possible follow-up, out of scope here.