Skip to content

feat: Implement multi-LLM provider support #1

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jivanandham
Copy link

This commit introduces a flexible architecture to support multiple LLM providers for problem analysis and solution generation.

Key changes:

  • LLM Service Abstraction:
    • Introduced an LLMService interface (electron/llmService/llmServiceInterface.ts) defining a common contract for LLM operations (extractProblemInfo, generateSolution, debugSolution).
    • Refactored electron/handlers/problemHandler.ts to use a factory function (getLLMService) that dynamically instantiates an LLM service based on your preference.
  • OpenAI Provider:
    • Created OpenAILLMService (electron/llmProviders/openai.ts) by migrating existing OpenAI API logic into this dedicated class.
  • Provider Configuration:
    • Updated electron/store.ts to store API keys for OpenAI, Gemini (placeholder), Claude (placeholder), Local LLM, and GitHub Marketplace LLM (placeholder), along with a preferredProvider setting.
    • Revamped src/components/ApiKeyAuth.tsx to allow you to input API keys/configurations for multiple providers and select your preferred one. UI elements for Local LLM (base URL) and GitHub Marketplace LLM (API key, model ID) are included.
  • Stubbed Providers:
    • Added LocalLLMService (electron/llmProviders/localLlm.ts) and GitHubMarketplaceLLMService (electron/llmProviders/githubMarketplaceLlm.ts) with stubbed methods as placeholders for future implementation.
  • Documentation:
    • Updated README.md to explain the new multi-provider functionality and configuration process.
  • Testing:
    • Introduced Jest for unit testing.
    • Added tests for getLLMService, OpenAILLMService, and the stubbed provider classes.

This refactoring allows for easier integration of new LLM providers in the future and gives you more flexibility in choosing your preferred service.

This commit introduces a flexible architecture to support multiple LLM providers for problem analysis and solution generation.

Key changes:
- **LLM Service Abstraction:**
    - Introduced an `LLMService` interface (`electron/llmService/llmServiceInterface.ts`) defining a common contract for LLM operations (extractProblemInfo, generateSolution, debugSolution).
    - Refactored `electron/handlers/problemHandler.ts` to use a factory function (`getLLMService`) that dynamically instantiates an LLM service based on your preference.
- **OpenAI Provider:**
    - Created `OpenAILLMService` (`electron/llmProviders/openai.ts`) by migrating existing OpenAI API logic into this dedicated class.
- **Provider Configuration:**
    - Updated `electron/store.ts` to store API keys for OpenAI, Gemini (placeholder), Claude (placeholder), Local LLM, and GitHub Marketplace LLM (placeholder), along with a `preferredProvider` setting.
    - Revamped `src/components/ApiKeyAuth.tsx` to allow you to input API keys/configurations for multiple providers and select your preferred one. UI elements for Local LLM (base URL) and GitHub Marketplace LLM (API key, model ID) are included.
- **Stubbed Providers:**
    - Added `LocalLLMService` (`electron/llmProviders/localLlm.ts`) and `GitHubMarketplaceLLMService` (`electron/llmProviders/githubMarketplaceLlm.ts`) with stubbed methods as placeholders for future implementation.
- **Documentation:**
    - Updated `README.md` to explain the new multi-provider functionality and configuration process.
- **Testing:**
    - Introduced Jest for unit testing.
    - Added tests for `getLLMService`, `OpenAILLMService`, and the stubbed provider classes.

This refactoring allows for easier integration of new LLM providers in the future and gives you more flexibility in choosing your preferred service.
jatinpatwa pushed a commit to jatinpatwa/interview-coder that referenced this pull request Jun 3, 2025
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