Skip to content

Conversation

@anxkhn
Copy link

@anxkhn anxkhn commented Nov 25, 2025

Summary

This pull request introduces full multi provider support for the Reflex Chat application. It adds first class integration for OpenAI, Ollama, and Google Gemini including Vertex AI, along with a streamlined provider architecture, configuration layer, and UI controls for switching providers and models.

The PR also modernizes dependency management, updates the README, and improves the chat state handling to be provider agnostic.

Key Changes

Multi Provider Architecture

  • Added a unified provider abstraction through a new LLMProvider base class.

  • Implemented three concrete providers:

    • OpenAIProvider
    • OllamaProvider
    • GoogleGenAIProvider with optional Vertex AI mode.
  • Added LLMProviderFactory to create provider instances based on environment variables.

Provider Configuration

  • Added .env.example containing all required environment variables for each provider.
  • Added automatic loading of .env via python-dotenv.
  • Added validation backed by per provider config checking.

Application State Updates

  • State now initializes the correct LLM provider on startup.
  • State handles switching models and providers.
  • Added reactive provider specific errors.
  • Replaced direct OpenAI calls with generic provider streaming.

UI Enhancements

  • Added a provider selection UI component with:

    • provider selector
    • model selector
    • refresh button
    • status indicators
    • error display
    • configuration help accordion
  • Added a compact provider status bar in the navbar.

README Rewrite

  • Expanded documentation to cover all supported providers.
  • Added setup steps with clear instructions for OpenAI, Ollama, and Gemini.
  • Added environment reference table.
  • Added uv install instructions and improved onboarding.

Dependency and Build Updates

  • Added pyproject.toml for modern package management.
  • Regenerated requirements.txt using uv.
  • Added new dependencies: google-genai, ollama, python-dotenv.

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