feat: add Groq provider support with 10 text generation models #44
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.
Description
This PR adds support for Groq as a new LLM provider for the Obsidian Quiz Generator. Groq offers ultra-fast inference with free tier access to popular open-source models including Llama, Mixtral, and Gemma.
Motivation
Groq provides:
Changes Made
New Files Created
Generator Implementation
src/generators/groq/groqModels.ts- Defines all available Groq text generation modelssrc/generators/groq/groqGenerator.ts- Implements the GroqGenerator classSettings Configuration
src/settings/model/groq/groqConfig.ts- Configuration interface and defaultssrc/settings/model/groq/groqSettings.ts- Settings UI componentModified Files
Core Integration
src/generators/providers.ts- Added GROQ to Provider enumsrc/generators/generatorFactory.ts- Added GroqGenerator to factory mapSettings Integration
src/settings/model/modelConfig.ts- Integrated Groq configurationsrc/settings/model/modelSettings.ts- Added Groq settings UIDocumentation
README.md- Added Groq to Supported Providers sectionSupported Models
The implementation includes all 10 current Groq text generation models:
Technical Implementation
API Compatibility
Groq provides an OpenAI-compatible API, allowing use of the existing OpenAI SDK with a custom baseURL (
https://api.groq.com/openai/v1). This approach:Code Patterns
The implementation follows established patterns from existing providers:
Limitations
Testing
How to Test
npm installandnpm run buildBreaking Changes
None. This is a purely additive change that adds a new provider option without modifying existing functionality.
Checklist
Additional Notes
groqModels.tscan be easily updated as Groq releases new modelsThank you for considering this contribution!