Feature: Multi-LLM Provider Support#27
Merged
ShirleyRex merged 10 commits intomasterfrom Mar 15, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Refactors the app’s LLM integration to support multiple providers (OpenAI/Anthropic/Gemini), shifts API key entry to the UI (persisted client-side), and normalizes provider errors surfaced to the frontend.
Changes:
- Introduces an
LLMProviderabstraction with provider adapters (OpenAI, Anthropic, Gemini) and shared error normalization. - Adds provider/model selection to settings + request payloads; updates API routes to instantiate the selected provider.
- Removes
.env-based API key setup and updates docs accordingly.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds Anthropic/Gemini SDK deps; updates Next + eslint config versions. |
| package-lock.json | Lockfile updates for new deps and version resolution changes. |
| lib/settings.ts | Extends persisted settings with provider + model, with sanitization defaults. |
| lib/llm/types.ts | Adds provider types/metadata registry and common interfaces. |
| lib/llm/index.ts | Exposes provider factory + llm exports. |
| lib/llm/openai.ts | OpenAI provider adapter. |
| lib/llm/anthropic.ts | Anthropic provider adapter. |
| lib/llm/gemini.ts | Gemini provider adapter with v1beta binding and system-prompt handling. |
| lib/llm/errors.ts | Adds cross-provider error normalization for UI-safe messages. |
| app/page.tsx | Adds provider/model selector + per-provider API key storage and request payload updates. |
| app/settings/page.tsx | Adds provider and model selection UI. |
| app/questions/page.tsx | Uses per-provider API key storage + includes provider/model in API requests. |
| app/api/classify/route.ts | Uses provider factory + normalized errors. |
| app/api/generate/route.ts | Uses provider factory + normalized errors. |
| app/api/generate-questions/route.ts | Uses provider factory + normalized errors. |
| README.md | Updates setup instructions to UI-based key entry and multi-LLM support. |
| .env.example | Removed env-based API key workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BJTheCod3r
approved these changes
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Refactors the application to support multiple LLM providers (OpenAI, Anthropic, Gemini) and removes the
.envrequirement by migrating to client-side API key management.Changes
localStorage, and passed dynamically in the request payload.v1betaendpoint to support the 2.x models.systemInstructionconfig field (which is notoriously unstable across versions) and manually prepends system instructions to user messages to guarantee cross-model compatibility.gpt-4o-mini,claude-3-5-sonnet-latest,gemini-2.5-flash).Developer Evidence
Testing Notes
localStorageproperly encrypts/stores/clears keys from the settings UI.