Custom ChatGPT with Azure OpenAI

An implementation with Python and Streamlit-Chat

Valentina Alto
Microsoft Azure
Published in
4 min readMar 5, 2023

--

ChatGPT was one of the most stunning developments of OpenAI. Since its release to the general public in November 2022, it has been used for so many use cases. However, we are talking about a web preview that cannot be customized both in the backend and front end. That is the reason why, for custom use cases, developers have the possibility to leverage ChatGPT backend model, the GPT3, via REST API or Python SDK and embed them into their application.

Additionally, since the General Availability of Azure OpenAI Service, the very same models are also available as a service in the Azure cloud, benefiting from scalability, flexibility, security, and built-in responsible AI.

In this article, we are going to show how Azure OpenAI models’ API can be embedded in a web app that simulates a simple chatbot (as ChatGPT look like).

We will do so Streamlit, an open-source Python library that makes it easy to create and deploy interactive web applications for machine learning, data science, and other data-driven tasks.

More specifically, we are going to use a component streamlit-chat(you can easily install it via pip install streamlit-chat). You can find the source code at GitHub — AI-Yash/st-chat: Streamlit Component, for

--

--

Valentina Alto
Microsoft Azure

Data&AI Specialist at @Microsoft | MSc in Data Science | AI, Machine Learning and Running enthusiast