Skip to content

SriviharReddy/GenAI_GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Provider Chatbot UI

This is a simple web interface for interacting with multiple LLM providers (Google Gemini, OpenAI, Anthropic, Groq, and OpenRouter) using Streamlit and LangChain. The application has been refactored to follow object-oriented programming principles and a modular architecture, making it more maintainable and extensible. This project was created as part of my learning journey to practice working with LLMs, web interfaces, and API integration.

image

Features

  • Clean, user-friendly chat interface
  • Support for multiple LLM providers (Google Gemini, OpenAI, Anthropic, Groq, OpenRouter)
  • Secure API key input with automatic .env file saving
  • Conversation history
  • Real-time chat responses
  • Provider-specific model selection
  • Customizable system prompt
  • Clear chat history functionality
  • Modular architecture with separate files for configuration and chatbot logic

Architecture

The application follows a modular design with separate files:

  • app.py: Main application entry point and UI flow management
  • config.py: Handles provider selection, API key management, model selection, and system prompts
  • chatbot.py: Manages chatbot functionality and communication with multiple LLM providers

Requirements

  • Python 3.8+
  • Streamlit
  • LangChain
  • LangChain Google GenAI
  • LangChain OpenAI
  • LangChain Anthropic
  • LangChain Groq
  • python-dotenv

Setup

  1. Clone this repository
  2. Install the required packages: pip install -r requirements.txt
  3. Run the application: streamlit run app.py
  4. Select your preferred provider from the dropdown in the sidebar
  5. Enter your corresponding API key in the sidebar (the .env file will be automatically created)
  6. Select your preferred model from the dropdown
  7. Optionally customize the AI behavior with the system prompt
  8. Start chatting with the bot!

Note: The application will automatically create and update a .env file to store your API keys. You do not need to manually create this file.

Notes

This is a learning project and may be updated as I continue to develop my skills in working with LLMs and building web interfaces. The modular refactoring improves code organization, maintainability, and extensibility. Feel free to explore, modify, and use this code as a starting point for your own projects.

About

A Streamlit web UI for Google's Gemini models using LangChain. Created as a learning project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages