Application on Streamlit to chat with an LLM. Here we use the LLM gemini-2.0-flash
. We can also alternatively use any other LLM as well. This code will work with Google APIs.
This project is initialized using pdm
. To learn more about pdm
please refer to pdm documentation.
- Install
pdm
using the command:pip install pdm
- Initialize a blank project using the command:
This will provide a bunch of prompts to fill, after which a template is created for you.
pdm init
We require 3 libraries to run this project:
- streamlit: For creating our frontend application
- google-genai: For using Google's LLMs (Like Google Pro, Google Flash models)
python-dotenv
: Used to load .env files
You will have to create a .env file in the root of your repo and include the following:
GOOGLE_API_KEY = <YOUR_API_KEY>
After the required packages, run the following command to start the Streamlit Chatbot app with conversation history:
pdm run streamlit run app.py