Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drankush/keychat

KeyChat: A Multimodal Chat Client with Streamlit
https://github.com/drankush/keychat

chatgpt client dalle-2 llm multimodal openai python streamlit vision-api

Last synced: 24 days ago
JSON representation

KeyChat: A Multimodal Chat Client with Streamlit

Awesome Lists containing this project

README

        

# KeyChat: A Multimodal Chat App with Streamlit ๐Ÿ”‘๐Ÿ’ฌ

KeyChat is a versatile chat application built with Streamlit that allows you to interact with various Large Language Models (LLMs) and image generation models, supporting both text and image inputs. It provides a user-friendly interface for experimenting with different models and settings, enabling both text/vision-based chat and image generation.

## Features โœจ

* **Multimodal Input:** Send text messages and upload images as part of your conversation. ๐Ÿ–ผ๏ธโžก๏ธ๐Ÿ’ฌ
* **Text/Vision Chat:** Engage in conversations with LLMs that can process both text and visual information. ๐Ÿ‘€+๐Ÿ“
* **Image Generation:** Generate images based on text prompts using dedicated image generation models. ๐ŸŽจ๐Ÿค–
* **Model Selection:** Choose from a list of available text/vision and image generation models fetched directly from the API. โœ…
* **Customizable Settings:** Adjust parameters like temperature, max tokens, and image detail level. โš™๏ธ
* **System Message:** Define a persistent system message to guide the LLM's behavior. ๐Ÿ—ฃ๏ธ
* **Chat History:** View previous messages in a convenient chat interface. ๐Ÿ“œ
* **Clear Chat:** Easily clear the chat history to start a new conversation. ๐Ÿงน
* **Custom Base URL:** Allows you to connect to different OpenAI compatible API endpoints. ๐ŸŒ

## Installation ๐Ÿ› ๏ธ

1. **Clone the repository:**

```bash
git clone https://github.com/drankush/KeyChat/.git
cd keychat
```

2. **Install required packages:**

```bash
pip install -r requirements.txt
```

3. **Demo:**

```bash
https://keychat.streamlit.app/
```

## Usage ๐Ÿš€

1. **Run the app:**

```bash
streamlit run app.py
```

2. **Enter your OpenAI API key and Base URL:** In the sidebar, enter your API key and the base URL for the API endpoint. ๐Ÿ”‘
3. **Fetch Models:** Click the "Fetch Models" button to retrieve the available text/vision and image generation models. ๐Ÿ”„
4. **Select Models:** Choose your desired text/vision model and image generation model from the dropdown menus in the sidebar. โฌ‡๏ธ
5. **Optional: Set System Message:** Provide a system message in the sidebar to guide the LLM's responses. ๐Ÿค–๐Ÿ’ฌ
6. **Optional: Adjust Advanced Settings:** Customize the temperature, max tokens, and image detail in the sidebar. ๐ŸŒก๏ธ


application gui

7. **Enter your prompt:** Type your message in the text input area. ๐Ÿ“
8. **Optional: Upload Images:** Upload images using the file uploader. Supported formats: .jpg, .png, .gif, .webp ๐Ÿ–ผ๏ธโฌ†๏ธ
9. **Send your message:** Click the "Send" button to submit your prompt and/or images to the selected model. ๐Ÿš€
10. **Toggle Image Generation Mode:** Use the toggle to switch between Text/Vision Chat and Image Generation mode. In Image Generation mode, only the text input will be used as the prompt to generate an image. ๐Ÿ–ผ๏ธ


application gui

11. **Clear the chat:** Click the "Clear" button to erase the chat history. ๐Ÿงน

## Troubleshooting โš ๏ธ

* **Error Fetching Models:** Double-check your API key and Base URL. Ensure your network connection is stable and that the OpenAI API is accessible. ๐Ÿ“ถ
* **Image Upload Issues:** Verify that the uploaded images are in a supported format (.jpg, .png, .gif, or .webp). ๐Ÿ–ผ๏ธ
* **Other Errors:** Pay attention to the error messages displayed in the app. They often provide clues about the issue. Common errors like "500" may indicate problems with the model provider's services, while "401" usually signifies an incorrect API Key. โŒ

## Contributing ๐Ÿ™Œ

Contributions are welcome! Please feel free to submit bug reports, feature requests, or pull requests.

## License
This project is licensed under the MIT License. ๐Ÿ“„