Skip to content

feat: add Groq API as an alternative provider - #1

Merged
htlin222 merged 1 commit into
mainfrom
feat/groq-provider
May 29, 2026
Merged

feat: add Groq API as an alternative provider#1
htlin222 merged 1 commit into
mainfrom
feat/groq-provider

Conversation

@htlin222

Copy link
Copy Markdown
Owner

Summary

Adds Groq as a selectable API provider for both transcription and cleanup, alongside the existing ChatGPT Web (cookies) backend. ChatGPT Web stays the default, so existing behavior is unchanged; Groq is fully opt-in.

Groq uses OpenAI-compatible REST endpoints:

  • transcription → POST /openai/v1/audio/transcriptions (whisper-large-v3-turbo)
  • cleanup → POST /openai/v1/chat/completions (llama-3.3-70b-versatile)

Changes

  • SpeechProvider protocol — ChatGPTBridge and new GroqClient conform.
  • GroqClient — multipart transcription + JSON chat completion over URLSession, Bearer auth.
  • GroqSecrets — key resolution: Keychain → GROQ_API_KEY env → .env (cwd / $HOME).
  • AppState routes warm-up + the recording pipeline through the active provider.
  • Settings: Provider picker; when Groq is selected, a Keychain-backed SecureField + transcribe/cleanup model fields.
  • --selftest --groq path in Diagnostics; README + design doc; version 0.1.0 → 0.2.0.

Testing

  • ✅ Full make build (swiftc -O whole-module) — compiles clean, exit 0.
  • ✅ Binary runs; --selftest --groq executes the Groq branch with correct model defaults and proper missing-key error handling.
  • ⚠️ Live transcription not run here — no GROQ_API_KEY was available in this environment. Verify end-to-end with:
    GROQ_API_KEY=gsk_… build/LizardType.app/Contents/MacOS/LizardType --selftest --groq /path/to/clip.m4a

🤖 Generated with Claude Code

Add a selectable API provider so transcription + cleanup can run on
Groq's OpenAI-compatible REST endpoints instead of the ChatGPT WebView.
ChatGPT Web stays the default; Groq is fully opt-in.

- SpeechProvider protocol; ChatGPTBridge and new GroqClient conform
- GroqClient: multipart /audio/transcriptions (whisper-large-v3-turbo)
  + JSON /chat/completions (llama-3.3-70b-versatile), Bearer auth
- GroqSecrets: key resolution Keychain → GROQ_API_KEY env → .env file
- AppState routes warm-up + pipeline through the active provider
- Settings: provider picker + Groq key (Keychain) / model fields
- Diagnostics --groq self-test path; README + design doc; v0.2.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@htlin222
htlin222 merged commit f301534 into main May 29, 2026
2 checks passed
@htlin222
htlin222 deleted the feat/groq-provider branch May 29, 2026 01:53
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.

1 participant