The alpha, twice a week
That was 7 min.
Get the best new moments in your inbox every Wednesday and Saturday. It's free.
Check your inbox
We sent a link to your address. Click it to finish signing up. Not there in a minute? Look in spam.
or
Lenny's Podcast · 7 min · May 1, 2025
Cursor built custom models to solve specific product needs
Michael Truell explains why Cursor unexpectedly invested in model development, focusing on tasks where general models fall short.
The episode’s best minutes
Full analysis- 32:01Cursor built custom models to solve specific product needs7 min
- 38:36In AI, the strongest moat is continuing to build the best productPro pick 8 min
- 51:17Cursor learned it had waited too long to hirePro pick 7 min
- 5 more moments in the full episode
“So sometimes it's to serve a use case that a foundation model wouldn't be able to serve at all for cost or speed reasons.”
Michael Truellat 34:27 · Lenny's PodcastTakeaways
- Autocomplete needs predictions in under 300 milliseconds.
- Custom models handle code changes across multiple files.
- Cursor uses models to find relevant code and fill in edits.
About this segment
Michael Truell explains why Cursor unexpectedly invested in model development, focusing on tasks where general models fall short. Specialized models improve speed, cost, and product quality.
Michael Truell is co-founder and CEO of Anysphere.
Co-founded Anysphere and built Cursor into the highest-revenue AI app outside the major model labs.

Lenny Rachitsky, Host · Host, Lenny's Podcast
Spent seven years at Airbnb; his product newsletter has over 1M subscribers.
From “The rise of Cursor: The $300M ARR AI tool that engineers can’t stop using | Michael Truell”, May 1, 2025. Watch the full episode
Thanks. We'll look at and fix what's off.
Transcript
Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.
- 32:07
learned so far about building cursor, building AI products? I think one thing that's been counterintuitive for us, hinted at it a little bit before, but is we definitely didn't expect to be doing any of our own model development when we started. As mentioned, when we got into this, there were companies that were immediately from the get-go going and just focusing on kind of training model from scratch. And we had done the calculation for it to train GP4 and just knew that that was not convincingly what we were going to be able to do. And it also felt a little bit like focusing one's attention in the wrong area because there are lots of amazing models out there and why do all this work to replicate kind of what other players have done, especially in the pre-training side of things, you know, taking a neural network that knows nothing and
- 32:53
then teaching it the whole internet. And so we thought we were, we weren't going to be doing that at all. And it seems clear to us from the start that the existing models, there were lots of things that they could be doing for us that they weren't doing because, you know, there wasn't the right tool built for them. And in fact, though, we do a ton of model development. And internally, it's a big focus for us on the hiring front and have assembled a fantastic team there.
- 33:18
And it's also been a big win on the product quality side of things for us. And at this point, every magic moment in Kerser involves a custom model in some way. And so that was definitely counterintuitive and surprising. And it's been a gradual thing where there was an initial use case for training our own model where it really didn't make sense to use any of the biggest foundation models. That was incredibly successful, kind of moved to another use case that worked really well and had been going from there.
- 33:46
And one of the helpful things in doing this sort of model development is picking your spots carefully, not trying to reinvent the wheel, not trying to focus on places maybe where the best foundation models are excellent, but instead kind of focusing on their weaknesses and how you can complement them. I think this is going to be surprising to a lot of people hearing that you have your own models. When people talk about Cursor and all the folks in the space, they would kind of call them GPT wrappers.
- 34:14
They're just sitting on top of ChatGPT or Sonnet. And what you're saying is that you have your own models. Talk about just like the stack behind the scenes. Yeah, of course. So we definitely use the biggest generation models a bunch of different ways. They're really important components of bringing the Cursor experience to people. The places where we use our own models. So sometimes it's to serve a use case that a foundation model wouldn't be able to serve at all for cost or speed reasons.
- 34:42
And so one example of that is the autocomplete side of things. And so this can be a little bit tricky for people who don't code to understand, but code is this weird form of work where sometimes really the next 5, 10, 20, 30 minutes of your work is entirely createable from looking over your shoulder. and I would contrast this with writing. So writing, you know, everyone or lots of people are familiar with, you know, Gmail's autocomplete and kind of the different forms of autocomplete that show up when you're trying to post text messages or emails or things like that.
- 35:15
They can only be so helpful because often it's just really not clear what you're going to be writing just by looking at what you've written before. But in code, sometimes when you edit a part of a code base, it's just you're going to need to change things and then other parts of a code base and it's entirely clear how you're going to need to change things. and so one core part of cursor is this really suited to bottom complete experience where you predict like the next set of things you're going to be doing across multiple files across multiple places for the file and you know making models good at that use case one there's a speed component of those models need to be really fast they need to give you a completion within 300 milliseconds there's also this cost component of we're running tons and tons and tons of molecules you know every
- 35:55
keystroke we need to keep you know changing our prediction for what you're going to do next And then it's also this really specialty use case of you need models that are really good not at completing the next token, just like a generic text sequence, but are really good at auto-completing a series of diffs, looking at what's changed within a code base and then clicking the next sort of things that are going to change, both deleted and added and all of that.
- 36:17
And we found a ton of success in training models specifically for that task. So that's a place where no foundation models are involved. It's kind of our own thing. We don't have a lot of labeling or branding about this in the app, but that powers a very core part of cursor. And then another set of places where we're using our models are to help things like Sonnet or Gemini or GPT. And those sit both on the input of those big models and on the output.
- 36:45
On the input side of things, those models are searching throughout a code base, trying to figure out the parts of a code base to show to one of these big models. You can kind of think about this as like a mini Google search that's specifically built for finding the relevant parts of the code base to show one of these big models. And then on the output side of things, we take the sketches of the changes that these models are suggesting you make with that code base.
- 37:09
And then we have models that then kind of fill in the details of the high level thinking is done by these smartest models. They spend a few tokens on doing that. And then these smaller specialty, incredibly fast models coupled with some inference tricks, then take those high-level changes and turn them actually into full-code disks. And so it's been super helpful for pushing on quality in places where you need a specialty task.
- 37:32
And it's been super helpful for pushing on speed, which is such an important dimension of product quality for us too. This is so interesting. I just had Kevin Wheel on the podcast, CPO of OpenAI, and he calls this the ensemble of models. That's the same way they work, to use the best feature of each one. And to your point, the cost advantages of using cheaper models. These other models, are they based on like LAMA and things like that, just open source models that you guys plug into and build on?
- 38:00
Yeah, so again, we try to be pretty pragmatic about the place that we're going to do this work and we don't want to reinvent the wheel. And so starting from the very best, you know, pre-trained models that exist out there, often open source ones, you know, sometimes in collaboration with these big model providers that don't share their weights out into the world. Because the thing we care about less is, you know, the ability to read line by line, you know, the matrix of weights that then, you know, go to give you a certain output.
- 38:31
And it's, you know, we just care about the ability to kind of train these things, to post-train them. And so by and large, by and large, yes, open source models, you know, sometimes working with the closed source providers to tune things.