S12 Bonus: Rickard's Deterministic Return: Converting Scattered Data into Autonomous, Production-Grade Apps with Rickard Hansson, Founder & CEO of Gainable [0:00:00] Noah Labhart: Hello, listeners. We have a special return episode by our good friend, Rickard Hansson. Rickard joined us previously on the podcast in Season 8 to tell the creation story of Weavy, collaboration infrastructure for serious builds. Today, he makes a follow-up visit to tell us all about Gainable, his new project, which removes data and engineering from being the middleman and enables your team to build the apps they need now. Rickard, thanks for coming back on Code Story. Thanks for being on the show again. I'm [0:00:32] Rickard Hansson: happy to be back. Happy to be [0:00:34] Noah Labhart: back. It's been a minute since we talked on season eight when you were building Weavy. But before we jump into our topic for today around Gainable, tell me an update on Weavy. What's happened since we last talked? Weavy [0:00:47] Rickard Hansson: is chugging along. It matured. It's been going upstream with more enterprise focus, like big contracts and big clients. exactly how we covered last time, but we were like competing with Sendbird and Stream and so on and so forth. Very consumerized focus. But during the journey, we've been going upstream and it's doing really well. And I have to say Weavy and Gainable are very tied together. We can dive into that later. I'm using Weavy in Gainable because that's how Weavy is designed to empower other applications and other frameworks and other platforms. So obviously I'm using my own stuff and build a new company. [0:01:28] Noah Labhart: Yeah, absolutely. Okay, super cool. Tell me about how you came to build, to be building Gainable from maybe the Weavy to Gainable story, but I'm curious about the pitch for Gainable and tell me why this is the right approach for AI right now. The [0:01:42] Rickard Hansson: approach we had with Weavy early last year was to empower vibe-coded applications using the Weavy components. Anyone who wants to go back to listen to the season eight episode, just Weavy in a short collaboration components that you can embed in any application. And it's been designed to be very easy to embed and completely self-contained. So it's a perfect fit for vibe coding. I didn't take off because not the right kind of audience, the vibe coders. But I got very intrigued by the fact, okay, so by vibe coding platforms, why back then, and I still think, why do they suck so bad, like they, a couple of prompts in, they start breaking down and why do they build so complicated applications technically wise, when a user like me or anyone else just wants a networking app, it doesn't have to be the perfect React code and so on and so forth. So I started experimenting, like building my own Lovable or building my own Replit on my spare time, which is basically very limited, right? And then that started maturing into a platform with a specific focus and a specific niche. And that was internal tools. Like everything you see right now, I think in the vibe coding phenomena and industry It's very focused on build your next SaaS, be a millionaire overnight, or build a website or something like that. And obviously, you can build internal tooling too, but the infrastructure and architecture doesn't really support it. And I'm really intrigued by internal tools. And I think that's a way bigger market by the end of the day. of code instead of building very complex applications with a lot of lines of code because of code instead of building very complex applications with a lot of lines of code because doing it. So I started building that. And then that matured into a framework or a platform early this year called Gainable. And as I said, it's all about building internal tools. So it's more competing, I would say, with companies like Retool or AppSmith or Superblocks. But it's taking the approach of a vibe coding or whatever you want to call it to get up and running. And when I started experimenting with Gainable, I actually decided to go the opposite direction. Everyone was then bragging about using the latest model out there, Opus 4 or 5 or whatever it was back then. And then obviously they were bragging about like our coding agent just became 20% better. Yeah, obviously because the LLM got better. So you didn't really do anything. Your base prompt is still the same. Your base instruction is still the same. So I challenged myself, like, I want to be able to do what, say, Lovable is doing, but I'm going to use Haiku 4.5, the dumbest model, fast. Can I get that done? So I started there and I got pretty close. But along that way, I realized since AI across the board is probabilistic, right? It's making up shit every time you tell it to do something. It will generate different stuff every time, which coding wise is not great because sometimes it works and the next time it won't. So I started leaning more and more into creating deterministic snap-ins, so to speak. Okay, so whatever Haiku generated, I had to put a deterministic validator on top of it to say, oh, I need to snap these things into place because they're out of order. Make basically fix the jigsaw puzzle afterwards. Like it didn't really put this piece in the right place, but I can see it almost fits. So let me just jiggle a little bit and put it in place. That's what my deterministic approach did. so and then i became that once became more and more of those validators like i basically i have almost a hundred deterministic validators around what the like code is generated right now but then that turned into a compiler so i don't use ai to code i use ai to build a spec that is following a specific format i have it's basically a contract that defines okay now i want you to to draw a dashboard with these gadgets and widgets. And these are the sources I want you to create, and so on, so forth. It's creating a story in JSON format, though. And that is what the LLM is doing. But the coding is done by my compiler. And then the compiler takes over to create the application. Everything from data models to CRUD API endpoints to the actual UI and the widgets and all the different endpoints created. So that means the build takes roughly 45 to 50 seconds. But the cool thing, it works every single time when you build, there's no errors. And it's building in one shot, basically, an application with 8, 9, 10 different views, tell 12, 13 different data models and CRUD API endpoints and so on and so forth, with zero errors in the end. So this [0:06:23] Noah Labhart: is super interesting. And this ties into a point that we've talked offline about the point that you mentioned that AI builders kind of are standing on the models. right? They're waiting for the next release of the models to fix the gaps. And from what you're describing, the model sits earlier in the workflow. Tell me a little bit more about that in Gainable, where the model sits versus the compiler and why is that the right spot for it? This [0:06:47] Rickard Hansson: is obviously my opinion, but so yeah, it's earlier, right? So then also how I design Gainable is you don't prompt to build applications, you give it data. Primarily I would say Excel sheets through Google Sheets. Because when I was talking to my potential clients and I asked them, why are you not vibe coding this? Why are you not Replit or Lovable this application you're thinking about? It's like, I cannot articulate what I want. So I said, okay, so there's an articulation gap. Like vibe coding is phenomenal. You can natural language anything and so on and so forth. And it's great for a person like me because I can code, I can describe a product. But a quote unquote normal person cannot. But I said like, you built this amazingly very complex Excel sheets. So obviously you're not done, right? You can't do stuff, but you can still not bridge the gap between making that Excel sheet or that data point into an application. So what Gainable does, and this is also why it turned out to be more LLM on the edges, is you feed it with a massive Excel sheet, for example, and then the LLM, which LLM are great at, is doing judgment calls, analyzing, finding domain. Oh, this is the CRM. This is sales. This is pipelines. inventory and start analyzing the data and then suggest, do you want to do this? Do you want to do that? And that's where LLM comes into the Gainable pipeline. Upload the data and then Opus 4.8 in my case, right now at least, is analyzing that data and comes up with a lot of IDs. And then you just say, yes, no, yes, no recommended. And then when it has all that information from you and you had a chitchat about it, it creates a data model around that. And then next step is that data model is passed on to the next stage, which is also making decision. But that agent is designing an application, not coding it, not building it, but designing the application based on the data model. So still LLM is not coding anything. And then the next step is creating that contract. So as soon as we're done with the contract and the design, it's handed over to the compiler and LLM gets out of the picture. So when you click build, LLM is doing basically nothing. [0:08:55] Noah Labhart: Okay, so that makes total sense. And it's a really interesting movement of the LLM up the pipeline here. And the engineer in me, I think, knows the answer to this next question. But I'm curious about the deterministic aspect of this. Can you explain why that is important, that having a deterministic app factory, right? Right. Dig into that for me and how this sort of architecture creates that deterministic model. [0:09:23] Rickard Hansson: When the contract is generated, so the contract is probabilistic, right? Because it's going to make up different designs and do different judgments every time you run the same data set through it, and then you're going to get a contract. But the contract's specification, how it's built, that is deterministic. So that means same input in terms of the contract format format is the same in terms of how it's formatted. That means the same output every time. Every application looks different, but how it codes it, how it puts pieces into place is exactly the same every single time. So it compiles like under a second and errors grow linearly, not productively like you do with a model round trip and so on and so forth. So that deterministic approach is what lets me trust basically the first app and the 10,000th app because it's just going to be the same every single time. how that approach works. [0:10:14] Noah Labhart: Okay. So that makes total sense. And then just kind of riffing a minute, that's been my whole thing with AI since the beginning is like, how can you build or how can you build on top of something that's probabilistic? You can't trust that it's going to come out 100% right all the time. I really like how you've structured this approach here. I'm curious about, you mentioned free range coding in some of our emails we exchanged, and I really liked that term. What does it mean? Unpack the phrase for me in the audience. I [0:10:41] Rickard Hansson: came up with that. That was what When I was started experimenting and building Gainable and trying to understand how is Lovable and Replit and Bolt, whatever, designed and what does it do with a prompt? And then when I like, obviously like anyone else, I just throw prompts at it and then you can look at the code afterwards. And it literally are using technology that is designed for teams and not singular and it's designed for seniors and not juniors and so on and so forth. forth. So it's designed like the engineers that build it basically tell LLM, go crazy, use whatever you want, use it however you want. you want, use it however you want. it's trained on Tailwind, for example. It will pick those pieces because that's what it knows best based on the prompt, right? That is what I mean with the free range coding. The problem there is like React is definitely not the best way maybe to build a, let's say, a simple app because it's very, it's, there is like a thousand dependencies for a button. And it's like React was created for an engineering team to be able to work like back end, front end and having small pieces together or working on small pieces separately. But an agent wants to look at one line of code and figure out what is going on here. So that's like, I thought that was just doing wrong choices. And that is if you're throwing them, again, we're coming back to the word probabilistic, right? is the more it can choose from, the more wrongs it's going to do, in my opinion. Like it's going to be more error prone because it can make a lot of choices. And LLMs are also designed to be helpful, right? Because I would argue that OpenAI model or ChatGPT is more friendly and more eager to help than Claude in a good way, because Claude is following your instructions while OpenAI is saying, let me help you a little bit. But that's what I mean. I mean, like it's basically going bananas and using all the coolest things because it's in the base point as well. Not necessarily what is good for the potential output in the end. [0:12:40] Noah Labhart: Good stuff. This is really interesting. Okay, let's move into another topic around AI in general, and that's tokens, right? You pointed out to me that they still appear to be heavily subsidized. What do you mean by that? Tell me in the audience what you mean by that. And what happens to AI products when the subsidized tokens end? It's [0:12:59] Rickard Hansson: been a while since OpenAI did a messy round, but in that, at least some of the public information they can access is you can see how much money they're burning to generate a token basically. And it's way more than they're charging. But it's a race, I would almost say a race to the bottom in terms of finding the clients and build a habit, oh, I want to use OpenAI, I want to use Claude, or I want to use Grok or whatever. So they need to subsidize the tokens because it's very expensive, obviously, because of centers and all the power that is needed. And if you follow that line, for example, without OpenAI around, they did a while ago. If you follow that line in terms of how much their revenue is amazing, but if you look at how much they actually burn, they would basically go bankrupt in 24 months. So right now, it's, again, my kind of opinion, it's like it's creating habits and creating a following around a specific model because you like that more than the other one to the point you are addicted to it in a sense, right? So at some point, all these companies need to switch over to, okay, now we actually have to make at least a small margin on every token generated. But that small margin on every token generated is very much more expensive when it is today towards a client or towards a user. And the user is still thinking it's too expensive. And Claude and Anthropic did a completely different approach from get-go in terms of subscriptions, right? So if you're using Claude Code, you can have a pro, you can have a pro max, and you can do 20x and whatnot. obviously they're limited by a context window but you can basically use it all you can eat but now with fable 5 for example they are turning that off as well you have to switch over to credits they still are giving it away under the subscription model but it's going to go over to credits at some point i don't remember exactly the date because they keep moving it but that is because it is too expensive to drive a i think a sound business on top of the tokens [0:14:56] Noah Labhart: makes sense And Fable 5, I'd like to dig in that a little bit. I got switched off by the government for a while. Everybody saw the headlines. It was a crazy moment to be like, what's going on? Why do you see this as a turning point and not a footnote? I think it connects with what you're just describing. Yeah. [0:15:13] Rickard Hansson: Like that whole debacle is like heaven sent to the open models like GLM, Minimax and QWEN and whatnot. not. I cannot depend maybe on these frontier models because now it's becoming politicized as well. There is obviously someone who can just switch it off. And it was not turned off because it stopped working, right? It was turned off because someone decided it should be. And that's who decided it to be turned off was not the company. They got like subpoenaed or whatever. They got like, okay, if you continue to do this, you're going to be in trouble. And that part is new. and that also like puts, I'm from Europe, so that puts our feet to the fire in terms of, okay, there is not a European model we can lean on. Like it's either China or it's the US. So that shows the vulnerability of the whole industry. So it's definitely not a footnote. It's like a big shift. And the crazy thing, like how they reopened Fable 5 was to prove that dumber or less capable models could do the same thing as Fable 5, right? And how does that make sense? That means the government in the US should then say, okay, you should shut down all the models. That would be the logic aftermath, but they couldn't because obviously that would be too crazy. So who knows what's going to happen in the future with that? But it's definitely making people, I think in my industry, to think twice and look at, okay, either actually create your own models or lean in way more heavy in open models. That [0:16:41] Noah Labhart: makes sense because the model, and you touched on this a bit in our conversations, commodity everyone rents, where's the moat? What keeps people staying on certain models? What keeps people actually using a certain piece of technology if it's something everyone just rents? Can you touch on that a bit? [0:16:58] Rickard Hansson: Back to, for example, my opinion about, for example, Lovable, it's very much just a wrapper on top of whatever model they're using, and you can switch easily between open AI and Anthropic and so on and so forth. But that means the moat is the factory in a sense, right? I talk a lot about Lovable here, but Lovable's moat, I would say, is now they were first mover creators, very strong community and like a good brand and people know about it and a very nice interface. But it's not the end year where everyone is renting the same model by the end of the day. So what, like we've seen it happen already. It didn't disrupt maybe the whole business operations, but Figma make, and then all of a sudden Claude design. design, then the supplier of an AI frontier model that Figma make is definitely using, all of a sudden that supplier decides to say, okay, I'm going to create something that is similar to what you're already doing. You can just imagine or play with the thought that you will have, quote unquote, a lovable experience by Claude tomorrow. That would be bad news, right? For the whole vibe coding industry. Because the end user doesn't care if Lovable Claude or OpenAI, they care about natural language, building something looks good in the other end. This whole thing like switching models doesn't really matter for the end user. But then if Claude says that we're going to do a competitor for half the price, then that user will move in five seconds from lovable to Claude because you will get the same output for half the price, for example. So that means you definitely don't have any defensibility against that because you don't own them all. The engine I'm using got ripped away. And now what do I have? I just have a chassis to my car, but the engine is gone because the creator of the engine created a new car. And now I'm not allowed to use the engine or whatever. It's just very interesting, right? And also I would say it's some conspiracy theories, but people say, okay, Claude and Anthropic is training themselves on things that works. And then they're going to create a vertical that's going to compete. Legora, a Swedish company doing AI for law firms. recently launched Claude Legal, which is basically competing with them. Did they train on Legora stuff? Question mark. Some people claim. So what are these proprietary frontier models actually doing behind the scenes? And the debacle we saw, was it today, yesterday, last, yesterday or something where it came out that Grok, when using Grok, it just takes a whole copy and clone your whole repo and uploads it to its own cloud without telling the user. And so on and so forth. Right. And the reason is this, we keep on forgetting how old is this industry? We're talking what? 12, 14, 16 months? You and I have been in the IT industry forever. It's never moved as fast as now. So obviously business model is going to break. How you use it is going to break and things are going to shift and it's going to be very opportunistic. [0:19:59] Noah Labhart: Yeah, no doubt. Okay, Rickard, I got one more question and it's a general one. I'm curious, where are you taking Gainable next? What is next for Gainable? and how can someone join and get started using the platform? [0:20:11] Rickard Hansson: Next step is actually we're going to launch our own model on that topic. It's very interesting in terms of how you can, whoever's listening to this or into AI and base prompts and instructions and whatnot, and when you do your own model and you fine-tune it, you can basically remove your whole system prompt that tells it to specifically do and then focus only on the output, what you wanted to create, because it doesn't have to think about, you don't have to force it to do things because the base model is not trained for it. And that part I think is very interesting. So that is like one big piece. And that is also because, as I said, like we are focusing on internal tooling. That means we are selling to enterprises, big companies. In the past I've been selling to companies like NATO, Deutsche Telekom, Chubb, you name it, like big IBM and so on. One very important thing for these companies to be able to run it air gap behind a firewall in a private cloud, even on premise. And Gainable is designed to be totally deployed internally behind every firewall, including the LLM. So that is what our own model is going to provide us to be able to do that. And I think that is a major step forward in terms of, because the whole vibe could, I can build internal apps using Lovable, but it's not sustainable. It's not sustainable for a company to to do that for many reasons. And it's not designed for it. You can probably not just containerize lovable and then plunk it into some usage in an idea cutoff office. I'm pretty sure you can't do that. So that is what's on our horizon and I'm focused now and it's really fun. And we're doing actually pretty close to Nvidia. We're doing like we're using their Nemotron open model. Uh, so we're part of their inception program. So we're creating the model on top of that. And that's super fun and interesting in my opinion. And if you want to try Gainable, you just go to gainable.dev. and you ask Gaia, which is our agent, take my Excel sheet and create an application for me so I can invite my team. And then six minutes later, you will have an application that you can invite your team to, and then you can refine and play and so forth. But you can also see it like coming back to the tokens. Like we do not have credits. We don't have tokens. We have flat pricing because of our compiler. I pay in the backend between a dollar, $1.50 to build a complete app from end to end with tokens because the compiler is the key at the core to build the big pieces, so to speak. So the output tokens is very low for us. Well, that was a very long answer to your question, but yeah, that's what I'm looking at, like next steps for Gainable. [0:22:39] Noah Labhart: That's a fantastic answer. The next steps are exciting. And it's a really cool approach you're taking to using AI to build applications based on data in a more effective way and not just more effective, but deterministic. And again, I mentioned earlier, like that's been my big beef with AI since the beginning. And it sounds like you're trying to solve the problem and get people the direct access to applications they need based on the data they have without having to bring in engineers, without building something on top of a specific model that's out there and using AI to build the specs to feed into your compiler to build something deterministically. It's a really fascinating approach. I really appreciate you coming back on the show and telling the audience all about Gainable. notes. But thanks again. [0:23:22] Rickard Hansson: Thank you. Thank you. [0:23:25] Noah Labhart: Rickard is taking a fascinating and brilliant approach to building a deterministic app generator, not based on prompts to AI, but based on data, AI spec building, and a compiler itself. We hope you enjoyed today's episode. If you'd like to check out Gainable, go to gainable.dev. That's G-A-I-N-A-B-L-E dot dev. And thanks again for listening.