Transcript: Building a Django API Framework Faster than FastAPI - Farhan Ali Raza
This episode is brought to you by Six Feet Up, the Python Django and AI experts who solve hard software problems.
Whether it's scaling an application, deriving insights from data, or getting results from AI, Six Feet Up helps you move forward faster.
See what's possible at sixfeetup.com.
Hi, welcome to another episode of Django Chats, a podcast on the Django web framework.
I'm Carlton Gibson, joined as ever by Will Vincent. Hello, Will.
Hey, Carlton.
Hello, Will. And today we've got with us Fahan Ali Raza, who I had the pleasure with spending this summer working on the Google Summer Code project to bring template partials into Django Core.
Hi, Fahan. Thank you for coming on the show.
It's an honor to come here. I have been seeing you for months, and I have been following Carlton for years, so it's an honor to be here.
Oh, I'm all blushing.
So come on, Fahan, let's talk about template partials and the Google Summer Code project, because that was the big thing.
And I've mentioned it a few times on the show, but you were on the sort of coalface doing the hard work there.
So how was that for you? Describe the summer.
It was amazing. I did not like think that it will be like that hard.
But like I was just...
When I was applying, I was just thinking like, it is just a package. I'm just going to copy paste things.
But like when doing like I find out like it was not just copy pasting.
So it was amazing experience. I learned a lot of things. It was great.
Well, and I'll just mention you, you've written about this on your blog. So we're going to put links to everything, but you went into more depth.
But that's pretty.
That's pretty impressive that your first Google Summer Code is like a top three feature in a major release, I would say.
Carlton, what about for you? You've mentored other people.
I was just going to ask Fahan, was there a moment when you panicked?
Was there any moment where you were like, oh, no, this is going wrong?
Panic. I will not call that panic.
But like first moment, like when I realized like this is not like what I thought it will be.
Was like when I was handling...
Like I think it was the first PR in Django packages or Django tablet partials when we were handling render time and compile time things.
So I did not like I did not even think about that when applying.
So I was thinking like this is something else like there is kind of there is a kind of thought that kind of you have to think before making changes.
And stuff like that.
So that was the whole process was cool.
Like I enjoyed the whole process.
There was no panic per se, but it was just a surprise there.
Okay.
I mean, so the way I've described it when we talked about on the show is that without your help, I would never have been able to get it in.
Not because I couldn't physically do it, but I just didn't have the time.
I didn't have the capacity.
It really does need like somebody dedicated.
You know, a 12 week project does need someone to dedicate a good chunk of time to make actually make it happen.
Because there's a lot of things which were the third party package was okay, but not up to Django standards.
Yep.
And like there, there are so many kind of what can we say like a side quest that happened when we emerging something into Django.
The thing that I remember is the like we...
Merged the like that thing like to find partials, the regex solution that was merged into Django template partials and then that was merged.
So we thought that regex was the solution.
And we, I think there was five or six reviews for that regex.
They're like, we have to fix the regex part, regex part, regex part.
And in like in the next PR, we removed that regex.
So...
Exactly.
There are many side quests that happen.
Well, anytime you bring in a regex, you're in trouble, right?
Yeah.
So, okay, we'll move along there.
But tell us a bit more about yourself.
What did, like, were you, are you a student?
Were you a student?
What are you up to now?
I have graduated in 2023, Bachelor's of Computer Science.
I, now I'm like just freelancing and...
Stuff, like, working part-time, like that.
Before that, I, I was a pre-med student.
So I was not, like, a computer science student.
But, like, it, it, like, there is, I don't want to go that deep into it.
But, like, there is a process in, like, Pakistan called MCAT.
So there is a, like, competitive exam for medical.
Admissions, like MBBS student admissions.
So that was a goal when I was doing pre-med.
But I discovered kind of programming in my, like, 11th grade.
So there is, like, it's different.
I don't know, like, what is in Spain or America.
But, like, it's first 11th grade, 12th grade.
And after that, you start your bachelor's degree.
So I discovered programming in, like, 11th grade.
I was just...
Like, I, I downloaded a book, Head First, like, HTML, CSS.
That, then I discovered HTML, CSS.
And, like, I thought that was very interesting.
So, like, like, it was lucky.
Like, the, like, I could not clear the competitive, like, exam.
And, but I could become, like, a doctor of pharmacy or something like that.
So I thought I...
I don't want to do medical at all.
I want to do computer science.
So I switched the whole thing around.
Okay.
That seems to be coming out quite nicely for you now.
Yeah.
How is it taught in Pakistan?
Do you use Python?
Is it Java?
Or what is the formal...
Or what are the languages that are used?
It depends on the university.
Like, every university have different way of teaching.
Like, most commonly, I think, they start with C++.
Like, in first...
After there is introduction to programming, that is C++.
And after that, Python comes at, like, I think, fourth or fifth semester.
After that, like, Python and stuff.
And do they have anything on web development per se?
Because in the U.S., they don't.
It's like an elective course, usually.
I think in Pakistan, that is also an elective course.
But they have made it, like, it is not elective.
Like, you will have to take it.
So...
Ha ha ha.
Because in, like, smaller universities, they don't have, like, a lot of teachers.
So, they just enforce even elective subjects.
So, there is one development or web development course.
And is that...
I'm sorry, go ahead.
But they don't teach anything productive there.
So, I remember, like, we did HTML and CSS in 2021, I think.
Like, HTML.
And CSS just in six months or so that semester.
Right.
That's not...
That's the case also in some U.S. universities.
So, it really depends.
Sometimes the web development course is designed for people who are not computer science majors.
Actually, often it's not.
So, that's why it will be HTML, CSS, a little bit of JavaScript.
But I...
There's not that many places that have a, you know, Django course or a Spring Java course.
For some reason, it seems...
Seems important, right?
Because everyone gets trained and then goes to work on the web.
But I guess there's a databases course.
But there's really...
There's...
You know, even MIT, just down the street from me, they have a missing semester.
It's like a January term where they teach, like, how to use Terminal, how to use GitHub,
how to do web development.
Because in the core MIT curriculum, you're not going to take web development unless you
do it on your own.
Right?
So, it's everywhere.
There is a very good course.
There's a course that Harvard gives.
Like, that is called CS50.
Like, I learned my Python from that course.
Oh, wow.
Did you actually...
This is the David Malin course.
Did you...
Yeah, yeah.
...work through the whole thing?
Because, like, famously, people start, but then it's a lot of work to do on your own.
And it just sort of keeps ramping up the demands.
I knew programming, like, some programming before that.
So, I just...
Like, watched the stuff that I wanted to learn.
There was, I think, a Django video for one hour.
And, like, the Python video, there is for one hour.
So, I just saw, like, what I wanted to learn from that.
I did not, like, follow the whole course.
I just, like, learned the small parts that I wanted to learn from that.
But that was very, like, a very good course.
I want to ask you.
I want to ask you about all the things you've been doing since the Summer of Code project.
Because you've been quite prolific.
Can you...
You know, I mean, I've got a whole little bullet point list of projects to mention.
But can you talk us through your open source work around Django for the last few months?
Well, can I just hype you up a little bit?
I would say, besides the fact Carlton knows you, when I look and see who's doing really interesting stuff,
it's, like, you again and again and again and again.
So, it's not just with Carlton.
I'm having discussions with people.
We're sitting back going, well, who is this mad scientist doing all these...
All these crazy things.
So, it's...
Just so you know, it's really exciting to see someone smart with new ideas just doing stuff because.
So, it's exciting for the community that you're doing this.
I started Django Board because I did not want to use, like, fast API.
So...
Because I was...
There was a, like, side project I was building that required...
Web sockets or, like, a server...
Like, SSC.
Server sent events.
So, when I went to, like, the forum, it said, like, you will have to use, like, Daphne for...
Because, like, some, like, long views take time.
So, you will have to do that or use channels, Django channels.
So, there was a fear of fast API and Django channels.
So, I thought I should build a new framework to solve that.
So...
I built...
Go on, carry on, carry on.
I...
There, like, for some reason, I just wanted to have something fast because I really enjoyed ORM part of Django.
Like, it is amazing.
So, I just wanted to have something fast that is built for Django.
So, and then I...
I saw Robin.
There is a framework called Robin.
It is also, like, Rust and Python mixture.
So, I thought, like, it should be possible to, like, build something that handles request in Rust and does, like, business logic in Django part of the things.
So, that was...
Gives me, like, inspiration to, like, go all in.
I started that just as an experience.
So, I wanted to see if, like, that was possible or not.
But when I, like, tried to implement it, its performance was very good.
So, I thought, like, I can spend, like, months after that to, like, make it something better.
Okay.
And you've mentioned the phrase performance was very good.
It's one of my pet peeves on the show that people talk about fast, but they never give any numbers.
And you've been laying down benchmarks from day one, which is what makes it so exciting.
So, can you give us some idea of the performance?
The performance, the throughput you're seeing on Django Bolt?
So, I agree with you.
Like, performance is subjective.
Like, it will all depend what you are doing in views.
So, like, I...
And there is, like, a whole Reddit discussion when I, like, launched Django Bolt on that.
So, everybody was saying these benchmarks are, like, just wrong.
Like, this does not approve anything, prove anything and stuff like that.
So, like, my whole point was, like, when I am building something, I will have to use something to measure something.
Like, what I will do, like, build a whole application and deploy it on a VPS to measure.
I cannot do that.
I will have to measure, like, small JSON, small database queries, small, like, stuff.
So that I know, like, if I make a change, it makes a positive impact on my, like, base.
So, what I am getting in, like, if we use one worker.
So, one worker in Django Bolt is one Actis thread.
Like, Actis is a Rust framework that I use.
And that one Actis thread is bound with one, like, Python event loop.
So, Actis handles the Rust part and Python event loop, like, kind of, like, execute the whole Python thing.
So, that makes one worker.
So, that one worker, I get about 27,000 RPS on Lexi.
if like if we return a simple hello world json so if we do like a database query so that like
the orm becomes kind of the bottleneck for that so that like the performance that becomes
that is still faster if we use sql alchemy with sqlite so i have not measured with possible sql
or like faster uh orms with fast api but i have measured with like sql alchemy so that i was
getting about uh five thousand nearly i think five thousand rps uh with like uh i think there
is one query for 10 records that reads okay and what's kind of um difference between that and
this vanilla django i guess would be the question the performance difference yeah
you know
if like we uh like take account like database queries if we compare database queries then
the performance difference uh is like i think uh 1000 rps on django like if we use some faster
serialization and like uh yeah i i have forgotten the actual numbers but like it i think it was 1000
rps uh on django like raw django and like i think uh
i got about like uh three four about four thousand i think five thousand rps in django bolt so
both of those sound quite fast right i mean the first the first thing i saw here was you did um
you did a project called django rapid which was using diff which is just python-based vanilla
vanilla django but then changing out the serializer layer and you can comparing rest
framework serializers to i don't know um pydantic serializers to meshi spec serializers um and what
was interesting i thought there was that you were getting fast api like um throughputs just with
basically with django yep if like we compare like uh database queries uh like the performance uh is
kind of equal it like i think um it will uh like the performance is kind of equal it like i think
um it will uh like if we have because django or or fast api orms are async so if we have a lot of
queries and uh like a lot of business logic then the performance i think the performance difference
will increase i think and but like if we compare simple read queries the performance difference is
nearly equal like the the difference is not very stark and what i think is lovely about all these
benchmarks is you've got them all up on github and everyone can go and look at them and everyone can
pull them locally and everyone can run them themselves and they can see that these ideas
well actually you know django slow is well no it's not the same speed as everything else what you're
doing yeah you mentioned you mentioned async orm then today i think or yesterday you put out um
a kind of uh turbo orm package which is um an async query manager for the django rm right talk
so the idea was uh uh i think adam gill he created like a benchmark of like
uh time he he was comparing the whole like the request response like time
cycle so he he he wanted to measure that with like the async back end that uh free created so
i he also like i think he does not said like um another i forgot his name
he said like uh you should be able to use that async backend with uh django bolt and
my year like what performance difference you get so i when i tried to use it because
it is just a async backend so we can just use raw sql so i thought like it will not be that hard
just because in my in my mind i was thinking i'm gonna overload some like execution of django
queries and like uh use that async backend and just create it but like when i tried to create it
like that was a whole another process it took me like four five hours of work uh to just like
create something working
because it worked like in in one request it worked fine like it loaded the thing but when i
wanted to benchmark it with the bombardier the like i was getting um like connection
exhaustion errors so i had to fix uh polling issues and stuff like that and i did not know
like the full it it's a naivety of like a person so i because i did not know that i had to fix it
because i did not know like the full it's a naivety of like a person so i because i did not know like the full it's a naivety of like a person so i because i did not know like the full it's a naivety of like a person so i because i did not know like the full it's a naivety of like a person so i because i did not know
because i did not know like the full it's a naivety of like a person so i because i did not know how the full orm and database
know how the full orm and database
know how the full orm and database things works i did not even think about like
things works i did not even think about like
things works i did not even think about like how the connection management works
how the connection management works
how the connection management works and how the stuff like that things work
and how the stuff like that things work
and how the stuff like that things work so in my naivety i started and after that
so in my naivety i started and after that
so in my naivety i started and after that i have to solve the whole connection
i have to solve the whole connection
i have to solve the whole connection things and stuff like that
things and stuff like that
things and stuff like that because uh in a django hand the sync
because uh in a django hand the sync
because uh in a django hand the sync version of django handles the connection
version of django handles the connection
version of django handles the connection in a very different way
in a very different way
in a very different way it's like i think threads context was
it's like i think threads context was
it's like i think threads context was and stuff like that
and stuff like that
and stuff like that so it like i think it when you do not use
so it like i think it when you do not use
so it like i think it when you do not use polling it closes after request i don't
polling it closes after request i don't
polling it closes after request i don't know
know
know for fully uh is if that's the case but
for fully uh is if that's the case but
for fully uh is if that's the case but i could not find anything
i could not find anything
i could not find anything for async that like we were discussing
for async that like we were discussing
for async that like we were discussing before this podcast
before this podcast
before this podcast so i will try the async signal thing
so i will try the async signal thing
so i will try the async signal thing on that what i love is the way you just
on that what i love is the way you just
on that what i love is the way you just like not just but the way you dive in
like not just but the way you dive in
like not just but the way you dive in you're like yeah i'm going to take this
you're like yeah i'm going to take this
on i'm gonna do it and then you discover the massive locker and you're like right i'm gonna
fix that as well and you just keep going so i mean for me looking through the the the rust front end
for the the request response plan i think that's a really exciting um development looking at the
different serializers we talked about that on the show before but like rest framework serializers
are kind of last generation and there's caters there's pydantic there's message spot there's all
these um much quicker options out there and so to demonstrate those with django is like a real
service to the community it's like yes look this is how you do it and look how much faster they are
wow and then for me the the um async properly fully asyncifying the orm is like the last piece
of the async story you know if we go all the way down to the database connector then you know
whatever you want to do with async whether you want to use it or not it's it's the stories then
at that point finished so like you're really
hitting kind of all the all the tick boxes of the things i'd love to see
this portion of django chat is brought to you by six feet up what's stopping you maybe it's
an application that won't scale or an ai initiative that just isn't delivering that's where six feet
up comes in with deep expertise in python django and ai they solve hard software problems modernize
platforms and get teams to market faster their impact speaks for itself automating healthcare
pipelines for hospitals helping nasa explore pluto building severe weather prediction tools
and applying ai to connect farmers with vital crop data when the stakes are high and the problems
are hard six feet up is the partner that delivers see what's possible at six feet up the partner
i think it's uh i'm like just like i understand that part like as a beginner you kind of like
for some reason like that thing is fast that thing is fast that thing is fast so as a
beginner i kind of like that my thing is fast kind of stuff so that was a whole kind of process if
like if we have orm that is full async that will make the orm very fast because there is like a
sync to async part and the whole stuff it is it it i when i was using i was trying to handle sync in
vault um the performance drop for sync to async part like becomes very like stark at that if you
are getting like some even if you don't use the orm the performance difference if you are getting
22 000 rps and you want to execute the synchronous views you like uh create a like a wrapper using
sync to async on the bus and you want to execute the synchronous views you like uh create a like a
the performance difference drops like 22 to direct like 10 12 000 so there is like a 50 percent drop
there because of the third part of the whole thing so if we have the whole orm async i think that
will be that will i think be the performance difference will become i think us to talk like
a 50 percent or something like that so are you hitting the gill there just out of interest is
that where the
because obviously there's a cost to um spin up the extra thread but is it is it the fact that the
python threads aren't able to um execute in parallel um it's causing a lot of the blockage
there do you know i mean you may not know you may not have been able to profile because like how the
jango bolt works uh there is one gill for one worker so actus is the one worker and then the
gill part so if we have something that execute using thread
it kind of blocks a gill for some reason so this is also a gill part and also a latency part of like
spinning up a new thread for handling that request i think but do you think i mean have you have you
experimented with the uh i can never say this because of the f and then the th the free free
threading uh mode on python 3.14 no its performance decreases very much like for some reason i think
it is not kind of ready or something like that so i think it's kind of blocking the gill for some
the performance difference like decreases it like decreases a lot like not like normal decrease
it decreases a lot i tried it with like i think fast api and the jango bolt the performance
difference decreases a lot i think there is some issues or like i was not able to and also because
um the pi o3 it does not like it has different like
for it is a it has a different method of handling uh the non-threading python so i was not using the
whole things that it provides to handle like non-threading python so i think that also causes
an issue so i was not able to like properly benchmark that okay that's not quite ready yet
okay i i think all that's really interesting we'll jump in before we disappear down the uh
yeah no no i'm happy to listen i i mean
you have so many projects i i wanted to ask about the bulk mail verifier which seems like was one of
your early projects but is gets a lot of usage what what can you say about that project so that
was the project um like i have been because uh i had to work part-time when i was like studying
so uh that is a project that i have been working when i was studying uh that project is like a
partnership with uh like a project that i have been working with and i have been working with
another person uh he's like i i build stuff and like he manages the whole selling part of the
stuff so it's an email validation site like for email marketing people come in and validate their
email like this is a valid email this is a invalid email this is a catch-all email and
like people take that result and do email marketing with that so did he come to you with that i
don't have an idea or is that like how it seems like that would be the case right as a student
i mean i wouldn't think of that unless i was in the email marketing world he's an email marketing
kind of guy so he knew that he it was his idea and stuff so i was just like kind of cto part of it
so i i was gonna build and like we have like a partnership kind of thing there so yeah that we
that's not a bad setup that's carlton's setup
right now it is no i do exactly that like i'm the code monkey and he's the you know
okay i i guess the one other one are we we're not quite at 30 minutes but i i want to ask um
carlton has mentioned that you do you use um llms and ai in your coding at all i use a lot of it
tell us about it because i feel like a dinosaur like because i we use them but i use them to sort
on to my existing learning profile but it seems like you're just sort of straight lining llms and
doing it in a better way than than i do so what's your process how do you think about that
like i am kind of lazy i enjoyed coding because like it's a puzzle like i i like like solving
puzzles kind of that so but typing was never my thing when like i started there was no llm was i
i did not enjoy typing the code so
so llm part solves that part for me so i use cloud code so it depends on like what i am trying to do
i usually start with plan mode because it is so hard to predict what they are gonna do
so i usually start with plan mode for cloud code like if i am for example like if we discuss like
So...
what i i will do with that is i i will start with plan mode it does not produce any code
with that plan mode it just produces a markdown file so i will go i will discuss the whole plan
with it so if i wanted to build like a sync orm so i will discuss uh like because i did not know
so i i i tell him like this is the repository the django backend and this is uh what i want to build
it like researches the whole thing and i usually have like a cloned django repository in in the
project folder so i say like this is the django repository like tell me like how can i achieve
that thing so it like goes all in and like at the end it produces a plan like what we
want to achieve i read that and if like that makes sense or if i want to change something
because like
once you enter like if you accept the plan and you want to change something
they forget that like they have added a function or class and they are gonna just like create a
new thing so you will have a lot of code that that has no like purpose in there so
that is kind of an annoying part so i usually spend a lot of time planning and stuff um i i
research if like uh i i'm not sure if like the lm is telling something so i i will go and
like read my code myself and like tell it like you are thinking it is wrong or you're like
your hypothesis is wrong yeah stuff like that so
that is kind of the whole process so after that like testing is a whole another thing with llms
like it is i think it is impossible to produce like correct test with llms because they think
like and you are like they don't think like we humans do so like their tests are like
made up things they are gonna test what like they are gonna say it is working but i can see it is not
working so the testing part is a whole another thing i i usually like tell it to like test but
if you remove that git commit the test should fail so that i followed from django so uh like
django i think uh um
i forgot her name natalia natalia yeah he said like if you create a test the test should fail
without the fix so i i took that thing from that so i i like tell llm to like test should fail
but it still produces a lot of bogus tests so that is a very it removed the commit then put
an assert false in the test and goes look the test i think that is like it is a problem with
reinforcement
learning that they too optimize for passing of the test whenever i i will say like create a failing
test for this case it will create a test that is passing but in the like in the in the test it will
have a if condition like it is failing but it will pass the test for some reason so they are very
afraid of like failing tests so i think they are ocd kind of personality they have they don't want
to have a failing test at all that's really interesting i mean there's i i think that's
the way to do it you're you're i think you're i know you're a better user of them than i am but
you have to plan with them in advance and i mean so one of my colleagues uh paul everett he's been
doing a bunch on spec driven development and so basically what you described like having talking
through planning things out and i suppose you're too young to know but the joke is you could never
get a human like a senior software architect to do that so i think that's the way to do it
to write specs for something but now that the llm will do it for you everyone suddenly is excited
about specs whereas they never were excited about specs before so it's forcing maybe good behavior
on humans so there's an irony in there for those of us who are a little bit older
but i completely agree that's yeah i i wonder if there's if we're going to have different because
they're so eager to write code so eager to pass things i don't know if it's a filter or it's a
different retraining but
it feels like they do need to be harsher at least in a coding context right it would i wonder you
know yeah can the companies get there can we get there with better prompts is can some third-party
package come in with a whole thing of like you know how do we get there because i agree it's a
big problem especially around us because in plan mode they don't start to write code and i i tweeted
like uh months some like few weeks ago at claude
like it for some reason it is like very eager to write code like it is very eager to produce a
hypothesis even if like it is a wrong hypothesis like it is very eager to say oh i found it but
it it like it now in whole conversation like it will be say two and three times i found it
but it never found it like it just say i found it but like it it will create a like wrong
hypothesis and it will say oh i found it but it will create a like wrong hypothesis and it will say
hypothesis and like start working on it and after that it will oh i did this thing wrong i but it
will forego to revert to the changes that it made because of that wrong hypothesis so there is a lot
of code that is like uh just uh like unowned code so that is just a junk that kind of lives there
i'll just say one last thing carlton and then you take it um i know from at jet brains and our
ai teams work a lot of times the benchmark is user accepted completion rate so they want their
they want you to say oh that looks good and move on and so i suspect that writing more code or
writing things that pass even though it's not good is better than them like they're not incentivized
to say don't do that right i think you know that sounds simple but i really do think it's it's
almost like i can see like we say oh what's our you know completion rate user acceptance rate
whatever for juni versus claude code versus co-pilot like that's that's the benchmark that
internal ai teams are using which would lead to that behavior i think that is why like it is going
to try always try to pass the test like even if that feature is not complete or not working it is
just going to pass the test which is working hey like congratulations yeah you should be able to
put like a 10x multiplier on removing code right like if you get a point for adding code you should
get a point for removing code right i want that there is no skill uh that cloud code uh creator
introduced simply code simplify i have not tried it uh like very significantly but it is kind of
does that like it it is gonna see the commit that you made for the solution it is gonna go that go
over all the changes that it is it is gonna simplify the code and like try to remove if like
it thinks it is it does not belong i think that is a step in the right direction i think
the difference that i found i find in a human code and an lm code it's also like a viral
tweet the human code is beautiful like everything that it produces it looks like it is like it was
to do that thing the llm code is like a kid coding
is just gonna solve the thing like it is not gonna see like if i'm putting that functions there
why i'm putting there like it should belong to that file or not the a lot of comments that it
adds so like beautification or the beautiful code like uh if you think like a coding as an art
like that is human and if you think like nlm coding that is like a kid coding
like it is gonna solve the task it like it it is gonna solve like solve the issue but like
the code will be everywhere and like stuff like that the difference we can see if like we see a
professional code base like django and a solution provided by an llm so the difference is very clear
there sorry i have one more question um that code simplifying thing from claude i know i think it
was only four or five days ago that that came out but that's that's really interesting so my question
is how do you stay informed about all this i mean because carlton and i like we pass tips on like rss
feed readers because we love to see like blog posts and i feel like we're multiple generations
back like are you on so like what are your news sources to stay up to date i think you also have
that simon wilson newsletter that is that is a very good source and like on i think twitter
part of social media is very eager for vibe coding mastodon is like 180 degrees of that
they don't want like ai in their code so that's where carlton and i hang out with our django
you know graybeards django graybeard i hate this the creator of flask i don't i forget his name
he also did a like poll the mastodon people and the twitter people the poll is like a 180
degree like twitter there is like less than 10 percent of code like llm right and in mastodon
like there is like i think larger than 50 percent code i write myself so there is a difference there
is like the extreme kind of like two things i i kind of believe that like both like any extreme
i don't know the word for that like any extreme
what is the word like that like any extreme thought a person have like any extreme opinion
sorry and any extreme opinion a person have like extreme opinions are never right so the truth will
always be like some something in like in between so if like coding changes it will be like kind of
50 percent you're going to 50 percent at a time then stuff like that i i guess um my question here
is um
it's probably loops back to what you've already said but i think these machines are very good
at creating um stock code you know boilerplate that you've you know seen written 100 times
it seems to me they're less good when you're trying to push the boundaries into something
that's not directly in the training data that's not that's new right and you seem to be doing a
lot of things that are new so how do you how do you find i mean does is it the planning mode
spending enough time in the planning mode helps to pin it down and i think that's a really good
it's like trying different things i ask for like if something is not working i ask for like options
like give me options to solve this thing so it is gonna say like it is gonna be an extreme option
there it is gonna be like something that like that i think like can work so i i will say try that
that is also i think a very good point for llm because we can try a lot of option because the
the
price of code is very cheap that way so if like that thing does not work i i can just like
discard those whole changes so i try different options
the it there is
there is like two extreme uh one time you are gonna say like llm is oh
llm this solution was very intelligent and sometime it is gonna be stupider than a dog
solution is very like stupid it thought something else and produced something else so there is like
extreme cases there so i think we can never like predict llm stuff that makes them dangerous kind
of that way so there will always be human for coding i think there will be less human but there
will always be human somewhere well it's so it's so interesting to think about how your brain is
being wired because for me like i had to think about how your brain is being wired because for
me i had to type everything and you're making me almost rethink the advice i would give people
which is before you start coding make sure you're you're a really good typist because you don't want
any friction between typing and thinking but so for me like if i don't type something this is my
biggest problem with llms if i don't type it it's not i'm missing a pathway in my brain so i'll have
llm code and it part of it is i didn't fully think it through but i think a lot of is i just didn't
type it um and so you're making me wonder maybe that's just a
step leap that the newer generation of people you know won't have that problem like they'll
just be like oh this this is normal this is how i i do things um because i don't know carlton is
that the case for you for me if i don't physically type it it doesn't quite get in there but that's
because that's how i learned it learned how to code originally there's something in that yeah
you were gonna speak to you think that is kind of right because if llm produces a code like the
works but i don't fully understand it 100 like i don't understand it fully so the difference kind
of becomes you have to be a good reader of the code if you like read it and some like and you
will have to because sometimes like because i i was new to rust so sometime it produces like key
words or something like that that i don't understand so there is like a skill to have like
you should have a kind of a way to like you want to learn so if it uses rw lock you don't know
rw lock you should ask it to like what is rw lock if you just become a like um just enter enter
enter like everything except like it just works and stuff like that so that you will not never
like understand like what it it is doing there is a thing like if you code it yourself you
understand it better when i was working for jsoc i i was very aware of that thing so i usually
if i i i used llm i used it for like small commits uh there is a mod in cloud code where you like
you don't accept changes it it just shows you that commit so if uh if
like i uh see that commit i will say like this this is not django standard so rewrite it this
way or like if i wanted to do it myself i i'm gonna rewrite it that way so if you want to
understand the code it is uh like a requirement that you will have to read it and if you type it
then like you will be a better understander than uh just a simple
person that uses llm to just push everything and i'm really interested here where the um
equilibrium point ends up falling in that i'm 100 convinced that you know the person who just
taps yes and accepts you know except they're going to be in trouble they might be able to
produce something very quickly but you know code is more maintenance than it is production
and then at the other end i'm i'm as much as it might pay me just to think i i don't think we can
do every character anymore um because of the just the economics of it aren't going to make any sense
and so between those two extremes that it's got to settle somewhere and maybe there are a range of
sustainable positions that an individual developer could take up but i mean how you find you know how
are you finding in your freelance work that you have to you have to balance these things
freelance work is very repetitive so if like a person comes
most of the people come with a like kind of an mvp of the project so i want or i want
like stuff like that that is already there like solved kind of things so llm is very good at those
like if you tell it to do oath in django it will like does it like 100 good actually kind of so
in freelance work if like problem is something interesting or something
complicated that kind of like a recent project that i am doing it is a like uh
software for ships like uh there is a like a task assigned to people on ships like uh
like ocean ships kind of that so it does not get it like it does not understand it like if a task is
the whole thing is that it does not understand world like ai company says it does like it does not
so if like it it creates a task it like makes wrong hypothesis about the real world
stuff like that so that way you have to guide it like you like uh if a delivery comes a person
have to accept that delivery it is going to put the all the buttons on the top
to accept delivery accept accept accept i i i i saw that because i built that it's like
if a delivery comes i have to see the product and like receive that delivery because that's
how the real world works but it created like every button on the top to accept delivery and
it like it asks nothing like like what is the delivery id what is the like
there is a whole process there is a difference the whole like how the real world works and how
llm thinks it works because i think that this this is the whole context problem also because
if it is working on a small solution it kind of forgets a lot of how the other things work or
something like that so it it has a narrow focus kind of that way so there is a difference if if
like a problem is a kind of real like so we i will have to like or like explicitly say
like you don't want to do that you you have to do this like in this way that's the kind of the
difference i mean i wonder if it's a training data problem too because there's a lot of
authentication examples like how many real world django shipping container options are there like
is there a point where it um and actually that's i'm going to pose you my philosophical questions
to get your take uh are you familiar with the term model collapse have you seen
model collapse
this idea out there um i can describe it it's it says basically that um as the data goes from
being human generated to being computer synthetic generated um there's there was an academic paper
out of oxford uh 2024 showing that over time if you train on synthetic data the llms get worse
right so in my mind i think of it as we know the underlying data is kind of getting worse like it's
even as the models are somehow getting better so but where does that all end up it feels
to me like maybe the whole foundation is crumbling beneath us um but i'm curious what your take is on
that i feel like you're much more in tune with these tools i i watched your video that you made
about i just don't remember the keyword uh so yeah yeah i agree like i agree 100 percent uh it is also
becoming a problem for me i think it's a problem for me i think it's a problem for me i think it's a
race for the benchmarks that they have set up like it is like they want to optimize for those
benchmarks so if like you compare a gpt five point something to cloud code even if like
cloud code is better but like gpt is gonna be like uh higher on the benchmark or something
something like that and the data problem is real like that is also i think that's
that data problem and the architecture problem because like you can say it is agi but it is
just a probabilistic like uh prediction of the next world you can say it is more intelligent but
it will never be it is just a prediction of the next world but like the like people who are like
more intelligent than me but like they're gonna say like your word your brain also predict the
next world so i think it's a problem for me i think it's a problem for me i think it's a problem
but it does not like we cannot explain it like what our brain does but it does not predict the
next world because if i like if i walk on a like an icy road or something i know i'm gonna fall
because i have like fallen when i was four or something so the context of that 20 years is
there with me so llm the
like i agree with that uh your statement like 100 percent the like artificial data part and
like the optimizing for the benchmark part like it is gonna be it is never gonna be like
more intelligent than this is my opinion it is not gonna be more intelligent than
human in like general tasks you can train it for a specific task in specific environment and
specific like in a box it is gonna be more intelligent than a human but if you break that
box and everything's gonna fall like stuff like that carlton you look like no no no i'm just i'm
just nodding away you talked about lack of ideas of causation lack of um decent of proper memory
lack of world models these are the stuff like the criticisms and the the llm architecture has gone a
you know if nothing substantive changes then it looks okay that's a very clever trick and it's a
very useful trick but it's not agi as you know was promised to us by now by lord well let's let's
dodge the agi bullet um i do i think you're right what you were saying though about the the
benchmarks i mean this is something that uh jet brains again i'm just going to read it out they
have a developer productivity ai arena dp ai so they're trying to do an an open stage
standard because right now there are these kind of closed standards for the major models and it
just leads to you know optimizing for the standard right when it's like well who set the standard
what is the standard right so i think there is some work being done there to have something
better that hopefully makes the models better but it's like as complex and intelligent as these
things are it's sort of like we have we all have narrow incentives as humans and as ais so so i
veteran i i use these tools i think okay they're interesting you know but i don't feel that my
career is under threat you're sort of at the other end of your career how do you feel about them i
kind of think like there is a fear like i'm not gonna lie like there is a fear of because
in the world kind of like that we live in um corporates are gonna optimize for the cost that
is like stuff that's going to be used for the cost of the cost of the cost of the cost of the cost of
like that so if i am like if i am trying to get a job in a small city like where i live but i like
there is a fear like in short there is a fear like the whole thing is going to change and
they uh like there will be less jobs but the the thing that is like
i am hopeful like because like i like to learn and like to know stuff so only those people who
kind of have that uh like there are some people who are gonna do computer science just for the job
so there is a difference between uh like a programmer who want to do is for like because
like they love programming and they want to do computer science and they want to do computer
programming and there is a difference because he like someone said it to like computer science is
a good like job or good pay and stuff like that so i think there will be less programmers but
we don't know because the costs now are very optimized and stuff like that we don't know
how much the llm actually cost because like not everybody is gonna be able to like
use them if like something like not a doomer but like something the bubble crash or something like
that so if the cost is gonna be the same or something like that so there is a fear in like
normal computer science student like there there is gonna be no jobs or less jobs well speaking of
jobs i believe are you looking for work is that fair to say or what is your current employment
status
i am looking for work like uh full-time work uh now i am just uh doing freelance stuff uh
i'm open to freelance contract or job anything works for me
i will just put a shout out here having worked with fahan over google summer of code and seen
him in action since he is you know he's a good he's a good find you should snap him up thank you
well we're gonna have links to everything i guess if somebody does want to get in touch
is i'm going to put a link to everything i guess if somebody does want to get in touch
is i'm going to put a link to everything i guess if somebody does want to get in touch
i guess email on your personal site linkedin what is the best way for someone to contact you
linkedin is fine there is also email on the linkedin so like both options are fine linkedin
or email we're basically out of time i haven't asked you about you know static typing and your
thoughts and whether in an llm world everything is pushed that way but um i guess i don't know
is there's i always like to ask uh wait carlton are we doing are we doing book reviews oh i don't
know i've already read a thing wow i've got a project i can mention okay shout out fans that
we haven't mentioned it's django ripple which um oh yeah yeah it's a full django environment in
the browser which is an amazingly built on is it it is typescripts welt on the front end and using
web assembly uh pyridide for the python part pyridide okay pyridide okay but that that's a
super project so um i'm not sure if i'm going to be able to do that but i'm going to do it in the
you know check that out okay so far hand i've really really enjoyed chatting with you and
working with you you know over the last year and i'm so excited for all the things we're doing um
in the django ecosystem so thanks for coming on the show it's been an honor thank you for inviting
me so django chat.com we're on youtube and we'll see everyone next time bye bye bye thanks again to
six feet up the python django and ai experts you call for the hardest software problems
from scaling applications to
simplifying data complexity and unlocking ai outcomes they help you move forward faster