Draft
Conversation
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.
This pull request introduces major enhancements to support multiple LLM providers (OpenAI, Anthropic, Google Gemini, Ollama, and Vercel AI Gateway) using a provider-agnostic architecture. It also adds a new persistent app config store, updates environment and configuration handling, and removes the legacy
OpenAIAdapterin favor of a unified interface. These changes make the system more flexible, extensible, and easier to configure for different AI backends.Key changes:
Multi-provider LLM support and configuration
Added support for multiple LLM providers (OpenAI, Anthropic, Google, Ollama, Gateway) via the Vercel AI SDK, replacing the previous OpenAI-only integration. Environment variables, configuration schemas, and documentation have been updated to reflect this change. (
.env.example,README.md,package.json,src/infra/env.ts, [1] [2] [3] [4] [5] [6] [7]Introduced a new provider-agnostic LLM adapter interface (
LLMAdapter) with support for schema-based JSON outputs, runtime provider selection, and capability introspection. (src/infra/llm/LLMAdapter.ts, src/infra/llm/LLMAdapter.tsR1-R34)Removed the legacy
OpenAIAdapterand replaced all usage with the new unified LLM adapter approach. (src/infra/OpenAIAdapter.ts, src/infra/OpenAIAdapter.tsL1-L237)App configuration persistence
app_configdatabase table and migration to persist runtime settings (e.g., LLM provider/model) in a key-value format. (src/infra/db/migrations/20260104_add_app_config.cjs, [1];src/infra/db/schema.sql, [2]API and domain changes
Refactored the
/configAPI endpoints to support dynamic LLM provider/model configuration using a newLLMConfigService, with validation and error handling. (src/api/configRoutes.ts, [1];src/api/index.ts, [2] [3] [4]Updated domain error handling to generalize OpenAI errors as LLM errors and expanded audit event types to include LLM provider changes and failures. (
src/domain/errors.ts, [1];src/domain/entities/AuditEntry.ts, [2]