- 💬 OpenAI Responses API chat UI (migrated from the Assistants API, which OpenAI shut down on 2026-08-26)
- 📚 File search over OpenAI vector stores, with cited sources
- 🏃 Streaming responses, conversation memory via the Conversations API
- 👥 Supports multiple agent profiles in one place
- 🪟 Azure OpenAI client support (untested with the Responses API)
-
👤 Upload your knowledge files to a vector store on the OpenAI site & get its ID (https://platform.openai.com/storage/vector_stores)
-
🔑 Get the API key from OpenAI (https://platform.openai.com/api-keys)
-
⬇️ Clone the repository
$ git clone https://github.com/ryo-ma/gpt-assistants-api-ui.git
-
📦 Install dependencies
$ poetry install
-
✍️ Edit the system prompt in the
INSTRUCTIONSconstant at the top ofapp.py -
⚙️ Set environment variables file
.env# OpenAI settings OPENAI_API_KEY="sk-xxx" AUTHENTICATION_REQUIRED="False" # Must change to True if you require authentication # When using a single agent, set the following and unset OPENAI_AGENTS. MODEL="gpt-4o" VECTOR_STORE_IDS="vs_xxx" # Comma-separated; enables file search over these vector stores AGENT_TITLE="Chat" # Page title # When using multiple agents, set the following instead. OPENAI_AGENTS='[{"title": "Agent X", "model": "gpt-4o", "vector_store_ids": ["vs_xxx"]}]'
If you use azure instead, set
AZURE_OPENAI_ENDPOINTandAZURE_OPENAI_KEY -
🔑 Set Authentication configuration (optional)
To set up authentication, create a secrets file
.streamlit/secrets.tomlas below:[credentials] usernames = { jsmith = {failed_login_attempts = 0, logged_in = false, name = "John Smith", password = "abc"}, rbriggs = {failed_login_attempts = 0, logged_in = false, name = "R Briggs", password = "abc"}} [cookie] expiry_days = 30 key = "some_signature_key" # Must be string name = "some_cookie_name"
Reference: Deploying Streamlit-Authenticator via Streamlit Community Cloud
$ poetry shell
$ streamlit run app.py-
💽 Build image
$ docker compose build
-
🏃️ Run the app
$ docker compose up
Access to http://localhost:8501.
You can fork this repository and deploy the app to https://share.streamlit.io/. No need to run the app on your local machine.
Don't forget to choose 3.10 as the Python version and set environment variables in the "Advanced settings" during deployment.
To use authentication with Streamlit Cloud, please use this TOML format:
# Environment variables
# OpenAI settings
OPENAI_API_KEY="sk-xxx"
AUTHENTICATION_REQUIRED="False" # Must change to True if you require authentication
# When using a single agent, set the following and unset OPENAI_AGENTS.
MODEL="gpt-4o"
VECTOR_STORE_IDS="vs_xxx" # Comma-separated; enables file search over these vector stores
AGENT_TITLE="Chat" # Page title
# When using multiple agents, set the following instead.
OPENAI_AGENTS='[{"title": "Agent X", "model": "gpt-4o", "vector_store_ids": ["vs_xxx"]}]'
# Authentication secrets
[credentials]
usernames = { jsmith = {failed_login_attempts = 0, logged_in = false, name = "John Smith", password = "abc"}, rbriggs = {failed_login_attempts = 0, logged_in = false, name = "R Briggs", password = "abc"}}
[cookie]
expiry_days = 30
key = "some_signature_key" # Must be string
name = "some_cookie_name"