This is an experimental Streamlit chatbot app built for LLaMA2 (or any other LLM). The app includes session chat history and provides an option to select multiple LLaMA2 API endpoints on Replicate.
Live demo: LLaMA2.ai
For the LLaMA2 license agreement, please check the Meta Platforms, Inc official license documentation on their website. More info.
![llama2 demo](https://private-user-images.githubusercontent.com/5958899/255374554-7512cbd3-ef90-4a9f-b9f6-eab5be7a483f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzODQ5ODIsIm5iZiI6MTcyMDM4NDY4MiwicGF0aCI6Ii81OTU4ODk5LzI1NTM3NDU1NC03NTEyY2JkMy1lZjkwLTRhOWYtYjlmNi1lYWI1YmU3YTQ4M2YucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMjAzODAyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjM4OGI1OGQyNzJjNTA5OGViMDQzMzY4NTU5MjY4NzQwZTE3ZWVkMTBiNzQzZjZhNGRkZmI3M2MxZGVmNWNkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.tqh6lv_V9J8LJ-Cj5M9H7fBf2uw8WeHiryQtqtLs8GI)
- Chat history is maintained for each session (if you refresh, chat history clears)
- Option to select between different LLaMA2 chat API endpoints (7B, 13B or 70B). The default is 70B.
- Configure model hyperparameters from the sidebar (Temperature, Top P, Max Sequence Length).
- Includes "User:" and "Assistant:" prompts for the chat conversation.
- Each model (7B, 13B & 70B) runs on Replicate - (7B and 13B run on one A100 40Gb, and 70B runs on one A100 80Gb).
- Docker image included to deploy this app in Fly.io
- Clone the repository
- Install dependencies with
pip install -r requirements.txt
- Copy the '.env_template' file to '.env' and add your Replicate API token
- For your convenience, we intentionally include model endpoints in the '.env_template' file
- Run the app with
streamlit run llama2_chatbot.py
- Docker image included to deploy this app in Fly.io
- Start the chatbot by selecting an API endpoint from the sidebar.
- Configure model hyperparameters from the sidebar.
- Type your question in the input field at the bottom of the app and press enter.
- First you should install flyctl and login from command line
fly launch
-> this will generate a fly.toml for you automaticallyfly deploy --dockerfile Dockerfile
--> this will automatically package up the repo and deploy it on fly. If you have a free account, you can use--ha=false
flag to only spin up one instance- Go to your deployed fly app dashboard, click on
Secrets
from the left hand side nav, and click onUse the Web CLI to manage your secrets without leaving your browser
. Once you are on your app's web CLI, export all secrets needed. i.eexport REPLICATE_API_TOKEN=your_replicate_token
. Refer to .env.example file for necessary secrets.
- Marco Mascorro - @mascobot
- Yoko Li - @stuffyokodraws
- Rajko Radovanović - @rajko_rad
- Matt Bornstein - @BornsteinMatt
- Guido Appenzeller - @appenz
0.9.0 (Experimental) - July 2023
This project is under development. Contributions are welcome!
- Web chatbot license (this repo): Apache 2.0
- For the LLaMA models license, please refer to the License Agreement from Meta Platforms, Inc.
- Special thanks to the team at Meta AI, Replicate, a16z-infra and the entire open-source community.
This is an experimental version of the app. Use at your own risk. While the app has been tested, the authors hold no liability for any kind of losses arising out of using this application.
The app has been styled and configured for a cleaner look. Main menu and footer visibility have been hidden. Feel free to modify this to your custom application.