Giter Club home page Giter Club logo

groq_streamlit_demo's Introduction

Groq Chat Streamlit App

Streamlit App

Demo App Screenshot

This Streamlit app integrates with the Groq API to provide a chat interface where users can interact with advanced language models. It allows users to choose between two models for generating responses, enhancing the flexibility and user experience of the chat application.

It is blazing FAST; try it and see! ๐ŸŽ๏ธ ๐Ÿ’จ ๐Ÿ’จ ๐Ÿ’จ

Check out the video tutorial ๐Ÿ‘‡

Watch the video

Features

  • Model Selection: Users can select between mixtral-8x7b-32768, llama2-70b-4096, Gemma-7b-it, llama2-70b-4096, llama3-70b-8192, and lama3-8b-8192 models to tailor the conversation according to each model's capabilities.
  • Chat History: The app maintains a session-based chat history, allowing for a continuous conversation flow during the app session.
  • Dynamic Response Generation: Utilizes a generator function to stream responses from the Groq API, providing a seamless chat experience.
  • Error Handling: Implements try-except blocks to handle potential errors gracefully during API calls.

Requirements

  • Streamlit
  • Groq Python SDK
  • Python 3.7+

Setup and Installation

  • Install Dependencies:

    pip install streamlit groq
  • Set Up Groq API Key:

    Ensure you have an API key from Groq. This key should be stored securely using Streamlit's secrets management:

    # .streamlit/secrets.toml
    GROQ_API_KEY="your_api_key_here"
  • Run the App: Navigate to the app's directory and run:

streamlit run streamlit_app.py

Usage

Upon launching the app, you are greeted with a title and a model selection dropdown.

After choosing a preferred model, you can interact with the chat interface by entering prompts.

The app displays the user's questions and the AI's responses, facilitating a back-and-forth conversation.

Customization

The app can be easily customized to include additional language models (as Groq adds more), alter the user interface, or extend the functionality to incorporate other interactions with the Groq API.

Contributing

Contributions are welcome to enhance the app, fix bugs, or improve documentation.

Please feel free to fork the repository, make changes, and submit a pull request.

groq_streamlit_demo's People

Contributors

tonykipkemboi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.