This repository contains a multipage Streamlit application that demonstrates the use of Llama 2 for building:
- A Chatbot: A conversational assistant leveraging the Llama 2 model with customizable global prompts for specific use cases.
- A RAG Environment: A setup for Retrieval-Augmented Generation (RAG) using the same model to enable precise and context-driven responses based on external knowledge sources.
- Interactive Chatbot: Seamlessly integrates the Llama 2 model as a conversational agent.
- Custom Prompts: Allows tailoring of the chatbot’s behavior and tone through global prompt configurations.
- RAG Workflow: Combines the Llama 2 model with retrieval techniques to generate responses enriched by external document-based knowledge.
- User-Friendly Interface: A clean, intuitive multipage application powered by Streamlit.
Before running the application, ensure you have the following:
- Python 3.8+ installed.
- Required dependencies specified in the
requirements.txtfile. You can install them using:pip install -r requirements.txt
- Access to the Llama 2 model. You may need to configure your environment to download or connect to the model.
Follow these steps to get started with the application:
-
Clone the Repository:
git clone https://github.com/gmontenegrou/custom-LLM-st.git cd custom-LLM-st -
Install Dependencies:
Make sure all necessary packages are installed:pip install -r requirements.txt
-
Run the Application:
Launch the Streamlit app from your terminal:streamlit run chatbot_app_st.py
-
Explore the App:
- Chatbot Page: Interact with the Llama 2-powered chatbot for general or custom conversational tasks.
- RAG Environment: Load documents and query them to see RAG in action.
-
Chatbot Functionality:
The chatbot leverages the Llama 2 model to process user inputs and generate coherent responses. Custom global prompts can be defined in the configuration to tailor the assistant's tone and style. -
RAG Setup:
- Documents are preprocessed and stored in a vector database (e.g., FAISS, Pinecone, or similar).
- Queries are processed to retrieve relevant document snippets, which are then passed to the Llama 2 model to generate responses enriched with factual context.
-
Streamlit Interface:
The application uses Streamlit's multipage architecture to provide a clean separation between the chatbot interface and the RAG environment.
- Add support for multiple LLMs (e.g., GPT-Neo, BLOOM).
- Enhance RAG functionality with re-rankers for better document relevance.
- Introduce support for multilingual input and output.
- Allow real-time customization of global prompts directly through the UI.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
feature/your-feature-name). - Commit your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Meta's Llama 2 for providing the foundational model.
- Streamlit for making web app development simple and accessible.