The AI Algorithm implemented in streamlit runs on server-side or client-side

Hello everyone,

I wonder that the AI that implemented into streamlit runs on server-side or client-side?

Thank you.

Hi,

Good question and something that can be hard to grasp initially. There’s a multi-threaded server running in the background which executes your Python code (e.g. your AI algorithm). What you see in the browser is just the visual output of the st.* functions (widgets) which you will have added to your Python script/program. WebSockets are used to move information back and forth between the server and browser. Whenever there’s an interaction through a widget, and a state change occurs, the server will run your Python script again, with this new state, from the top (important!).

Best,
Arvindra

1 Like