stlite: Serverless Streamlit — Run Your Apps in the Browser

Alan Jones
Data Visualization, Data Science and Python
7 min readFeb 10, 2024

--

Are you being served? — Photo by Blake Wisz on Unsplash

stlite is a browser-based implementation of Streamlit that can run apps on a web page without having to deploy to a Streamlit server

Of course, there is always a server involved. A simple web page is loaded from a server (along with its dependencies) before being displayed in the browser.

By ‘serverless’ we mean that there is no server-based code that is an integral part of the web application. In a typical server-based application, such as a Flask app, the web page — typically as a result of a user action — will call a function on the server to retrieve new data and the web page will be updated with this data.

Streamlit is very much server-based: each time there is a user interaction the server is notified, the whole of the application is re-run on the server, and the web page is updated.

A Streamlit app is coded in Python so the server requires a Python interpreter along with the Streamlit library to run the app and generate the web page.

Pyodide

So, how can we operate without a server where the Python code runs?

Answer: Pyodide.

--

--