Skip to content

Instantly share code, notes, and snippets.

@kanzure
Created April 13, 2025 19:04
Show Gist options
  • Save kanzure/1a83a277e4db4805e77acef4126aea52 to your computer and use it in GitHub Desktop.
Save kanzure/1a83a277e4db4805e77acef4126aea52 to your computer and use it in GitHub Desktop.
use groq whisper with aider for /voice
diff --git a/aider/voice.py b/aider/voice.py
index c9af7ae9..ae4bfba8 100644
--- a/aider/voice.py
+++ b/aider/voice.py
@@ -167,7 +167,7 @@ class Voice:
with open(filename, "rb") as fh:
try:
transcript = litellm.transcription(
- model="whisper-1", file=fh, prompt=history, language=language
+ model="groq/whisper-large-v3", file=fh, prompt=None, language=language
)
except Exception as err:
print(f"Unable to transcribe {filename}: {err}")
@@ -181,7 +181,7 @@ class Voice:
if __name__ == "__main__":
- api_key = os.getenv("OPENAI_API_KEY")
+ api_key = os.getenv("GROQ_API_KEY")
if not api_key:
- raise ValueError("Please set the OPENAI_API_KEY environment variable.")
+ raise ValueError("Please set the GROQ_API_KEY environment variable.")
print(Voice().record_and_transcribe())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment