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

Feature/add groq support #418

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

myronkharkover
Copy link

Add Groq Translation Support
Adds support for using Groq's LLaMA 3.3 70B model via their OpenAI-compatible API endpoint for text translation.
Changes

  • Added GroqTranslator class inheriting from OpenAITranslator
  • Added Groq to service map in GUI
  • Added documentation for Groq environment variables

Testing

Set environment variable: GROQ_API_KEY=your_api_key
Test via CLI: pdf2zh example.pdf -s groq
Test via GUI: Select "Groq" from services dropdown

Required Environment Variables
CopyGROQ_API_KEY: Your Groq API key
GROQ_MODEL: llama-3-3-70b-versatile (default)

Documentation

Groq API docs: https://console.groq.com/docs
OpenAI compatibility: https://console.groq.com/docs/openai-migration

Additional Context

Uses Groq's OpenAI-compatible endpoint to maximize compatibility with existing code
Default model (LLaMA 3.3 70B) chosen for optimal balance of speed and translation quality
No code changes needed beyond adding the new translator class due to OpenAI API compatibility

@Byaidu Byaidu merged commit 592ec8a into Byaidu:main Jan 6, 2025
0 of 2 checks passed
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.

3 participants