Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support custom Whisper API endpoints for voice transcription #2634

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mbailey
Copy link

@mbailey mbailey commented Dec 15, 2024

Add support for custom Whisper API endpoints

2024-12-18: Third rewrite - more compatible with existing conventions for handling API keys

This PR adds the ability to use alternative Whisper API providers for voice transcription, while maintaining backwards compatibility with the default OpenAI endpoint.

Key Changes

  • Added support for custom Whisper API endpoints via WHISPER_API_BASE and WHISPER_API_KEY environment variables
  • Updated the voice transcription logic to handle both custom and OpenAI endpoints
  • Added validation to require a specific API key when using custom endpoints
  • Updated documentation to explain the new configuration options
  • Added new test cases to verify API endpoint and key handling

API Key Behavior

  • When using a custom Whisper endpoint (WHISPER_API_BASE):
    • Must provide a corresponding WHISPER_API_KEY
    • OpenAI API key will not be used
  • When using default OpenAI endpoint:
    • Will use WHISPER_API_KEY if provided
    • Falls back to OPENAI_API_KEY if no Whisper-specific key is set

Documentation Updates

  • Added configuration examples in the optional installation docs
  • Updated voice coding documentation to reference the new features
  • Added new environment variables to the sample.env file

This change enables users to:

  • Use alternative Whisper API providers
  • Run Whisper locally or on their own infrastructure
  • Better control costs and data privacy for voice transcription

@CLAassistant
Copy link

CLAassistant commented Dec 15, 2024

CLA assistant check
All committers have signed the CLA.

@mbailey mbailey force-pushed the feat/allow-use-of-other-whisper-api-endpoints-take-2 branch from 617b359 to 5911c51 Compare December 15, 2024 12:16
@mbailey mbailey force-pushed the feat/allow-use-of-other-whisper-api-endpoints-take-2 branch 2 times, most recently from e3d656c to 110094b Compare December 17, 2024 15:48
@mbailey
Copy link
Author

mbailey commented Dec 17, 2024

I rewrote it and force pushed. I've updated the PR description to reflect that it now follows Aider conventions for handing API keys and env vars.

@mbailey mbailey force-pushed the feat/allow-use-of-other-whisper-api-endpoints-take-2 branch 2 times, most recently from 10120d8 to b9ad3eb Compare December 19, 2024 04:26
This change adds the ability to use alternative Whisper API providers
for voice transcription, while maintaining backwards compatibility
with the default OpenAI endpoint.

- Added support for custom Whisper API endpoints via `WHISPER_API_BASE` and `WHISPER_API_KEY` environment variables
- Updated the voice transcription logic to handle both custom and OpenAI endpoints
- Added validation to require a specific API key when using custom endpoints
- Updated documentation to explain the new configuration options
- Added new test cases to verify API endpoint and key handling

- When using a custom Whisper endpoint (`WHISPER_API_BASE`):
  - Must provide a corresponding `WHISPER_API_KEY`
  - OpenAI API key will not be used
- When using default OpenAI endpoint:
  - Will use `WHISPER_API_KEY` if provided
  - Falls back to `OPENAI_API_KEY` if no Whisper-specific key is set

- Added configuration examples in the optional installation docs
- Updated voice coding documentation to reference the new features
- Added new environment variables to the sample.env file

This change enables users to:

- Use alternative Whisper API providers
- Run Whisper locally or on their own infrastructure
- Better control costs and data privacy for voice transcription
@mbailey mbailey force-pushed the feat/allow-use-of-other-whisper-api-endpoints-take-2 branch from b9ad3eb to 930a652 Compare December 19, 2024 06:07
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