Here’s a basic README.md template for your Streamlit application:

Meta-Llama-3-8B-Instruct Streamlit Chat

This repository contains a Streamlit application that allows users to chat with CentML’s Serverless API. The application streams responses in real-time, displaying a conversation-style interface.

Features

  • Real-time response streaming: As the assistant generates responses, they are displayed in real-time, simulating a natural conversation.
  • Chat history: The application maintains a persistent chat history, allowing users to see the full context of their conversation.
  • Simple and intuitive interface: The app uses Streamlit’s straightforward UI elements, making it easy to input messages and view responses.

Requirements

  • Python 3.8+
  • A valid CentML API key (to be set as an environment variable CENTML_API_KEY)
  • Streamlit library
  • Requests library

Installation

  1. Enter directory:
   cd chat-apps/streamlit
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up your CentML API key as an environment variable:
export CENTML_API_KEY=your_centml_api_key_here

Running the Application

  1. Run the Streamlit app:
streamlit run app.py
  1. Open your browser and navigate to the URL provided in the terminal (usually http://localhost:8501).

Usage

  1. Once the app is running, you can enter a message in the text input box and click “Send.”
  2. The assistant’s responses will be streamed in real-time below the input box.
  3. Your conversation history will be displayed in the order of user and assistant messages.

Customization

• To modify the model used or other parameters such as temperature, max tokens, or penalties, you can edit the stream_response function in app.py. • You can also customize the UI by modifying the Streamlit components.

Environment Variables

• CENTML_API_KEY: Your CentML API key. This is required for interacting with CentML’s API.

Contact

If you have any questions or issues, feel free to open an issue or contact the repository maintainer.