This is a simple Python-based interface to interact with Google's Gemini AI models. It supports both text and image inputs and provides a seamless chat experience. The app is hosted as a demo on Hugging Face.
- Chat with Gemini Models: Supports various Gemini models, including vision-enabled ones.
- Image Analysis: Upload images to enhance the conversation with AI. Like with Flash 1.5
- Customizable Settings: Adjust temperature, max tokens, and add system prompts for tailored interactions.
- Interactive UI: Built with Streamlit for an intuitive user experience.
- Uee your own API-Key
Try the app hosted on Hugging Face: Gemini AI Chat
Follow these steps to run the app locally:
-
Clone the Repository:
git clone https://github.com/volkansah/gemini-ai-chat.git cd gemini-ai-chat
-
Install Dependencies: Make sure you have Python 3.7 or newer installed.
pip install -r requirements.txt
-
Run the App:
python app.py
-
Access the App: Open your browser and navigate to
http://localhost:8501
.
- Enter your Google AI API key in the sidebar.
- Select a model:
- For text interactions, choose models without "vision".
- For image-related tasks, use vision-enabled models (e.g.,
gemini-1.5-pro-vision-latest
).
- Adjust the
temperature
andmax tokens
settings for desired output style. - Optionally, provide a system prompt to guide the AI's behavior.
- Upload an image (optional) for vision-based analysis.
- Type your message in the input box and press Enter.
The app uses:
- Streamlit: For creating the interactive web UI.
- Google Generative AI Python SDK: To connect with Google's Gemini models.
- Pillow: For image processing.
- Base64 Encoding: To handle image data.
For more details, see the code in app.py
.
If you encounter any issues or have suggestions, feel free to open an issue or contribute by submitting a pull request.
This project is licensed under the GPL3 License. See the LICENSE file for details.
Created by Volkan Kücükbudak. Follow me on GitHub for more exciting projects!