Build custom ML tools with Streamlit
25 Nov 2019 · 43 min
Adrien Treuille, Streamlit's co-founder, explains how the Python framework lets ML teams build internal tools and dashboards without web development. Streamlit started from frustration with Jupyter notebooks and Shiny, and handles use cases from demos to data annotation and monitoring.
Chapters
Bandwidth for Changelog is provided by Fastly. Learn more@fastly.com we move fast and fix things here at Changelog because of Rollbar. Check them out@rollbar.com and we're hosted on Linode Cloud Servers. Head to linode.com changelog this episode is brought to you by Digital Ocean, the simplest cloud platform out there and we're excited to share. They now offer dedicated virtual droplets and unlike standard droplets which use shared virtual CPU threads, there are two performance plans. General purpose CPU optimized They have dedicated virtual CPU threads. This translates to higher performance and increased consistency during CPU intensive processes. So if you have build boxes, cicd, video encoding, machine learning, ad serving, game servers, databases, batch processing, data mining, application servers or active front end web servers that need to be full duty CPU all day every day, then check out Digital Ocean's dedicated virtual CPU droplets. Pricing is very competitive starting at 40 bucks a month. Learn more and get started for free with a 100 credit at.co changelog again.co changelog. Welcome to Practical AI, a weekly podcast about making artificial intelligence practical, productive and accessible to everyone. This is where conversations around AI, machine learning and data science happen. Join the community and slack with us around various topics of the show@changelog.com community. Follow us on Twitter. We're @practicalai FM. And now onto the show.
Welcome to another episode of Practical AI. This is Daniel Whitenack. I'm a data scientist with SIL International and I'm joined as always by my co host Chris Benson, who is a principal AI strategist at Lockheed Martin. How you doing Chris?
Doing great, Daniel. How's it going today?
It's going good. It is a snowy day here in the Midwest. Last night we lost our power at our house, but it's back now, so spent the night putting logs on the fire, which wasn't so bad.
Oh boy. At least you got your power back. You're not podcasting on the generator, huh?
Exactly. Not podcasting on the generator. Internet is back for work and all things are good there. So I'm guessing it's not quite the same in Georgia, but by Georgia standards.
It'S quite cold here actually. So yeah, definitely we're going. What happened?
Since it's cool outside, it's a good day to stay inside and we got.
A cool topic, don't we?
Yeah, yeah, that was a good one. And learn about some some cool new stuff that's happening in the AI world and particularly around machine learning and AI tooling and apps. And today we have with us Adrian Troy, who's co founder and CEO at Streamlit. Welcome, Adri.
Hey, thanks so much for having me. I'm thrilled to be here.
Yeah. So maybe before we jump into machine learning and AI apps and all that goes along with that, could you just give us a little bit of an idea about your background and how you ended up where you're at now?
Sure. I started off my professional career as a professor at Carnegie Mellon and I was working on large scale simulations of smoke and water and so got to see really the complexities of running these really long running computations. And it's very similar to AI in that way.
And was that for environmental sort of applications or just for better understanding how to model those things?
Yes. So our application domain was computer graphics, actually. So basically making realistic virtual worlds indistinguishable from reality.
Gotcha.
And the work that we did though was actually quite fundamental. So it was really about how do you model the fluid equations, for example, on a computer, and what sort of efficiencies are made possible by the physics.
Awesome. Yeah, that's really interesting. Did that kind of lead you naturally into the whole machine learning and AI world or was that something you developed an interest in later?
Yeah, no, it was. We were actually pioneering AI like techniques in the space of fluid simulation and cloth simulation. And so we did a lot of so called data driven simulation, which means you capture a huge amount of data about how some phenomenon works and then you can build an efficient model. So it really is a form of machine learning. So yeah, worked on that and then also built some pretty large communities. So I was the founder of Foldit, which was a protein folding video game, and then Eterna, which was an RNA folding video game in collaboration with Stanford. So I had a sort of weird career which was a mixture of doing really large scale computing on the one hand and then also building these online communities on the other. And so those came together in Streamlit.
Yeah. So the communities that you're talking about, this is where, and I think I've read about this before, is the idea with those things, it was like we've got this really complicated problem and we want people to play this game, to explore the solution space.
In some ways that's exactly right, yeah.
So these were non technical people interacting with your application that had some sort of scientific or technical implications.
And actually could you provide just kind of an example of that, just to make it real?
Yeah. So an example is in the game Eterna, which I recommend everyone just go and check out eternagame.org super fun and interesting. So what we were doing was designing RNAs that these are tiny molecules in the body that can, for example, switch between two shapes under certain circumstances. And so this is actually the mechanism by which a lot of so called computation happens in the cell. And so being able to master this is really a sort of fundamental building block of like building next generation therapeutics. And it turns out that players playing this game, some of them have really developed like an amazing sort of technique and intuition about how to design molecules like this. So it's actually, it's really remarkable. And you know, we've published papers in sort of top journals based on discoveries by players. So it's really sort of remarkable. You can join and anyone can join and do the tutorials and learn how to do this. And in a way, I do see these crazy scientific computing games as precursors to Streamlit, because what we did was sort of translate one world into another, you know, computing basically. And so in Folda and Eterna, we were sort of translating the world of molecules and, you know, biomolecules into a game. And in Streamlit, which we just released, we are essentially translating the world of app development into a sort of the language of machine learning. And I think in all of these cases, you know, as soon as we released it, Community kind of lit up and just was so excited. And I remember before the podcast you were just saying half your tweets are about Streamlit. And I think it's because it's cool to give people new powers they didn't have before and to sort of act as an intermediary between two different worlds.
Yeah, it's like I've always had a desire personally to get my hands dirty with front end engineering, but at the same time I've always been so busy with other things that I'm like, oh, well, my stuff is cool, but in a lot of ways what you're doing on the back end is totally transparent, or actually should in many ways be transparent to users, but always like having a desire to create cool app things. I've never really got much into that world other than like random HTML or CSS sort of like task. So, yeah, I definitely could see like it is kind of a new superpower that people probably wish that they had, but there's a lot of barriers there, I guess.
You know, it's been such a kind of a weak point as people really try to get into this space in terms of AI technologies and make them meaningful in what they're Doing for work or their life or whatever, and being able to connect that in with, you know, through apps and stuff. It's been a huge area that needed attention. And it sounds like Streamlit is very much focusing on that.
Yeah. And maybe for the benefit of your listeners who haven't heard of it, I'm happy to also give a really brief description of what it is. Demystify it.
Yeah, please do. I think this would be a great time for that.
Yeah. So basically, Streamlit is an app framework for machine learning engineers and data scientists. And we were machine learning engineers. And so we took the starting point of what we saw as the machine learning engineering workflow and we asked the question, how can we make a sort of machine learning script into an app as simply as possible so that it basically feels like a scripting exercise? And so what Streamlit is, is just a package that you can install that gives you a bunch of, through pip and it gives you a bunch of functions. And those functions, you can just interleave an existing ML code with these functions and they essentially make things parameterizable, they do a little bit of layout and they turn your code into a beautiful app. And it's really true. And as you pointed out, there's a lot of interesting tech just below the surface that makes that possible. We have a multi threaded server that starts in the background. There's websockets shuttling information back and forth to the browser. There's a whole browser app that's interpreting this and creating what you see on the screen. But all of that kind of goes away from the user's perspective and you just get a really couple dozen magical Python commands that transform a machine learning script or a data science script into a app that you can use and share with others.
Yeah, that's really great context. And as you mentioned, there's a lot to dig into there. Maybe next we could kind of just set the stage. You've talked about the RNA stuff that you did and we talked about what Streamlit is. Maybe we could dive into why creating apps or these tools or interfaces is something that is relevant to particularly machine learning and AI practitioners. So why isn't it just the case that, oh, machine learning and AI people should just write their code in Python scripts and then pass things off to front end engineers to make something pretty. Why is there this need to have data scientists or AI practitioners create apps themselves?
Yeah, that's a great question. So the first sort of implicit observation is that they do need to create apps. And this is something that I've seen after Carnegie Mellon, I went to Google X and then I went to Zoox and built self driving cars. And every single ML team I've seen, you end up creating apps. And so I'll give you some examples from the self driving car space. We had an app that allowed engineers to run simulations. We had an app that allowed them to search all of our simulations and compare two different simulations with different parameters. We had API endpoints that you could go to and see subsets of all the data that we collected and look at images. And so there was actually really this constellation, this sort of application layer that was built that was sort of a focal point. It was like the bonfire of the team. It's where we all got together and communicated and chatted. So that is actually a really crucial part of the ML workflow is building these internal apps, especially in a non trivial project. And similarly, an important thing for machine learning and data scientists is to build apps for external consumption. So often other teams need to consume models in various ways and they need sort of an application layer to do that. We're in talks with a very big company to use Streamlit in production to allow their huge sales force to make interesting recommendation decisions. So it's really both for internal and external users. And then the question is, well, why don't you want ML engineers writing in Flask, for example, or using an app team? And the answer is that those things really, really slow down the cycle. So for example, a tool that we used all the time at Zoox was the scenario replay tool, which was if the car did something unexpected, we would want to be able to go back and see every single sensor, reading and everything all in one webpage and scrub through it. For example, that tool required new features. Like every week we'd be developing a new sensor that had to be displayed and we had a different data set for vision and we had to be able to switch between them, et cetera. So these tools require constant new features. And so it's really empowering to be able to create them yourself easily and beautifully, and then directly iterate on them and directly serve them to your users, be they other members of your team or other people in the company. So that's really the power of being able to write apps quickly and easily and in a flow that you might expect. And I think that's why the community has been so receptive.
So I guess one of the questions I wanted to ask up front was, you know, as you're doing these GUI things, you know, why not just use jupyter given the fact that if you're a user out there, given the fact that it is so broadly deployed, it's kind of become the standard way that people are starting out. And you know, other than the fact that you might want to show things to non technical people, recognizing that not everyone looks at Jupyter Notebook, what are some of the advantages of doing it this way? Could you kind of talk about that a little bit about using it internally?
Totally. So I would say that Jupyter first of all, we ourselves use Jupyter alongside with Streamlit, so they don't exclude one another at all. Jupyter, we feel, is centered on the EDA workflow, the exploratory data analysis workflow, and it's a fantastic tool for that. And then it sort of branched out into making apps a little bit more, being an expository tool of various kinds. And those are all great adjacent use cases. Streamlit was really founded on the idea of building interactive apps really easily. And so we have a different workflow. It's I think, very, very simple. It's very lightweight, it's super easy to understand and it's slightly difficult to describe. You just have to try essence, we allow you to sprinkle these interactive widgets throughout your code and then we sort of organize it into an app very easily. And I think it's that simplicity that community has really responded to.
What is up Practically I listeners, we're working with Infinite Red to promote their free AI mini course. It's called AI Demystified. Learn More Enroll at Learn AI Infinite dot Red. This free five day mini course is a great introduction to the most important concepts, types and business applications for AI and machine learning. Each day of the course includes a lesson, a quiz and an assignment to submit your learning. And after you've completed the course, you'll also get a certificate of completion for your LinkedIn profile or for your portfolio. If you've been feeling lost in the world of AI and hearing lots of buzzwords, then by the end of this mini course you'll be able to speak intelligently about AI and machine learning and their practical business applications. Again, this course is completely free. Learn more and enroll at learn AI.infinite.red again. Learn AI.infinitered.
So Adrian, you mentioned that kind of getting more into Streamlit itself. You mentioned that Streamlit is an app framework for machine learning and data science teams. I was wondering if you could unpack that a bit. For people that maybe are not familiar with front end engineering and creating apps. When we're talking about an app framework here, for example, are we talking about just something that's going to be like a UI that's running in your browser? Is this having anything to do with mobile? Is this like what, what is the app that we're talking about and what does it mean that it's an app framework? I think you mentioned some things about components and stuff like that.
Yeah. So what it means is that you can write a Python script with any kind of code that you want. NumPy, SciPy, PyTorch, TensorFlow, and then you can add these magical streamlit commands like ST write lets you write anything to the screen. ST slider lets you put a slider on the screen and you sprinkle these commands in your Python code. And what you have is a Python file that instead of saying python that file, you say streamlit run that file. And that command sets up a server, opens up a browser and connects the two. That app is now running locally on your laptop or wherever you're running it. It could be on EC2 instance, and it's actually an app that you can run. You can look at it on mobile if you go to that URL and it looks nice on mobile too. So it's both web and mobile in that sense, and it's something that you can share with others in your company and give them an interactive view into whatever it was you were working on. So it could be as simple as here is a model, play with the inputs and look at the outputs. I just created this app in five minutes just to show you. Or it could be something really sophisticated like let's build an app to organize all of our data and all of our models and allow us to run, know the latter on the former and arbitrary subsets and search engines and all this stuff. And so you can go really crazy with it. So that's what an app is. And fundamentally it's basically just a Python program running on a server somewhere.
So kind of wondering, in terms of, I'm trying to think about workflow and stuff, is streamlit mostly for prototyping or how far can you take it? And I guess as part of that couple of things, how would you integrate it into a small team environment? And then conversely, on the other side, you also mentioned you had been working with a larger client. How does it work in production for a larger team in an enterprise environment? And would it replace, maybe in that kind of context, some front end engineering that you might otherwise have in that enterprise?
Yeah, that's exactly right. So really, in A small or a large organization. The first step is just PIP install Streamlit. It's an open source project with a very permissive license. So really I don't think any organization would object to that. And you can play with it locally on your laptop and just see how it feels. And I encourage people to do that. It's actually really fun and extremely simple to learn. And then once you get to something, the next step might be look over my shoulder, show someone else in the organization, look at this thing I created. The next step is deploying it. Right now there's a bunch of articles in Medium you can just Google for them which explain how to Deploy streamlit on EC2 on Heroku. It's a little bit of a process to be honest, but you can set up a little server somewhere and then tell other people to point to it. And lo and behold, you now have an app that can be used in the organization. So that's the existing workflow. What we are working on with both large and small clients is something called Streamlit for teams. And what that does is basically make the deployment completely painless. That's sort of the enterprise version. And it also adds a bunch of really interesting enterprise features. So load balancing, greater scale of authentication, logging, those kinds of things.
So wanted to follow up real quick on deployment. Just while you're there, what does the mobile picture look like? Or is there one at this point? Or is that something you're still working on?
Yeah, so the mobile picture is that you deploy an app in one way or another. And so you would have to have either a VPN or a public IP address. And then if you point someone to that app, they will see it either rendered correctly on a browser or rendered correctly on a mobile device. And so an example of such an app that one of our users created is called awesome Streamlit. And it's basically a collection of cool scripts and tricks that people have figured out in Streamlit. It's another sort of separate open source project you can do pull requests against it and stuff. And it's an app that just runs on the Internet and anyone can go to it. And so if you want to see the mobile experience of Streamlit, just Google awesome Streamlit and play with it on a mobile device or on a sort of standard web browser. So that's the mobile story. Right now we don't have any way of packaging a Streamlit app into an iPhone app or something like that yet. That's a really cool idea though. Maybe we should do that.
Yeah, cool, thanks.
So I'm kind of wondering. We've had people on the podcast in the past, and I know there's probably people that are listening that are familiar with the R world and Shiny.
Yep, totally.
And I always felt like, oh, there was this Shiny thing with R that seemed cool and similar in some ways, at least maybe, and there wasn't a parallel that at least I knew of for Python. If people aren't aware, Shiny kind of has this ability to help you build apps around your R scripts and that sort of thing. So I was wondering if there are actually some parallels there or if the end goals of Streamlit are slightly different than Shiny, and if so, how you see all that.
Yeah, so actually, Shiny was a big inspiration for what we're doing. And indeed, when we were sort of building the first iterations of Streamlit, one thing that we heard over and over again was, why is there no Shiny for Python? And so that was really kind of like a guiding light. As we were developing Streamlit, I would say that there is a fairly significant technical difference in the implementation, in that Shiny is sort of based on wiring these callbacks, and Streamlit's actually based on a more sort of declarative data flow model. So I think that the user experience of building apps in each is quite different, but certainly the sort of space that they fill in the ecosystem, I think there are huge parallels, and we would be really honored to be considered the Shiny of Python.
So one of the things we mentioned earlier was seeing Streamlit in our Twitter feed so much in recent weeks, and I guess it really seems like Streamlit posts kind of burst onto the scene with tons of existing support, a lot of attention. And you had mentioned that there are organizations like Stitch Fix, Uber, Twitter that are using Streamlit. How did that happen? At least, I guess from our perspective, so early on, as people became aware of it, you already had, you know, major uptake on the platform.
Yeah. So basically what happened was, a year ago, Streamlit was more or less a solo programming project of mine. And my mom was like, you should try to make a business around this if you're going to spend so much time on this. I actually was unemployed at the time, and she was like, Anyway. I was like, it's impossible. You can't do it.
That's a good mom.
I know, I know.
Yeah.
She encourages her kids to follow their dreams. I guess she could have said, you should get a job. So anyway, you made your job there.
Yeah, there you go.
Yeah. I started to realize that there might be a business model around this, that made sense. But even in those early days before there was a business model, I was showing it to my friends and people were excited about it. And I was a professor at Carnegie Mellon and at Google X and stuff. So I am pretty like I have a social network that sort of stretches into the ML teams at all the big Silicon Valley companies. And so just by virtue of showing it to people, and in some cases them showing it to their friends, we built a little community of people who are using it and at these sort of very well known companies. And so they were a little leery. They were like, what's this thing? Is it open source? Are we allowed to use this in our company? But they were also excited about it. And so that was really the thread that carried us through the initial seed raise. And I think the investors sort of sensed our excitement and our users excitement. And then over the past year we've just been more or less listening to them and building features and we waited a little bit until we thought it was cool and then we released it.
As you were kind of taking what was then your just kind of personal project around and showing it to people and talking about it and talking about the need there. And I guess since kind of the features that the community has been asking for and other things. Has anything surprised you in terms of what people really want a lot versus things maybe that you thought would be important but weren't as important? Has anything surprised you in that way?
Totally. The big one actually is really this shiny for Python thing. The original version of Streamlit was way more focused on just visualizing code actually. And so to the extent that there was interaction, we had this really cool hot reloading feature. And so to the extent that there was interaction, it was because you were editing the code and you could could see things interactively changing on the screen, which was actually super cool and very much at the core of I think the fun of Streamlit. But people basically said we want apps. And I resisted it, actually. I said this is a different product definition, we don't know how to do this right. And finally the community overpowered us basically and we sat down and really thought deeply about how this would work and in fact looked at every other app framework we could get our hands on and created this giant 70 slide deck of how they all worked, shiny and plotly dash and all these other kinds of things. Then we built what we thought it should look like and it was kind of a leap into the unknown because I really wasn't sure it was going to be the kind of magical experience that I thought Streamlit needed to be. And we just did it and we showed it to people and they were thrilled. And actually, you know, we actually, we're huge users of Streamlit, so we build all of our dashboards and all this internal stuff in Streamlit. And I remember one of the engineers being like, streamlit is really fun. And I was like, I know, isn't that weird? It's really fun. It's almost like we discovered this thing rather than built it and then we were like, this thing is awesome. So that increased our sort of excitement, basically, and then it was being well received by the user groups. So we really did have a nice user community by the time we launched. And we also felt like we had confidence that there's a lot of things that we want to improve a lot, but we had confidence that people could really use it.
I love that story. Being able to. You start off by scratching your own itch and then you are building something that you and the people you're interacting with find fun and useful and exciting and getting on top of that. And then on top of that, Daniel and I both come from software development and we big, big open source advocates, we love the fact that Streamlit is open source and wanted to kind of understand what was the economic model behind Streamlit and who is supporting it in that open source context and who's kind of developing on it and contributing to it at this point. What does that open source side of the business look like for you?
Yeah, there's sort of a guiding principle that we have borne in mind, which is that. So let me first say that Streamlit, the way it works is that the library that you download is completely free and open source, can be used for any reason whatsoever, forked, modified, etc. We are also building an enterprise product called Streamlit for teams and that's something that we are going to charge customers for. So basically there is this dual model and it's actually a very. It's becoming sort of the dominant open source business model. And the guiding principle basically is that anything that's tech, all of the crazy web socket stuff, the caching, the hashing, the queues, all of the stuff underneath Streamlit, that's all free and open source. And we have lots of plans to improve Streamlit in really fundamental ways. We're just super excited about that. So there's a lot more tech coming down the line and it's just going to make it cooler and more magical. Then on the other hand, there's all the features that are useful in a business context. So that's increased scalability, load balancing, security, logging, authentication, et cetera, management of apps. And so those features are going to be part of Streamlit for Teams. And so right now we're in the process of talking with customers and understanding how we can can sort of nail the value prop there for different use cases. So, you know, it looks really good. Corporations are excited about Streamlit for Teams. We have an incredibly long list of people who are basically telling us they'd like to pay when it comes out. And that means that we can support the open source project. And that's just like super thrilling because it's just so fun to build open source software. This episode is brought to you by Brave. Big news from the brave team. Version 1.0 is official. That means our favorite open source privacy focused, blazing fast browser is ready for prime time. Their brand new iOS app landed just in time for the announcement and the Brave team is celebrating by granting 8 million basic attention tokens to the community. That means when you download the iOS app, you get 20 bat absolutely free. Put it to good use by heading to changelog.com hitting the triangle icon in the upper right hand corner and flipping us a tip.
So as we've been having this conversation, I've been kind of thinking about like my own use cases, my own workflows and where this comes in. And it seems like, you know, Streamlit itself is kind of in one of those situations where it's like, it's a tool. And if you ask like, oh, what could you do with Streamlit, you could do like sort of an infinite combination of things with it, which makes it kind of hard to like, nail down some starting points. And so I'm thinking like, oh, well, I can. If I wanted to create a UI where I didn't have to jump into my code and adjust a bunch of hyper parameters to retrain my model, I could create a nice little UI to do that. Or if I just wanted to push images through a model and do some inference and draw bounding boxes around them to review those things, I could do that. As you think about people's AI workflows, going from data prep to training to inference to like, maybe feedback and data labeling, where do you think maybe is a good place for people to start thinking about where Streamlit could provide the most value quickest, Is it whenever you want to show someone else something, or could it be other places? Yeah, curious about that.
Yeah. So it really runs the gamut. As you pointed out, it's sort of as broad as machine learning and data science itself. We've seen a lot of code.
Cool.
Different use cases. So people are creating interactive resumes in streamlit so you can actually see the different models they've built. People are also building explainer demos. So we've seen now increasing number of GitHub repos that say if you want to test out this model or my code, just streamlit, run this demo. And that's super fun and really powerful actually for the people who are testing out different open source projects, we're seeing people build dashboards, often for external consumption. So a dashboard for the marketing team, recommendation engine, that kind of thing. Similarly, we're seeing tools for an external operations team of some kind. So for example, the ops team can see data from the self driving car as it's being downloaded. Annotation tools, people are doing that in streamlit. We have some friends at Google X who are doing real time monitoring of some pretty advanced and secret hardware. They just put Streamlit on a Raspberry PI and then they built these real time dashboards and yeah, just managing data. One way of thinking about it is like every time you might write a command line tool, a little, just one for yourself that I want to list all of the data sets in this directory and compute some statistics about them. You could imagine just instead of writing a command line tool, write a little streamlit app and suddenly it's really much easier to see and prettier. It's more easily shareable with others and understandable. You know, all the parameters can be sort of encoded as like interactive widgets and it's not much more complicated.
That's a great example right there. Because I do that, I'll create little command line interfaces on a regular basis just to scratch my own itch on stuff. So I'm glad you brought that out as an example. As I look around on the Streamlit website, I'm going through the documentation while we're talking. One of the things that I'm seeing is different terminology that you have associated with streamlit and recognizing that we are audio only, that we're doing a podcast here and don't have the visuals, the diagrams. Wanted to talk about whether or not you could just kind of briefly say what a couple of things mean to you. I'll throw out four or five terms and just kind of tell us what they are in the Streamlit context, if you would. Yeah, I'll just, I'll name them all and then I'll prompt you later if you forget Data flow, caching, widgets, sidebar and app model is a few. Could you kind of talk to what each of those is to you?
So when we say that Streamlit has a dataflow model, what that means is that it really is. You could actually just say it's a scripting model, which is to say the script executes from top to bottom and you can define variables and those variables transform things. And it's really the machine learning workflow. And so what we add to that workflow is a couple of cool superpowers. So one of them is widgets, which is you can basically anywhere in the flow of your program, insert if you want to say x equals 5. Instead of saying x equals 5, you can say x equals STslider. And now a slider sort of magically appears on the screen and stuff will be whatever you set the slider to. Another thing, that magical thing that we add is the sidebar. Super simple, but it basically gives you an area on the left usually to put some widgets and stuff. And it's a very, very simple layout model that actually leads to like really pretty looking apps with almost no work at all. Another superpower that we give you is caching. And what that means is that you can decorate your function with this magic called stcache and we will memoize the function, that is we'll remember how it behaves. And that's useful because it lets you speed up your apps. And so when people slide the sliders or type in text in the text inputs, it'll just be faster and those things together. So the data flow from top to bottom, the layout both in the main area and in the sidebar, the ability to do widgets and have inputs and then caching to speed things up are together what we call the Streamlit app model. It's actually quite unique because it's really, really focused on. Let's make this understandable for machine learning engineers and data scientists and let's give them the ability to create apps that otherwise would be very complicated to create, quite frankly.
Yeah, I mean, it sounds like as I'm thinking through some of my scripts, it's like whenever I am going through and I have the desire to put in a command line argument or something like that that I want to modify all the time. Maybe a way to think about it would just be to think about instead of having that command line in my mind, I could have a UI in my mind where I'm thinking, oh well, what if this was a ui and I could just get that parameter in that way. Or I could change this thing in that way or create, you know, the display this graph or display this image in this way. So kind of is that a good way to think about it? As I'm going through my script and I know I'm going to be modifying this all the time, or I know I'm going to when I give this to someone else, then I'm going to have to tell them all of these things to modify. Is that a good way to think about it?
That's a great way to think about it. And that's really, you know, I use it that way all the time. So, like a script that I want to write right now is when we do new feature releases. We just released a new streamlit like two days ago, and we do it about every week or two. We want to make sure that everyone who requested a feature on the forums is basically notified by us that their feature was implemented. And so what that amounts to is a little tiny script that runs some git commands and then does some GitHub stuff in order to assemble a list of pull requests and then parse those out. And so we can sort of keep track of what happened easily and automatically. And so you just imagine that would be a very simple. Well, it'd be an intricate little python script to get that done on the command line. And instead we can just use Streamlit to make it a little interactive app. And so the first step is just, yeah, create that app and suddenly it's just prettier, it's easier to understand, it's easier to use, it's just as shareable. And then the next step is, you know, this is really cool. This should be running all the time. Everyone should have access to this without, you know, checking out my code. So let's deploy it. And I think that just that that attitude, which is, you know, this is just a little script, let me write it up, is the starting point for creating lots and lots of extremely cool and useful stre.
So it sounds really great. I'm pretty excited about jumping into it after we stop recording this.
Yeah, totally.
And I'm thinking through my own use cases in my head while we're talking. If I get to a point where I don't have exactly in the tool the thing that I want, and I'm starting to think about extending what's possible. How do you go about doing that? How easy is it to extend streamlit and kind of create custom UIs and components that aren't necessarily the things that you're Showing in the examples or the docs or stuff. What does that extension possibility look like?
Totally. The first thing I'd say is write your extension down. In the forums we have a super active user community. We really try to also have as many Streamlit devs as possible involved and so questions get answered quickly and knowledgeably. So ask your question in the forums. One thing that I think a lot of people are surprised about is they say, oh, Streamlit can't do this. And actually it can. There's, you know, we wrap a lot of all the basic visualization libraries, matplotlib, alteraplotly, etc. Deck GL and there's a lot of ways to combine the basic elements in Streamlit to do really, really cool things. And so often people are surprised when we say, oh no, there is a way of doing that. So that's step one. Step two is if it's impossible to do in Streamlit, you're welcome to check out and fork the repo and we have instructions on how to do that and you can go in there and look at how we did something and make a change. And in fact we're also welcome and have started seeing a bunch of community improvements to Streamlit and so we welcome those PRs. Number three is that's a pretty heavyweight thing to check out Streamlit and modify it. We're working on plugin architecture and by working on, I should caveat by saying we have designs on paper, we haven't started coding it up yet, so I think this will be released sometime 2020. But the designs are very, very cool and I think it's just going to breathe new life into Streamlit in terms of possibilities. And so we're really excited to do that and let people build essentially arbitrary front ends in Streamlit and then power them through Python.
Awesome. Well, just to kind of wrap up and give people a place to go, get hands on right away with Streamlit, because I know a lot of people will want to. Where's the best place for people to go first? Is that your website? Or maybe describe a little bit of the tutorials and how people can get started. You mentioned you can PIP install it, but what's the best way to get up and running?
I guess totally, yeah. The simplest starting point is just our webpage, Streamlit S T R E A M L I T IO or you can go to our GitHub page, GitHub, Streamlit, Streamlit. And then once you get there we're going to give you the instructions which are pretty simple. So Pip, install streamlit. And then you get this command called streamlit, and you can test it out by typing streamlit, hello. So pip, install streamlit Streamlit, hello. And then once you're in any one of those points, you kind of have touch points to get to all of the other parts of the community. And really the main hubs of the community are the wiki, the documentation, the forums, and GitHub. And in all of those places, you'll find people, people chatting, discussing, coming up with cool solutions, sharing information. So, yeah, it's pretty great.
Awesome. Well, I know there'll be a lot of people checking that out. I would love to see what people build with Streamlit. So if you want to share that with us, you can of course share that in Streamlit's community, but also on the practical AI Slack channel, which you can find@changelog.com community or share it with us on our LinkedIn page or on Twitter. And we would love to see what you build with Streamlit. I'm really excited to see where the project goes and really appreciate you taking time to talk to us about it today, Adrian.
Yeah, it was a delight and I'm really excited to see what your audience does too. So yeah, let us know, Post in the forums, post on Twitter. We're trying to keep up on all that stuff, so we'd love to see what you're doing.
Excellent.
Well, thank you so much. Hope we can meet in person at a conference or something, but we'll look forward to seeing all the great things online.
Cool.
Thanks for joining us.
Yep, thank you so much.
All right, thank you for tuning into this episode of Practical AI. If you enjoyed this show, do us a favor. Go on itunes, give us a rating. Go in your podcast app and favorite it. If you are on Twitter or social network, share a link with a friend, whatever you got to do. Share the show with a friend if you enjoyed it. And bandwidth for change log is provided by Fastly Learn. Learn more@faster.com and we catch our errors before our users do here at Changelog because of rollbar. Check them out@robot.com changelog and we're hosted on Linode Cloud Servers and@linode.com changelog check them out. Support this show. This episode is hosted by Daniel Whitenack and Chris Benson. The music is by Breakmaster Cylinder and you can find more shows just like this@changelog.com when you go there, pop in your email address. Us get our weekly email keeping you up to date with the news and podcasts for developers in your inbox every single week. Thanks for tuning in. We'll see you next week.
More from LARRUZ


Ep 881: Faster AI Agents, Fewer Human Coworkers: The Overly Productive Future of Managing Agents? (Replay)


Ep 879: New: OpenAI Presence. Has The AI Customer Service Takeover Finally Arrived? (Replay)


Ep 878: What’s Coming Next: 5 AI Trends, Problems and Opportunities around the Corner (Replay)




