This application manages various chatbot services using Chainlit and LlamaIndex. It provides a flexible framework for building and deploying chatbots with advanced capabilities.
demo.mp4
- Detail logging steps: Logs each step of the workflow in detail.
- Multi-step workflows: Supports complex interactions with users through multi-step workflows, allowing for more engaging conversations.
- Prompt optimization: Automatically optimizes user prompts for better responses, enhancing the overall user experience.
- Web Search: Integrates a web search capability using the Tavily search tool to provide real-time answers based on user queries.
- Authentication: Supports user authentication via GitHub and Google, allowing for secure access to the chatbot services.
- LiteLLM: LiteLLM provides a proxy server to manage auth, loadbalancing, and spend tracking across 100+ LLMs. All in the OpenAI format.
- Literal AI: Literal AI is the go-to LLM evaluation and observability platform built for Developers and Product Owners.
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/bmd1905/e2e-chainlit-chatbot.git cd e2e-chainlit-chatbot
-
Install the required dependencies:
# Create and activate environment conda create -n e2e-chainlit-chatbot python=3.11 -y conda activate e2e-chainlit-chatbot # Install libraries pip install -r requirements.txt
-
External API Keys
Please follow .env.example
to create .env
file and add the following keys:
cp .env.example .env
Then add the following keys:
- OpenAI API Key:
OPENAI_API_KEY
, https://platform.openai.com/api-keys - Gemini API Key:
GEMINI_API_KEY
, https://aistudio.google.com/app/apikey - Groq API Key:
GROQ_API_KEY
, https://console.groq.com/keys - Tavily API Key:
TAVILY
, https://app.tavily.com/home
- Chainlit Configuration
Please run chainlit create-secret
to create a secret for your application, then put the secret in .env
file as CHAINLIT_AUTH_SECRET
.
- LiteLLM Configuration
Open the litellm_config.yaml
file and set the api_key
for the models you want to use. In case you don't have the api key, just comment it out.
If you want to use other models, you can add them to the litellm_config.yaml
file (make sure to add the api key in the .env
file). Here is the link for the model list.
- Literal AI Configuration (Optional but Easy)
Go to the Literal AI and create an account. Then create a new project and get the api key. Put the api key in the .env
file as LITERAL_API_KEY
.
- OAuth Configuration (Optional but Complex)
Please follow the link to set up the OAuth configuration.
-
Start the LiteLLM proxy server:
make litellm
-
Start the chatbot service:
make cl
-
Access the chatbot: Open your browser and navigate to
http://localhost:8000
to interact with your chatbot. -
Chat with the bot: Once the application is running, you can start chatting with the bot. It will respond based on the configured workflows and models. For example, you can ask it questions or give it commands related to its capabilities.
If you would like to contribute to this project, please fork the repository and submit a pull request. Make sure to follow the coding standards and include tests for any new features.
This project is licensed under the MIT License. See the LICENSE file for more details.