Latest / Agentic Conversations (formally mlops.community) / FastAPI for Machine Learning // Sebastián Ramírez // MLOps Coffee Sessions #96
Transcript
- 0:00Give a person, a rose is tamazaki Nal podcast.
- 0:03De la comunidad, the envelopes envelopes Community even as a
- 0:07toddler and ratico the first EP a-- yatras Casitas, type
- 0:11annotations computation. This tree with a possibility at
- 0:15this. I'm gonna go ahead and call out
- 0:17first and foremost, your shirt. You're wearing the go fast shirt
- 0:22for our man fast API. Do some stunts done.
- 0:27That's so perfect. Go fast for the go.
- 0:30So fast API that's so perfect. I saw that like halfway through
- 0:34the conversation and I was like actually realized, but there you
- 0:37go, you didn't. Oh man, I thought you did it on
- 0:39purpose. My mom.
- 0:41Not that clever. Well this was brilliant.
- 0:44What were your top takeaways with talking with Sebastian
- 0:47Ramirez? I'm a little bit blown away.
- 0:50I need to kind of digest for just happened but I think I said
- 0:53it right the end that it's very clear.
- 0:55That Sebastian has that real deep technical knowledge and
- 0:59he's really Honed in a few things he really cares about and
- 1:03he can now just bring that value.
- 1:05Everywhere we go. Is everything he touches.
- 1:07You can add that little sprinkle of magic and its really
- 1:10powerful, right? He had some cool ideas around
- 1:13like how to tackle those big problems and how to be kind of
- 1:17ever mentioned explicitly. But how to stay motivated do
- 1:21stuff that you care about, right?
- 1:22Might be your own customer. So I really like that he was
- 1:25very much like he told us the whole story of how he created.
- 1:29Fast API and basically came down to him scratching his own itch,
- 1:33right? Even though he tried to not do
- 1:36it, he was actively trying not to do it and then he eventually
- 1:39does it. And says I got to do it because
- 1:41I can't find anything that does what I want.
- 1:43And when he rattled off the list of things that he wanted, I
- 1:47thought that was brilliant to like, how he knew very clearly.
- 1:50Like, I wanted to do this. I wanted to do that, I want all
- 1:53this stuff, and I couldn't find anything that worked.
- 1:56And then the other thing, like exactly what you were saying
- 1:58that really stood out to me the The bigger picture of him
- 2:01saying, here's what I'm really passionate about and where can I
- 2:06add value with these things that I'm passionate about?
- 2:10How can I go into other open source projects now, like what
- 2:13he's doing? That will add extra value to
- 2:16these projects if I bring my little Touch of Magic to it.
- 2:20So that was super cool man. This this guy's incredible.
- 2:24Let's jump into the full conversation and for those of
- 2:29you that Are just tuning in for the first time.
- 2:32We would love it if you give us a follow or a like or wherever
- 2:36your listen to this, if it's on Spotify or apple, if you
- 2:40subscribe to us and you leave us a little review, it would be a
- 2:43huge help. And the other thing that I will
- 2:46mention, before we jump into it, is that the apply conference is
- 2:50coming up again on, May 18th and 19th.
- 2:53I'm going to be hosting it. Surprisingly, they have not
- 2:57fired me yet. They I'm The MC and so you can
- 3:02expect the Run. Yeah.
- 3:04I'm gonna try and do another song before before the end of
- 3:07it. And so, there's going to be all
- 3:09kinds of good stuff. We've got incredible speakers
- 3:11that are coming up at that. Like some of the guests of honor
- 3:16that we've had on this podcast. But so many more like really big
- 3:20names. Check it all out.
- 3:21Will leave a link to the description to register?
- 3:24It's free and I'll be there. Accompanying you the whole way.
- 3:28Not sure if that's a good or a bad thing.
- 3:29NG. But that's what we got.
- 3:31Now, let's jump into the conversation that we had, with
- 3:34Sebastian remedies, the main thing we should probably start
- 3:41with is fast API and Sebastian. For the two people out there,
- 3:45listening that do not know what fast API is.
- 3:48Can you give us a bit of background on it before we jump
- 3:50in? Of course.
- 3:52Hey I bet there are many more. That don't know what Sofia is.
- 3:56But yeah, so fast EPA is a python framework.
- 4:00Building web apis and it's designed for web apis and it's
- 4:04built around like all the latest features in the, in the language
- 4:08in Python. So, it has a seam support even
- 4:12though it's not required to use a sink and it's all based around
- 4:16type annotations. So when you define a variable
- 4:20and you say, hey, this variable is of this type is string, or is
- 4:23a float or something like that. That on one side, that helps the
- 4:26editor and other tools, check that your code is correct.
- 4:29And it's what allows the editor to give you the completion and
- 4:32in errors and all the stuff and then fast EPA uses.
- 4:35All those type annotations to a to do data, validation data
- 4:40civilization, documentation, and a bunch of other things.
- 4:45It's all based on Open Standards for apis.
- 4:48And as an end result, you end up having an interactive
- 4:52documentation user interface for your API that is based on
- 4:55generated automatically and is based on your goals.
- 4:59It's from your code. So it's blown up a little bit in
- 5:04the last year or so, I would say and you could probably tell us
- 5:08when it really started to ramp up.
- 5:10But why would you yeah, why do you think that is?
- 5:14I like to let you know, like, I never expected it.
- 5:18I thought the first EPA will be one of those hipster Frameworks
- 5:24that me. And I want your father, 50,
- 5:27people around the world use and say like, oh, this is so cool.
- 5:30But it's like, no one else that was that was what I was
- 5:33expecting and that was actually I guess like one of my highest
- 5:36hopes that there will be some other hipsters trying to use it
- 5:41with mustaches. Yeah, yes.
- 5:45But it seems like the ideas I had on the and it is not just
- 5:49ideas. I had is things I learned from a
- 5:52bunch of other Frameworks and even other languages.
- 5:55And like, I was just trying to put all that together and it
- 5:57seems that like those ideas and trying to solve those problems,
- 6:01was actually useful and important for many others.
- 6:06And I guess that's probably what made it grow so much.
- 6:09And I have so much other option that it was something that was
- 6:13useful and It's kind of necessary for a lot of people.
- 6:17Yeah, no, I'm not. I think, like, when I first
- 6:19started hearing about, because the fault was flask, right?
- 6:23Everyone was just like, right, you learning data science, where
- 6:25I came from. I said, was, I right learned
- 6:27eight signs right? Need to be like Pfizer, you got
- 6:29a bun API. They are this flossie tutorial
- 6:31blah blah blah where was The Tipping Point?
- 6:35Because all of a sudden like all the Articles now is like right?
- 6:37It's fast API. That's the go-to and things that
- 6:40I did. You feel that happen or did it
- 6:42kind of happen gradually. It's like, I feel like it's been
- 6:47happening gradually and like, just, like going happening, more
- 6:50and more. But, you know, like, like I came
- 6:54from from flask. The best thing I had before, I
- 6:57had built fast API, was flask with a bunch of plugins, it's
- 7:00just that it was a very fragile, it's set up with, you know, like
- 7:04trying to have plugins interact with each other.
- 7:06That are not made to be working with each other and like, its it
- 7:10was quite more cumbersome but it's like From all that work and
- 7:16from all those plugins and all that open source contributions
- 7:20from other people, is that I learned a lot of things that
- 7:22they like was able to apply to fast API but actually, I don't
- 7:26know. I feel like it's been just like
- 7:28steadily growing and steadily happening that is just like
- 7:33becoming these things that is they go to in many cases for
- 7:37these types of apis. But they're like, I don't know,
- 7:41it's it's still mind-blowing. For me to see how many people
- 7:47are using it. And for how many things like
- 7:49from time to time, I hear like this.
- 7:51I don't know. Some huge corporation and
- 7:53someone says, like, oh, we used Fast API, like I had no idea.
- 7:58This is very fun. Yeah.
- 8:00You're like, are you sure about that?
- 8:03Yeah. Are you sure you want to do you
- 8:08trust me? That's awesome.
- 8:11So, there is a One thing that I want to comment on with that is
- 8:16or ask the question about it's around what has been some of the
- 8:20most surprising ways or use cases or people like you said
- 8:25corporations that are using flask.
- 8:27All right. Yeah.
- 8:28Fast API. Sorry not fussed.
- 8:31Well, flask. I know there's a lot of people
- 8:33using pleasant but they I don't know for fast APA.
- 8:37Think that there's, there's several things that have been,
- 8:39like, completely unexpected. For example, I know that the
- 8:44They in it telescope Institute in the United States where they
- 8:48like use that to process the data of the telescope's of the
- 8:51world and all that stuff and they are using fast API or, I
- 8:55don't know. Netflix Disney over Microsoft
- 8:58that there is in my for Windows apis or at least, at least
- 9:03that's what I what I have heard like.
- 9:06What someone told me once, I don't have access to those
- 9:12companies directly to many of those Those to know what they
- 9:15are using now, how they are using it now but you know, like
- 9:18there's a still, like a bunch of, I don't know, big, big,
- 9:20pharmaceutical companies, things things like that.
- 9:25The yeah, I guess I never expected it to, to grow so much.
- 9:29And some of the strangest use cases.
- 9:32I have seen are, for example, streaming.
- 9:35I remember someone who wants made a project that was
- 9:38streaming the terminal, like, some some common thing terminal
- 9:43through. Web browser using websockets and
- 9:47using fast API to handle all the stuff and to handle the
- 9:49communication between the terminal on the browser and it
- 9:51was like wow this is this is a crazy and so cool.
- 9:54Like I didn't imagine you could do that.
- 9:58Yeah, I don't know or also to transfer the data to simulate
- 10:01galaxies. I remember some people were
- 10:03doing something like that. I don't even know what that
- 10:05means, but it's very cool. That's not.
- 10:10So I guess that's always going to happen when something gets
- 10:12public domain and then Everyone say you zoom and twist it and
- 10:15break. It has like the opposite
- 10:19happened as well. Have through its popularity, I
- 10:23guess, you've got more people wanting to contribute wanting to
- 10:26do stuff and change staff house, that kind of has anyone done
- 10:31anything this blown your mind or you've looked at and you've gone
- 10:34all? Wow, like I never thought of
- 10:35doing that, that way. And what's the biggest sort of
- 10:38lesson learned and things from that experience?
- 10:41Huh. Hey, there's been a lot of
- 10:43things that I have ended up like, having to learn a lot, and
- 10:46having to understand a lot of the deep Concepts and ideas, but
- 10:51like, you know, like one of the biggest of those was actually,
- 10:54while I was still building faster PA seeing the code inside
- 10:59of pedantic, but I don't think is so powerful and so simple to
- 11:03use, it's such a good library. And, you know, it's a great like
- 11:06very outside the first APA on its own is just amazing.
- 11:09I think. All of the data Science World
- 11:13could benefit from pedantic to be able to have like automatic
- 11:16data, validation, and type safety, and all the stuff and in
- 11:19many other use cases. But so for the, for the, for the
- 11:23developer, that is using pedantic as a user, it's
- 11:26amazing. But the internal code of
- 11:28pedantic has to do. So many, complex logic, and so
- 11:33many complex tricks to be able to do is thing that I remember
- 11:38when I was working on pedantic itself out that like trying to
- 11:40control Tribute something like that.
- 11:43It was so mind-bending, like, all the things that it was doing
- 11:45and how it was interacting with the internal parts of how python
- 11:51works with data and with with objects and all the stuff that
- 11:54that was that was I think that was one of the most challenging
- 11:58Parts in the like the whole process.
- 12:01How how does it take to like, how long does that take you?
- 12:05Right to learn enough to be able to comprehend that?
- 12:09Because I you talk even that's get Get nervous you talking
- 12:12about it thinking God like I've seen big complicated tools and
- 12:16dive into the code base and it can be really intimidating to
- 12:18get even started with like what was that?
- 12:20How long a process is that? Or is it something you chip away
- 12:23at? You can add to that.
- 12:25Look at an oil-less. Like the things that the process
- 12:29with fast API in general was kind of strange because it's not
- 12:33that I said, one day like, oh, I'm gonna build faster pi, and
- 12:36then I just started building the thing.
- 12:39It was actually like, you know, years, Years of using many
- 12:42different Frameworks. I try to use like almost all of
- 12:45them. I was avoiding building
- 12:46something new for a very long way and I was like, no, no, no I
- 12:49cannot I cannot try to let's not make this another ecosystem
- 12:55where you have a new framework every every two weeks.
- 12:57So I was trying to avoid building something new and
- 12:59trying to just use the things that were available in trying to
- 13:01find the best like The Sweet Spot of all the features and all
- 13:05the things that I wanted to have.
- 13:08And then when I found the right tool for that, The outer had to
- 13:11deprecated and that was like, I think that that was the last the
- 13:15last drop to say, like, okay, let's try to build this thing,
- 13:18but then there was a lot of time, just stalling the
- 13:21standards. So, first API is based on open
- 13:23API, which is a standard for building apis and that in turn
- 13:27uses another standard called Json, schema.
- 13:30And it also uses it, which is for defining Json, payloads for
- 13:33defining the the content of Json objects and that that open API
- 13:40standard also Uses the other standard called oauth 2 which is
- 13:43for doing authentication and authorization.
- 13:45So it was just a long time, just studying those standards to try
- 13:49to understand. Okay, how can I make something
- 13:52that is built around this? And that is base uses these
- 13:54Concepts and like, reuses them. Unlike exposes them in code in
- 13:58the simplest way possible, and it was just like a lot of
- 14:02learning and just a lot of studying and trying to figure
- 14:05out what was the way best way to that.
- 14:07Now, that then after, after all the process of learning, I think
- 14:11the the standards he was actually just well, I decided,
- 14:14let's go with Starlit and style. It was made by the same person
- 14:18by the same time Christie which is amazing.
- 14:20The same author of this previous library that I thought was the
- 14:24perfect thing. The private library was called a
- 14:26pi star and he had to replicate it and don't Christie.
- 14:30The a was creating Starlet which was this very high performance
- 14:34micro framework. / toolkit for python web development.
- 14:38He is the same author of Django rest.
- 14:41Framework. So is a lot of a lot of
- 14:43learnings from building apis starting from the jungle world,
- 14:47taking that over to a pi star, which was this previous
- 14:51framework. And then like just focusing on
- 14:53the micro framework and then I was just taking all those
- 14:56learnings and, like, in everything all that all that
- 14:58work to build fast API on top. But then, I wanted to mix it
- 15:02with python, take that had all these great user experience on
- 15:06like interface to work with data, just using standard type
- 15:10on attention. So that Don't have to import and
- 15:12learn some new class for defining strings.
- 15:15You just use the standard python string, you could use the
- 15:17standard python float, and all those things.
- 15:20And then it was just also a lot of work in pedantic implementing
- 15:24Json schema which is the solar standard in my tactics
- 15:27orthodontic will have support for Json schema so I do the
- 15:31stuff to the NBA then finally be able to integrate that Json,
- 15:35schema from pedantic, aim to open API and put all those
- 15:38things together. So let's just unload Lot of
- 15:41building the the recipe ingredients and like making sure
- 15:44they were in place before actually cooking the thing.
- 15:48So it was like, I don't know, like the moment when I started
- 15:52building fast API itself, I have been working on trying to make
- 15:56that thing happen for quite a while.
- 16:00And what were the main pieces that you felt like we're missing
- 16:04when you were out there window shopping?
- 16:07What was it? That was like, damn, this has
- 16:10this. This but then it doesn't have
- 16:11this. And then maybe there's another
- 16:13one that does have that and then it doesn't have this.
- 16:15And so you need to have them both but you can't use them both
- 16:18and what were those pieces that you were like I really need
- 16:22this. So that there's actually a bunch
- 16:28I wanted to have, I wanted to have to start.
- 16:30I wanted to have auto-completion.
- 16:32Hey, an in Liners, in the editor, I have really bad memory
- 16:36and I want the editor to tell me, what is the thing that I
- 16:39have to type? I know, when I, when I'm trying
- 16:42to make string is in uppercase letters, I never remember it.
- 16:45See topper, is it? Offer case is it capitals?
- 16:48I don't remember the names of the methods even more when you
- 16:52are working with. Python that like one of the best
- 16:55features of python is that you have the flexibility of using so
- 16:58many libraries and so many packages to for so many things.
- 17:01So you're normally just using new packages and new libraries.
- 17:04There's no way to just memorize all the methods in all the
- 17:07things that you are using. So I really like being able to
- 17:10have a to completion, I wanted to have that.
- 17:12I wanted to avoid as much as possible code duplication and
- 17:17information duplication you know, in in many Frameworks and
- 17:20in many tools you have to say in one place.
- 17:22Hey, Name is a string and age is a float, but then again you have
- 17:27to say the same information in another place for in one for
- 17:31documentation. In another one for data,
- 17:33validation in, another one for serialization, for the output of
- 17:36the data and maybe in another one to save the thing in the
- 17:38database. And you have to use four
- 17:41different ways of declaring that something is a strength, which
- 17:45is not necessarily code duplication because you are
- 17:47doing it in a, in a different way, using a different class,
- 17:49from whatever specific libraries, but this is still the
- 17:52same Meta information, sort of, but sir metadata of that
- 17:56particular model of that particular data type.
- 18:01And I wanted to avoid all that duplication of information
- 18:04because keeping that instinct is very, very error-prone and it
- 18:11introduces a lot of boats in the future when you have to refactor
- 18:14and change things. So I wanted to avoid that, I
- 18:16wanted to have a best practices by default, I wanted to be able
- 18:19to have data validation and to let you know when I was building
- 18:23Simple apis, with flask. And with other tools, the twins
- 18:28are getting started guide in those.
- 18:30In those in those tools into spring, a is pretty
- 18:33straightforward, but then you quickly realize that you have to
- 18:36validate that the data is correct and that what you're
- 18:39receiving is actually correct. And then you end up having 50
- 18:42lines of code with if statements everywhere trying to check if
- 18:46this is actually a string or not.
- 18:49And I wanted to be able to have that solved by default.
- 18:53A I wanted to, I wanted so many things I wanted to have very
- 18:57simple code. I wanted it to be very short so
- 18:59that you didn't have to create an instance of a class to them
- 19:02pass. Another instance, to another
- 19:03function to some, you know, I wanted to have great support for
- 19:07all the electors. So I and that was actually part
- 19:11of the process of building fast API before writing the internal
- 19:14code, I wrote the design of the interface that the final user
- 19:19will actually use for and I tested in several Laters, I
- 19:23tested with Visual Studio code with pycharm, and with editors
- 19:26based on Jedi, which are like most of the others to make sure
- 19:29that like everyone will have the best developer experience
- 19:32because that's what I was targeting.
- 19:34Like I was targeting myself as a developer.
- 19:36I wanted to have a good time but then I wanted to take if anyone
- 19:39else is coming from any other later, I want them to have a
- 19:42good time developing with this thing as well.
- 19:45And I wanted that, I wanted to have a automatic interactive API
- 19:50documentation. I thought that was amazing and
- 19:52it's the That was the first time I saw that was with Django rest
- 19:54framework. And then I realized, then I
- 19:57discovered that there was a new a new standard for defining apis
- 20:01with open API. And it has swagger UI that cool
- 20:04interpret that definition of the API and provide this amazing
- 20:09interface. So I wanted to have the thing
- 20:11based on that and I wanted the wanted to be able to have good
- 20:15security tools and authentication.
- 20:17Authorization, roles permissions, whatever was
- 20:19needed. I also wanted it to be as
- 20:22independent. Pendant as possible from any
- 20:24other tools out. So it wouldn't need plugins.
- 20:28It wouldn't need any particular database or any particular like
- 20:31you can just like import the package that you want to use and
- 20:33just use it. Direct.
- 20:36I want, I don't know what else I wanted to.
- 20:37I wanted to have dependency injection to and I actually I
- 20:40brought that from the front and World working with typescript
- 20:44and I wanted to have this, this this features here as well.
- 20:48I think there was a bunch of other things but I'm already
- 20:51talking too much. So, yeah, a little It's funny
- 20:54because we kind of going through some of this been through this
- 20:58kind of discussions around language Choice, until choice in
- 21:01the past in places of worms and it's almost like you wanted it
- 21:05to just not be poison almost 4 - like that's all the stuff that
- 21:09you kind of get from by some of them on the turtles and other
- 21:12Frameworks and stuff like that. Or flip that on its head, you
- 21:15wanted to make a really mature tool but for python, right?
- 21:19Which is a really, really cool like Nobles of endeavor, Over.
- 21:23And that kind of leads me down the path of thinking as a, like
- 21:27a standard Dev, who's maybe quite experienced, but
- 21:33frustrated with the tools right? And they're, they're going to
- 21:36build the next fast Epi, right? But they don't know where to get
- 21:39started. What kind of advice would you
- 21:41give like to? Yeah.
- 21:42Someone that's technically capable probably has the time
- 21:45and inclination, but just doesn't know what to get going
- 21:48with. Is it just stopped?
- 21:49Building, is it contribute to other people's stuff?
- 21:51Is it find a community? The where would you go or what?
- 21:54Advice would you give? So the, well first, I don't
- 21:58think I'm great at giving us back, but I think that they main
- 22:03advice, I normally given to everything is to focus on
- 22:06solving a problem if you can find and, you know, like, I have
- 22:12this may be kind of controversial opinion that
- 22:15there's a lot of like, I don't know, a lot of information and
- 22:19study and things are run innovation.
- 22:22And disruption and things like that.
- 22:25And I don't like those words very much because I feel those
- 22:28are side effects of solving a problem I consider the main
- 22:33thing is actually solving a problem.
- 22:34That's a great Point. Yeah and the that also helps me
- 22:39focus a lot more on what to do, you know?
- 22:42Like when you're trying to learn something it's like okay like
- 22:45maybe I should be a master in python or something like that
- 22:48and it's that's a painful path because you can never learn
- 22:51everything there is to know Do you know about the python or
- 22:55almost any other area is in particular, if you in
- 22:58technology, but then being able to focus on a particular problem
- 23:02that is important to you in Nikes like something that was
- 23:04important to me that I wanted to solve that help me a guide.
- 23:09Like should I learn this or not? Is this actually really going to
- 23:12contribute to solving the problem I'm interested in or
- 23:16not? And that can help a lot like
- 23:18decide what to do and what not to do on the other hand on
- 23:22there. And on the other side, if this
- 23:25problem is important to you and it's important to you as a
- 23:28developer. In this case, there's a high
- 23:31chance that it will be important to older people as well.
- 23:34And if you find a way to solve it in a nice way, it's probably
- 23:39going to be helpful to others and as part of solving a problem
- 23:45than the first thing that I try to do on the first thing that I
- 23:48think is useful to do is try to find existing Solutions.
- 23:51So be becoming a Power user before trying to build something
- 23:55from scratch because there are many solutions that are already
- 23:57great. And that can kind of really
- 23:59cover a lot of use cases. And a lot of things that maybe
- 24:04are not obvious to you or to me like when building something
- 24:07from scratch. So trying to learn like how to
- 24:10use the things that are rare and that my daughter is of the
- 24:13problems. I think that's a great start but
- 24:15then if you see that, it's not really solving.
- 24:18The problem on it is not really solving it in a way that is
- 24:21convenient enough for his notice.
- 24:22As close as the thing that you wanted to have enough, then then
- 24:26it probably makes sense to just try to build something that sort
- 24:30of satisfies that but focusing on solving that problem.
- 24:34Yeah, I loved it. You scratch your own itch but
- 24:37before you scratch your own itch, make sure that there's not
- 24:40a back scratcher there and like absolutely that.
- 24:43I think that's a Perfect Analogy.
- 24:46So it's and that makes a lot of sense on what you did, your path
- 24:50was I'm going to go and try and do something like.
- 24:54I really don't want to build anything that was your
- 24:56mentality. It's like again I really would.
- 25:00If I can I'm going to stay away from trying to build something.
- 25:03And then you went and explored and explored and explored until
- 25:06you got to the point where you thought, oh well I can use this
- 25:10and lo and behold that what you wanted to use was getting
- 25:14deprecated in you're like shoot man, maybe I need to build
- 25:17something, maybe has totally so I'm wondering.
- 25:21How do you go about making Fast API better?
- 25:25Are you doing? Like I can see a world where
- 25:28you're spending your 9 to 5 in like meetings or user meetings
- 25:34user research trying to figure out what the next best thing is
- 25:38or is it still just you're trying to scratch your own itch
- 25:40every step of the way. This is the low bunch of things
- 25:45that I already have in mind under.
- 25:48I already want to improve under your body is see that that that
- 25:52I want to happen in particular, to simplify the developer
- 25:58experience to simplify things that are already that can be
- 26:02improved. And I think like a lot of that
- 26:06is already like on the, on the, at least on the short-term part
- 26:10back. Look.
- 26:10But then, at the same time, I'm also.
- 26:12So here in a lot of people asking for things and like, you
- 26:16know, for example, right now, I'm in the middle of this
- 26:19complex, refactor to improve some things to do to allow doing
- 26:24certain things with routers that with some particular internal
- 26:27component for those that don't know much about fast API.
- 26:31So some internal part that you would normally use in one way.
- 26:33I want to extend that to allow using it in more ways.
- 26:38But then like you know this this reflector touches so many
- 26:42Things. And so many.
- 26:43So many particular Corner cases that have come along in previous
- 26:48issues and previous pull requests, and that already have
- 26:51tests there and things like that.
- 26:54In many cases thing things that I'm not personally interested
- 26:58in, but I know that there are some other uses that are
- 27:01interested in having those features.
- 27:03So, it becomes increasingly more complex to make sure that I
- 27:08satisfy like all the needs of everyone who they are.
- 27:12It's, it's an interesting Challenge and it's an
- 27:15interesting problem and at the same time there's also a bunch
- 27:18of things that like I have been getting more and more involved
- 27:24in the type annotations with python and these things.
- 27:28And I get to see and to understand a bit more every time
- 27:32a little bit more, how all these things work and how I can
- 27:35improve, all the type annotations and how they are
- 27:38used internally in fast API, how to make things easier and more.
- 27:42More obvious and more intuitive, you know, all these things.
- 27:46So, so, yeah, there's a bunch of things that I want to improve in
- 27:49that to make like all the experience and all the
- 27:52development nicer, What specifically are the things that
- 27:56you want to simplify and and why are they cumbersome right now?
- 28:00So for example, there's some particular parameters that you
- 28:04can pass to for example, to all those objects and they receive a
- 28:09dictionary that will have some particular variables.
- 28:12And some particular. So particular keys with some
- 28:15particular types and right now in the internal Force FEI, go.
- 28:19This, this is defined as a python Tech model, but you can
- 28:22also pass a dictionary with the same fields of the pedantic
- 28:25model. But the thing is, if you start
- 28:27typing the dictionary, you will not have Auto completion for the
- 28:31kids that you will have their. And now there is a there is a
- 28:34new world relatively new type annotation in Python.
- 28:37That is called typed dict that allows you to define something
- 28:42like a pirate. Mobile support for refining
- 28:44dictionaries, and the keys, and the types of the values of those
- 28:47keys for dictionaries. And if I can Define this
- 28:51parameters, as type, the eggs, then tools that can check for in
- 28:58liner for, for type errors can show in line errors when you are
- 29:01passing an incorrect key and things like that.
- 29:03And recently like I have been so excited about this type things
- 29:07because I knew that this will allow editors to provide better
- 29:11auto-completion. Or dictionaries Visual Studio
- 29:14code, had support for that for a while.
- 29:17And now pycharm recently added support for auto completion and
- 29:20Inland areas for these tactics. So now you can have you can
- 29:23start a dictionary for example. Let's say you're calling a
- 29:25function and then you say, you're going to pass the
- 29:28parameter and this parameter, let's say is called options and
- 29:31options equals. And then you start the
- 29:33dictionary and then you hit command space control space or
- 29:37like, whatever is the key to trigger to completion.
- 29:39And then the editor now in in modern, There's and now it's a
- 29:44python added that like last week or two weeks ago, this very
- 29:47reason. Now they will provide you how to
- 29:49completion for the keys of the dictionary that you can pass to
- 29:53that dictionary options and things like that.
- 29:56Of course, it requires that the options parameter is annotated
- 30:01as that particular type dict. So, I want to add type tickets
- 30:05to a bunch of the parts in fast API that will receive options,
- 30:09so that so that you can have more of the conversation.
- 30:11I'm always optimistic. My signal to confusion, I guess.
- 30:14I love that. So I've got like a more
- 30:17envelopes. Focus question that I really
- 30:19want to ask, but part of me, really wants to ask you've
- 30:23talked a lot about scratching your own agent solving problems
- 30:26that frustrate you, how what does it do for a festival on?
- 30:30How much of your time do you now, spend building part fast
- 30:35API versus using it to actually solve the problem?
- 30:39You know, you know, that that's also, that's also, that's also
- 30:42something that I find. Very, very interesting
- 30:45everything. Faking is that many open-source
- 30:47developers, end up spending much more time, maintaining the open
- 30:51source code than working with it.
- 30:54And I feel that I feel that is, I feel that is dangerous because
- 31:00implicitly, you will end up trying to optimize reducing the
- 31:04the work and like scratching your own each as maintainer of
- 31:08the code not as I user of the code.
- 31:10So I try to make an effort to do things that require me to use
- 31:15Stacy I as a developer so that I can, I can feel the pains that
- 31:20developers will have and that I can figure out like, okay, I
- 31:23need to improve this thing. I need to improve this other
- 31:25thing, for example, another of those things that I want to
- 31:27improve is that when you declare pedantic model, for example, for
- 31:31a response and the data that you are returning back from the
- 31:35function is not valid. Then that means that the data is
- 31:40a server error, because you are saying you are telling the
- 31:42client. Hey, I'm gonna give you this
- 31:43information but then you are giving it all the So the error
- 31:47says like, hey, this is invalid. I'm not going to just let it
- 31:50pass through and send the crying something that could be invalid.
- 31:54And like that is breaking the contract or something like that.
- 31:57That server error, currently shows a very long stack Trace.
- 32:02That doesn't give any of information of where the problem
- 32:04exactly. Is that something that I want to
- 32:06improve and that's something that I get to see when I'm
- 32:09working with a big Festival application and it's like, oh
- 32:12no. Where is this problem?
- 32:14Where is this happening? And then like I have to go
- 32:16through the pain of finding out where the thing is.
- 32:20But seeing those things as a user from the perspective of the
- 32:24user, that is using the tool helps a lot.
- 32:27Hey helps a lot in guiding again in also guiding the direction of
- 32:32like, where to go next and what to improve on what to do.
- 32:36That must be really light. Must be a really useful sort of
- 32:38experience, but at the same time, you can't really be angry
- 32:41at anyone because you put it there.
- 32:44So, right way to get onto the develops question then thinking
- 32:49about it. So if it wasn't fast API, right?
- 32:51So say that already existed someone else was doing here.
- 32:54Yep. Do you have a feel for what the
- 32:56what would be the next each you were going to scratch in like
- 32:59them? A lot of space?
- 32:59What do things missing? What?
- 33:01What frustrates you in that space?
- 33:03That you think? Yeah, actually, I could take a
- 33:05good stab at this. Build something that that would
- 33:07complete. That's all set, you know like in
- 33:11general in the envelopes area or like in apis.
- 33:16In just in general, in the envelope series but I think both
- 33:18would be interested in whatever. Yeah, you know, you know, and
- 33:21this is actually quite quite fun.
- 33:24I just starting working a little bit with, with any scale, the
- 33:28creators of Ray, which is this distributed computing and
- 33:31distributed machine learning and think General distributed
- 33:34computing system for Python. And I think that's that's an
- 33:37area that can that can benefit from like, you know, like these
- 33:41are the completion and type errors and like all these
- 33:43things, all this, all this All these things that I'm always
- 33:48obsessed with and they actually doing a great job with that but
- 33:52I still like, you know, like being able to see if there's
- 33:55something that can be improved and like I'm trying to do over
- 33:58there. It's amazing and that's
- 33:59precisely what I'm what I'm going to do with them just like
- 34:02check the communication and check the the like if there's
- 34:05anything that can be improved in the type annotations so that the
- 34:08developing distributed applications can be as nice and
- 34:13enjoyable and safe as possible. Safe in terms of like being sure
- 34:18that your code is not broken and that you're not using incorrect
- 34:21types and that type of thing. So, yeah, that that's something
- 34:25that I think is very, very cool. Where do you feel like right
- 34:32now? The landscape is going, how do
- 34:37you see it changing over the next one year?
- 34:40Five years, one thing that I feel is gonna is gonna is gonna
- 34:48improve a lot and it's going to be great.
- 34:50Is that recently? There was a it was a accepted a
- 34:53new way to defined type annotations for n-dimensional.
- 34:57Erase or and erased answers. However, you want to call them
- 35:02and to Define as part of the typing information to define the
- 35:07sizes of these tensors of these Cynthia Racers, please whatever
- 35:13that means that at some point in the future.
- 35:17Because like, that needs to be accepted as part of the language
- 35:20of as part of python itself before it can even like be used
- 35:23by libraries. But now that it was accepted,
- 35:26I'm pretty sure it was accepted me and And things of the ground,
- 35:28but I'm pretty sure it was Exempted.
- 35:30Now, a libraries can actually use it.
- 35:33And that means that known by tensorflow by torch, all these
- 35:36things can start, adding type annotations with that
- 35:39information and that will mean that when you are at a know,
- 35:43when you are multiplying 1, Matrix with another in Mumbai or
- 35:48tensorflow or whatever, you will be able to have any nerves right
- 35:52in the editor. Later, red squiggly line telling
- 35:54you, hey, there's this size mismatch in this.
- 35:57Two matrices, they are not compatible.
- 35:59You cannot multiply one by the other things like that.
- 36:02I think that's that's going to be amazing.
- 36:04Like, you know, because right now, a lot of that stuff can
- 36:07only happen at runtime, you have to run the script to then see
- 36:10how he explodes and then try to figure out, where is the
- 36:14problem. And like, for example, that
- 36:16likes a mismatch of sizes is something that is normally very
- 36:21difficult to the book. Like, it takes a long time to
- 36:24realize like, oh, of course, I have to flip the The this this
- 36:29Matrix first because I'm multiplying it incorrectly or
- 36:32like I put it in the wrong side. I have to multiply the the
- 36:36other, by this one, not this one, by the other or things like
- 36:38that. You know, like that in many
- 36:40cases are just like simple do mistakes, but being able to
- 36:43notice that very quickly, right? In the editor of writing the
- 36:46point where that is happening, I think that's going to be like a
- 36:49massive productivity booster. I think that's going to be,
- 36:53that's going to be amazing. The other thing that I fail is
- 36:56probably gonna happen, and And that I hope can happen is a bit
- 37:01more of interaction between the machine learning world and the
- 37:04async python world. Because right now, most of the
- 37:08machine learning and ml mL of some data science and all these
- 37:13types of things, apis and packages are blocking and you
- 37:18never use. AC generate, you just like, Cody
- 37:20thing directly, but been able to mix, both and being able to and
- 37:24learning how to do that properly and how to use it.
- 37:28Going to wait and at the same time, use much-enduring, that
- 37:30will allow a lot of improvements in performance and in terms of
- 37:35concurrency and in terms of distributed applications and
- 37:38things like that. So I think that's something that
- 37:40cool could improve a lot and python is made to like the way
- 37:47python is growing right now makes it such a good language
- 37:51for doing concurrent code for doing a sink and a weight
- 37:55things. And for interacting with that,
- 37:58And that plus the fact that python is the language for
- 38:01machine learning. I think it's going to be a great
- 38:04combination so then what things aren't going to change.
- 38:09Like if you had to bet, this will still be the same in five
- 38:13years and not because you want it to just because you feel like
- 38:16this is what we've decided on. Maybe what would you say?
- 38:20Where would you put your chips? What would not change?
- 38:30So for example, I know that there's most certainly not going
- 38:37to be a breaking change, like the change from python 2.2,
- 38:41whatever to Python 3 point whatever because that the, that
- 38:46made a lot of code in incompatible, with whatever was
- 38:50the previous versions and that the was a very painful
- 38:55transition and it Very painful for the maintainers of python
- 38:59itself. Like, you know, having to deal
- 39:00with all that having to deal with all the users and all the
- 39:04things like that was, that was something that was a very
- 39:08painful transition that they are all like like, you know, like
- 39:12you just mentioned the python, the transition from python 2 to
- 39:163. And they all like, you can you
- 39:18can see them like Schreiber, it's like, oh no, they are not
- 39:21then you're not gonna do anything that will break
- 39:24backwards compatibility. That way not easily.
- 39:30So I don't think that's something that will happen.
- 39:32I also don't think the python will get like super specialize
- 39:36in one particular area or like, you know that.
- 39:39Oh. So now the python is only used
- 39:40for data science but is no longer used for, I don't know
- 39:43for terminal applications or for web development of it.
- 39:47I don't think that's going to happen either.
- 39:50I think it's just going to keep growing.
- 39:53I mean like I don't feel this and there's an area.
- 39:56All suddenly diminish and just disappear or something like that
- 39:59in Python. So yeah, like it's I don't know.
- 40:05I don't know if it's a good answer or not, but it's
- 40:07something that is not that I feel is not going to change like
- 40:10the diversity of things that you can do with python.
- 40:15Yeah, I think that's perfect. That's a great answer.
- 40:18One thing that I'm wondering about, I want to change gears
- 40:22real fast and get a bit more into the The Human Side of you
- 40:28and know about like because I've seen your you went all over the
- 40:33place, you were in Colombia or you started your life journey in
- 40:37Columbia and then you went to Saudi Arabia, you're now in, you
- 40:43know in Germany. There's got to be a lot of cool
- 40:47stuff that's happened along the way.
- 40:49I would love to hear about Saudi Arabia but I also just want to
- 40:53know like the main thing I want to know is how has your Life
- 40:56changed since. Fast API, like how have you as a
- 41:02person started to what has changed?
- 41:05I guess is the main thing and how Huh.
- 41:09That's that's a really interesting question like so
- 41:12much has to do, you know so much had changed even before first
- 41:16API, you know, the guy from Colombia and I'm from Colombia
- 41:20Latin America. That's why the accident for
- 41:22those that haven't noticed unlike hey, I ended up in Saudi
- 41:26Arabia and Bahrain, which is like, the, the Iceland on the
- 41:29side and then into y, for one year and a half, or something
- 41:32like that. And then now in Germany and now
- 41:34in from Germany, I'm working mostly for companies in the The
- 41:38states but remote is always like this weird thing like all over
- 41:42the place and like that that implies a lot of changes but
- 41:46after first API like I don't know.
- 41:48It's so so many things have changed its so it's very
- 41:52strange. It's really strange.
- 41:54It's of course is super exciting and very cool and like I get a
- 41:58lot of things out of it but at the same time is quite strange.
- 42:03Like you know, and you know like one thing that I think is
- 42:06particularly fun is I built this whole thing first API, blah,
- 42:12blah, blah. And I built this library for
- 42:14building commander in applications typer, which is
- 42:16like with the same style of fast API and then I built this
- 42:21library for communicating with with databases built on top of
- 42:24SQL command pedantic which is like kind of or M or something
- 42:28like that. But the thing that really got me
- 42:34more followers on Twitter was one tweet.
- 42:38That was fun. Um, and that went viral.
- 42:40The was just, like, mildly for her own and like that was the
- 42:44thing that was that gave me the most exposure, I guess.
- 42:48I don't know. It was very strange because
- 42:50like, I worked so much invested PA and I made a joke about for
- 42:55CPA and that's what was super super viral and like will
- 43:00brought a lot of people to see what I have to say.
- 43:02And like, hey, I want say a lot of fun things like I'm just
- 43:07talking about first API and pipe.
- 43:09I'm mostly worried with. Yeah and I think that what you
- 43:12said that famous tweet has made its rounds all across the
- 43:17machine learning and even software engineering internet.
- 43:20Because if you don't know and you're listening and you're
- 43:22wondering what the Tweet is. It was something along the lines
- 43:25of like a recruiter asked me if I had experience in fast API,
- 43:29and for, like, seven years experience, right?
- 43:32And I said, no, I only Built it. Five years ago or something like
- 43:35that, was it? Yeah.
- 43:37Is this a joke? Was that the required four plus
- 43:40years of experience in first EPI?
- 43:42And I couldn't apply because I built it that thing.
- 43:44One and a half years ago, that was the tweet and like the idea
- 43:48that under the end of it, it was maybe we should re-evaluate that
- 43:52idea that the skill level is the same as the experience in years.
- 43:57Which is something that I really, I don't know, something
- 44:00I feel very deeply and I struggle a lot with I don't like
- 44:03it when companies require years of experience because I feel
- 44:07like that's a a very, very bad proxy for skill level.
- 44:12Yeah. And for skills.
- 44:15Yeah, because you could have spent sitting around doing
- 44:18nothing for ten years at some big company or whatever and not
- 44:21gotten fired. Just just doing the minimum and
- 44:24then you have those ten years and you're getting the and
- 44:27someone who actually is hungry and wants.
- 44:29It is getting passed over because there's somebody else
- 44:33with ten years and this person who's hungry only has one year.
- 44:36Totally totally. And at the same time, at the
- 44:40same time, you have like I don't know this person that is just
- 44:42the was doing machine learning data, science or blah and then
- 44:47had to start doing front end at least start up.
- 44:50And then like, it was just a start up and it was just this
- 44:52massive amount of work that they became an expert in front end
- 44:55leading a tables to L developers at the same time.
- 44:58And like, you know, the amount of experience that this person
- 45:01can have in one or two years is just massive compared to what
- 45:06song? Someone that can have 58 years
- 45:10building the same exact back in the application with the same
- 45:13database with the same thing. Like, you know, not necessarily
- 45:16solving a new problem. Like the difference is the
- 45:20imbalance is very high in these things.
- 45:22So so yeah. I don't know.
- 45:23I feel like years of experience is above estimator.
- 45:27You know? It's of course, it's an
- 45:29estimator is an indicator, like, it has some kind of correlation
- 45:34but I think it's not great in particular.
- 45:36Now, the technology is advancing so much, maybe some years ago,
- 45:39when everyone was just writing Java with the same database and
- 45:44with the same things. And like, yeah.
- 45:45Well if it has, if that person has most more years, like they
- 45:48have to have seen more problems and like that's it, but
- 45:52nowadays, that that you have like new Frameworks, new tools,
- 45:55new features in the languages and new ways to do things that
- 45:58are faster and more productive than the ways that you had
- 46:02before. Like it's everything becomes
- 46:06more. Or more relative completely.
- 46:08So yeah you touched on an interesting point there and I
- 46:12think it ties in with the kind of Journey you went through with
- 46:16eventually starting to build fast API but People like,
- 46:22especially in the envelope space and the Machine only space.
- 46:24There are so many tools and libraries and Frameworks out
- 46:27there. It's hard to you can't become an
- 46:31expert in the mall. It's in fact, it's hard to even
- 46:33use them. All right?
- 46:35How like, how do you pick the winners for you or do you just
- 46:39stick to one and get good? Or do you think what's your
- 46:44approach for like, sifting through all that stuff, right?
- 46:48It's hard. That's a good question and like
- 46:51I Don't have it figured out and it's overwhelming and like, you
- 46:54know, like I see, I see in particular people that are new
- 46:57to the field like people that are learning and that they feel
- 47:01so overwhelmed and they feel like this massive imposter
- 47:04symptom, but they don't know that we all feel the same
- 47:07imposter syndrome and that we are all feeling like, oh, this
- 47:11is so impossible to learn everything, you know, I
- 47:14remember, I remember the ouster of pie torch tweeting about it
- 47:18like some monster or maybe one or two years ago or something.
- 47:21They saying, I don't know how to keep have to keep a typical the
- 47:26pace of the things that are changing.
- 47:28Like, how do you, how do you keep reading papers, reading
- 47:31these things like learning new libraries.
- 47:33It's I feel it's very difficult and very complex.
- 47:36My personal approach is like, well before I used to read a lot
- 47:41of blog posts, trying to compare one thing and the other, but
- 47:45then in the end in practice, I ended up realizing that this
- 47:50blog posts. In the end are like in one way
- 47:53or another bias to the point of view of that person and I have
- 47:58been finding more and more the things that I really want to
- 48:00optimize, for example, auto-completion and inline
- 48:03errors and like editor support. And these things are very
- 48:06important to me. And I want to be able to have
- 48:08that. And whatever comparison is done,
- 48:12by by someone else, is probably not going to have in mind, the
- 48:16things that I think are more important to me.
- 48:20So the What I have been doing like lately when exploring
- 48:24Technologies or things like that, is to try to follow the
- 48:28getting started tutorial of those Technologies and just like
- 48:31try to follow the, the very first steps and try to get the
- 48:34feeling of how it looks like how it works.
- 48:37And that gives me a lot more of a sense of like do I like this
- 48:42or not that much. And at the same time, if
- 48:46following, the getting started guide takes one week then it's
- 48:50also a Maybe not a great indicator because like maybe
- 48:55this thing is too complex and like, I don't know, maybe, maybe
- 48:58I can start with something simpler and figure and see if
- 49:00that that's good enough for the things that I want to do.
- 49:03That's also what I what I recommend with first API like
- 49:06when you're sinking like should I use first API or not instead
- 49:09of just reading and reading and reading what others have said
- 49:12that that you should do or not, I recommend just like reading
- 49:17that the first page like the, the main page of the website,
- 49:20just the main page. Age and following that tutorial
- 49:22and like executing it and like running it in the editor and it
- 49:26will take like 10 times or some 10 minutes or something like
- 49:29that. It's just just that no, no more.
- 49:31But that's enough to get a feeling of.
- 49:33Hey, I like this or not. Like do I like this approach?
- 49:36Or is it too weird to me and like I'm so used to working with
- 49:39Django to. I really don't want to try.
- 49:41This thing is too weird or maybe you can see like okay this this
- 49:45looks nice, maybe I can framework.
- 49:47That's I think that's kind of my Approach now.
- 49:50Try to try. To use the actual tool a little
- 49:53bit in some cases from the same examples.
- 49:57Now, I can before running the code, I can know that.
- 50:01Hey this kind of provide Auto completion.
- 50:02This won't be able to checks for the types because there's no way
- 50:08to annotate this type of thing just because like I helping
- 50:12getting so deep into this type of notations, on these things.
- 50:15But I feel like that the best way just to try to run the code
- 50:18try to test it locally a little bit.
- 50:21It and that gives a lot more sense of like, does it work for
- 50:24me or not? Incredible.
- 50:28So so good, man. I really appreciate this view
- 50:32point of me bringing. It's like the way that I see
- 50:36your framework, or what you are trying to do is, you're really,
- 50:41really deep on certain things that you really enjoy, or maybe
- 50:45it's not that. You're only deep in this area,
- 50:47but you really enjoy and you're, you're, you're shaped like, what
- 50:52you're passionate about. How can you bring that to other
- 50:55areas? And so, I think about when
- 50:58you're talking Using any scale and Ray and how can you bring
- 51:03auto-completion to that, right? So that is just that super
- 51:08awesome to see. I think my video might have gone
- 51:12out for a sec but but this is this is great.
- 51:18I think we can end it there. Unless Adam, do you have any
- 51:21final words? Just really fast.
- 51:26And I could honestly listen to you took away all days.
- 51:28It's obvious that you've done the hard miles is developing not
- 51:33the Deep technical expertise on the thing.
- 51:36That like the Mitre saying you really care about and actually
- 51:40when you get over the hill of difficulty there, you can start
- 51:43to apply that add value all over the shop, right?
- 51:46So that's really, really cool. Now look, thanks very much.
- 51:49It's been a yes, been great speaking Jeff.
- 51:52So amazing. Everyone out there.
- 51:54If you want to or I highly encourage you to follow
- 51:58Sebastian on LinkedIn you'll just see him posting all
- 52:01pictures of him. Traveling around the world and
- 52:04it will make you very jealous for meeting with all kinds of
- 52:07cool people or follow them on Twitter will leave the links to
- 52:10those below. And then you can check out fast,
- 52:13API, will leave a link to that he's also on.
- 52:14Get, he's got an incredible GitHub that you can check out.
- 52:17We got all the links for you in the description and that's it.
- 52:20I think we can enter their thanks Sebastian.
- 52:22Thank you very much. Thank you.
- 52:23For having you know, like I had so many doubts that I will be
- 52:27able to break anything useful to envelopes Community, but it's
- 52:32been fantastic. It was very, very fun chatting
- 52:34with you too.