I was looking for a simple chat interface to use with Azure AI Inference or Azure OpenAI Service for quick prototyping and demos, but couldn’t find one that fit. So I built my own. Maybe it’ll be useful for you too.
Technologies used
- Streamlit: A Python framework for building apps and interactive UIs with minimal code – perfect for quick prototypes and demos.
- Azure AI Inference client library for Python: A Python client library to work with AI models deployed to Azure AI Foundry, Azure OpenAI Service, and GitHub.
Features
- Supports both text and image inputs
- Seamlessly switch between preconfigured AI models via a dropdown menu
- Select from predefined system prompt templates or enter custom instructions
- Non-persistent chat history managed with Streamlit session state, including options to view or clear the session
- Print messages and session state to console for troubleshooting
Getting started
The project includes a Dev Container definition, so you can get started quickly with GitHub Codespaces, VS Code Dev Containers, or manual setup if you prefer.
1. Clone the repository:
git clone https://github.com/gerbermarco/simple-azure-ai-streamlit-chat.git cd simple-azure-ai-streamlit-chat
2. Copy and modify the .env
file:
cp .env.example .env # Edit .env and update the values with your details
3. Install dependencies:
pip install -r requirements.txt
4. Run the Streamlit app:
streamlit run app.py
Once you run the streamlit run
command, Streamlit will launch a local server. You can then open the app by navigating to the provided URL in your browser.
Get the code
You’ll find the full project, setup instructions, and code on GitHub: gerbermarco/simple-azure-ai-streamlit-chat