A Streamlit application that integrates with OpenAI's Assistant API.
- Python 3.11+
- Docker and Docker Compose (for Docker setup)
- OpenAI API key
- OpenAI Assistant ID
- Clone the repository
git clone https://github.com/allseeteam/openai-assistant-streamlit
cd openai-assistant-streamlit- Create .env file from example
cp .env.example .env- Configure the .env file with your settings:
# OpenAI Configuration
OPENAI_API_KEY="your-api-key"
OPENAI_ASSISTANT_ID="your-assistant-id"
# OPENAI_PROXY_URL="your-proxy-url" # Optional: Proxy URL for OpenAI API requests
# Streamlit System Settings
STREAMLIT_SYSTEM_PORT=8501
STREAMLIT_SYSTEM_PASSWORD=your-password
# Streamlit Text Settings
STREAMLIT_TEXTS_PASSWORD_REQUEST="Enter password"
STREAMLIT_TEXTS_PASSWORD_INCORRECT="Incorrect password"
STREAMLIT_TEXTS_TITLE="Demo Application"
STREAMLIT_TEXTS_CHAT_INPUT="Enter message"- Create and activate Python virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Run the application
python -m streamlit run src/app.pyThe application will be available at http://localhost:8501 (or your configured port)
- Build and start the container (using environment variables for port mapping)
docker compose --env-file .env up --buildThe application will be available at http://localhost:8501 (or your configured port)
- Stop the application
docker compose down- View logs
docker compose logs -fTo modify the application:
- For local development, make changes and Streamlit will automatically reload
- For Docker setup, rebuild the container after changes:
docker compose --env-file .env up --build