Skip to content

Conversation

@umidjon-2231
Copy link

  • Add factory pattern for LLM providers (OpenAI, Anthropic, Google, Azure, Ollama, Groq)
  • Add factory pattern for image generation (OpenAI, FAL, Stability, Replicate)
  • Create AIService using Vercel AI SDK for cross-provider structured outputs
  • Replace hardcoded OpenAI usage with configurable factories
  • Add CopilotKit adapter factory for multiple providers
  • Remove deprecated OpenaiService in favor of new AIService
  • Backward compatible: defaults to OpenAI when no provider configured

What kind of change does this PR introduce?

Feature - Configurable AI/LLM providers via environment variables

Why was this change needed?

Currently, the AI functionality is hardcoded to use OpenAI. This limits users who want to use alternative providers like Anthropic, Google AI, Azure OpenAI, Ollama (self-hosted), or Groq. This change allows users to configure their preferred AI provider through environment variables without code changes, while maintaining full backward compatibility for existing deployments using only OPENAI_API_KEY.

Other information:

New environment variables:

  • LLM_PROVIDER - openai (default), anthropic, google, azure, ollama, groq
  • LLM_MODEL - Model name (defaults to gpt-4.1)
  • LLM_TEMPERATURE - Temperature setting (defaults to 0.7)
  • IMAGE_PROVIDER - openai (default), fal, stability, replicate
  • IMAGE_MODEL - Image model name (defaults to dall-e-3)

Required new dependencies:

pnpm add ai @langchain/anthropic @langchain/google-genai @langchain/ollama @langchain/groq @ai-sdk/anthropic @ai-sdk/google @ai-sdk/azure

Checklist:

- Add factory pattern for LLM providers (OpenAI, Anthropic, Google, Azure, Ollama, Groq)
- Add factory pattern for image generation (OpenAI, FAL, Stability, Replicate)
- Create AIService using Vercel AI SDK for cross-provider structured outputs
- Replace hardcoded OpenAI usage with configurable factories
- Add CopilotKit adapter factory for multiple providers
- Remove deprecated OpenaiService in favor of new AIService
- Backward compatible: defaults to OpenAI when no provider configured

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Jan 17, 2026

@umidjon-2231 is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

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