Full transcript of “Claude Code Wasted 100K Tokens. Pi Did It Better on Local Gemma 4”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.
0:00 It's so obvious that it has taken 100,000 token lesser comparing to the cloud code agent. This is crazy. [music] I mean, I was mind-blown to see how this particular coding agent is really behaving. You see that it is really really instant already. So, it's doing it really faster already. Look at that. It's getting the information. Tech stack, it has found it [music] and it's just going through going through getting all the information. And the fan, to be honest, at this point of time is not even running for me. It's just so cool. This machine is not even using its full power at the moment and it's just keeping the machine really really cool. This is pretty amazing. Hi guys, welcome back. Today, in this video I'll be talking about what is called as an pie coding agent. So, pie coding agent, if
0:45 you have heard about like GitHub Copilot or Cloud Code or the Codex CLI, all of these are coding agents and they are quite popular. We know about it. We are using it. But this pie coding agent, it looks to be like a new coding agent, but actually, if you are someone who is familiar with the Open Claw, you might have heard about how powerful the personal AI assistant is all about. Well, actually, that personal assistant is also powered by this pie coding agent behind the scene. So, if you go here in the Open Claw website over here, you can see that Open Claw integrates with the pie coding agent at its sibling packages like pie AI, pie agent core and pie TUI to power its AI agent capabilities. And
1:30 this is so so powerful. So, essentially, pie coding agent was so powerful that it actually powers a lot of things that even with a local large language model, you can see its power already. Because the number of tokens it actually uses is way way more lesser compared to Cloud Code or the Codex CLI or GitHub Copilot CLI something like that. So, I have actually tested it with my machine, especially with the the QN 3.6 model as well as the Gemma 4 model and I've seen that the actual performance of the pie coding agent is way way more ahead than compared to these Cloud Code or the Codex CLI that I'm talking about. Because the reason is the pie coding agent actually has got only only four tools. One is the read
2:16 tool, write tool, edit tool and bash tool. So, it only has got four tools in it and rest of things are all controlled by the pie coding agent itself. And the most important thing that the author of the pie coding agent has deliberately made is that the pie coding agent will not support MCP toolings at all. >> It has four tools, read a file, write a file, edit a file and bash. Bash is all you need. What's not in there? No MCP, no sub engines, no plan mode, no background bash, no built-in to-dos. So, it won't support the MCP server which other tools these days supports and the author feels that the actual coding agent goes super slow because of these MCP servers and stuff. Instead, you can actually build every single thing with
3:03 the pie coding server agent itself without you having to have a separate MCP server for doing that. And all of these capabilities you can achieve within the pie itself. And the most important thing, as you can see in the GitHub repository that the author has told over here is that if you want to extend the pie coding agent's capability, you can actually use some skills. So, if you're just going to go to the bad logic and go to the pie skill over here. So, Mario has mentioned that these are the skills that you can use if you wanted to. So, some of the some of the skills are like the brave skills, browser tool, GCCLI, GDCLI and transcribe, VS Code, YouTube transcript. These are really really amazing. I have actually tried all these tools in my local large language model itself and it
3:49 just works like amazing. And this is super super useful. And that's exactly what we are going to be talking about in this particular video. We are going to be comparing the Cloud Code which is running in my local machine in the local large language model which is the Gemma 4 model versus the same model with the pie coding agent and we will see how performant the pie coding agent is the number of tokens it actually uses it. So, without any further ado, I'm going to quickly show you how we can configure the pie coding agent to use the model which is running within my LM Studio over here. And I'm also going to show you how we can run the same model with the Cloud Code as well as the pie coding agent. So, over here, I'm just going to open the pie coding agent. So, I'm going
4:35 to say pie and this is this model dot JSON file under the agent. So, let me just show you how it's going to look like where I have set the provider as LM Studio here. And you can see that the base URL is going to be the base URL of my LM Studio. This is the API key and this is the model which I'm using, the Google Gemma 4 26 billion A4B which means it's an active 4 billion parameter M E model that I'm actually using which is running in my MLX because I'm actually using the Apple M5 Max machines. That's what I'm actually using it. So, it accepts input of both text and image over here. This is what I'm actually setting up with the pie coding agent for my setup over here. And I'm actually going to do the exact same thing with my Cloud Code as well. So, I have got the application which is the EA
5:22 app application over here. So, if I'm going to show you, it has got some files over here. And if I'm going to be asking some question about this particular code with my Cloud Code. So, let's go on take the smallest code first and then let's go with the bigger one. So, I'm going to go and set the the Anthropic base URL as the local host and the and the token is going to be the LM Studio. So, I'm basically using the same LM Studio URL for the Cloud Code. And I'm also going to open the Cloud with the model as the Gemma 4 26 billion parameter model over here, right? So, this is what I'm actually using it. And you can see within my LM Studio over here, I have also started the LM Studio
6:09 with the server settings over here with the Gemma 4 model as well. And this is the context I have given over here as you can see, it's quite high to be honest. And this is more than enough for my coding agent to handle it. And now what I'm going to do is I'm going to ask the similar question for both the Cloud Code as well as pie coding agent. I'm going to ask, can you check the repo code and tell me what it contains? You can actually see the time. I'm I'm not even running this video or something like that. It's all just my hands are out. I'm not even editing this particular video at this time. So, this is the total time it is actually taking to get the information. You see that it's running in background. It's doing some operation
6:55 and it is trying to get hold of some information as you can see over here. It is definitely taking some time. And I I just started to hear my machine's fan sound already. So, there we go. Yeah, it's just starting up right now. The Apple M5 Max 128 gig of RAM. You see that even a small question that I asked, it took so much time right now. It feels like it is not really so much time because it's running in my local machine. I'll actually show you the pie coding agent and then you can see how fast the pie coding agent is all about. And then I'm going to say, if I am going to change the back end to SQL server running in Docker container,
7:42 what effort it takes? So, um my wordings will change because I have not recorded the prompt anywhere, but I'm going to ask the same exact question to the pie coding agent as well. So, I'll just show you how that's going to behave over here. Yeah, this time it is bit faster as you can see. It's working as expected. Even though it's running locally, you can see that it is really really faster. And we have got the answer in 20 seconds and the other answer that we got was somewhere like 57 seconds. So, almost it took like 1 minute 20 seconds, right? So, now I'm going to see the usage over here like how much tokens been spent. So, for this two question, we have spent around 113.4
8:28 thousand token. This is the total token that that is being spent over here. So, I'm going to probably copy this thing. I'm going to open the Cloud and I'm going to ask over here. I'm comparing Cloud Code coding agent and the token which was spent for my two call was this one. Now, I'm comparing the same with the pie coding agent and the pie spelling is wrong which is this one. So, I'm going to paste the particular output right now. So, the fan is already cranking in my machine for just these two questions, right? And the reason why this is happening is because actually these coding agent spends a lot of tokens just
9:13 for a simple tasks as well. And that's the reason why the author of the pie coding agent, the Mario, who has actually completely rewritten the coding agent in such a way that it spends so less tokens comparing to what these kind of broad coding agents really takes which is, to be honest, pain. So, now I'm going to completely close this Cloud Code over here and you can see that I'm going to use the same coding agent model which is going to be this one, the Gemma 4 model for my pie coding agent as well. And I'm going to start pie. So, I have installed the pie coding agent within my machine. The installation is not really hard. That's the reason why I'm not even showing you. In order for you to install this pie coding agent, just do do This is the command that you have to do. If you're going to be running the Pi uh
9:59 the NPM, you can just do this one. This is the NPM command that I actually executed to install uh the coding agent in the global space. That's why I can access the the Pi package from anywhere. So, this is just an NPM package, to be honest. And I'm going to be running this one. And as you see that immediately the Pi coding agent is there. And it has got some skills, as you can see over here. So, I have installed all the skills that I was showing you uh in this particular GitHub repository. In order for you to install these skills, you have to just do this command. Uh get clone of this particular repository, and the place where you want to hold or place all these skills. So, this is the place where the skills are really sitting. So, you can just run this particular command alone. It is going to be doing it for all the projects. If you want to uh project-level specific skills, then you
10:44 can also do for a specific project that you are working with. So, that is how this uh command that you're going to be running it, right? So, I have executed it, and I have got all the skills over here. That's why you're seeing them all. And uh the skills can be used or may not be used. That doesn't really matter. Now, I'm going to ask the same exact question. Can you explain me what's in this uh code repository? Uh maybe my wordings are changing right now, but I will see if it is going to explain me properly there. And you see that it's done already. Do you see how fast it is? That was actually taking like 57 seconds to complete it, and this is actually taking I don't know, maybe like less than 5 seconds to complete the entire operation. And it's showing the exact similar detail that you were seeing over
11:31 there. Same model, but the only change is the coding agent is changed over here. The token spend is 10,000 for now, right? I'm going to now say, "What will it take to replace the back end from SQL Server, which is running inside Docker container, right?" So, I'm going to ask the same exact question. So, let's see how this is doing. Do you Do you see that actually it's looking like it is running on a cloud model, and this is so fast, and it has already completed it. Now, I don't even have to show you. The total token it took is just 15,000 token, as opposed to 115,000 113,000 token that it was taking over here. So, we don't even need a
12:16 cloud desktop to compare this. This is so obvious that it has taken 100,000 token lesser comparing to the cloud code agent. This is crazy. I mean, I was mind-blown to see how this particular coding agent is really behaving. This is, to be honest, amazing. And it is on par with the cloud code that is working. I mean, in terms of the speed, to be honest. But, we can change the model, and we can see how fast they are. It is really really mind-blowing, as well. Well, as that said, this is the Gemma 4 model, uh and this is working pretty amazing. And now, you may be thinking, "Karthik, see, this particular code that you have got is a very very small super small code uh code base. So, what if you have a larger code code base, and how you actually are going to be doing that?" So, I'm actually going to show that one, as
13:02 well. So, I'm going to go take um an application called as the Execute Automation site, uh which is which is, to be honest, fairly uh a bit more bigger project than comparing to this. So, if I'm going to go to source, and if I'm going to do LS, you can see that it has got a lot of component. And if I'm going to show you all of these packages, it's definitely very very bigger. Which is which is the the public site that is running the Execute Automation right now. So, if I'm going to ask Pi coding agent to do this one, the like analyzing this particular uh code base, so I'm going to say, "Can you analyze the code of this repository?" So, if I'm going to do that, you see that it is really really instant already. So, it's doing it really faster already. Look at that. It's getting the
13:49 information. Tech stack, it has found it, and it's just going through going through getting all the information. And the fan, to be honest, at this point of time, it's not even running for me. It's just so cool. This machine is not even using its full power at the moment, and it's just keeping the machine really really cool. This is pretty amazing. And the tokens uh this time is 33,000 tokens, as opposed to 10,000 token last time, which is fine. And I'm going to ask, "What will it take to completely rewrite the application uh UI to more um modern approach uh like um maybe um maybe Facebook UI. I don't know,
14:36 maybe the the Facebook UI is better or not. I've been I haven't been using this for a while, but let's see what it is going to tell to me right now. So, you see that it's going to go through every single page, getting all those information, and it's just giving me a road map, and it's just getting me that it's just 49,000. See, I'm not even doing any implementation at this moment. I know that, but you see how faster it is already doing it in my local machine. This is amazing. And now, if I'm going to quit this completely, see the fan is completely not running. I'm really honest with you. And right now, I'm going to open my cloud code uh right now. So, let's see our cloud how this is going to behave. Now, I'm going to see um yeah, even this the cloud code while it opens, it is just hanging for me there. Um cool. Can you
15:22 explain me what is uh there in this uh repository? So, I'm going to ask the same question over here. So, let's see how much time it takes. It took 33,000 token for the first question about the same exact question that I was asking with our Pi agent, uh and it was really faster, as you saw that. But, now let's see how much time this is going to take. There we go. Now, finally the UI has surrendered for some reason. It was not even coming for me before. Fan has really started by this time. It has started picking up. So, maybe I can actually show you the activity monitor, as well, like how much it is using the memory. It's 112, but I have not showed
16:09 you how much memory it was using while I was using the Pi coding agent. So, it really doesn't compare uh like a like a true comparison. But, guess what? The fan is already cranking. It is cranking. Uh it got the responses finally. Uh 51 seconds. And I'm going to ask, "What will it take to completely revamp uh the UI of this application to Facebook UI um style?" Over here. So, let's see how much time it takes. And I'm going to show you the tokens being spent. So, it was 33,000, and then it was also like the total uh token was around 55,000 or 60,000. Uh I
16:56 think 55,000, give or take. But, let's see how much token this guy, the cloud coding agent, is going to be spending. And oh my god, my machine is just getting warmer now. This is going going going. Come on. This time, for the first time, I'm not editing even a single part in my video. I'm just waiting for this to complete, because I wanted to show you how things are. 35 seconds. So, I'm going to do any usage right now. So, the total token is 130,000 token. Look at that. This is crazy. This is the reason why I'm telling you guys the Pi coding agent is really amazing. And the good thing about the Pi coding agent, it is only has four tools, and these four tools are more than enough to do most of your operations. So, you can create MCP
17:43 server if you want the same kind of abilities. You can create with the uh Pi coding agent itself. It will do it for you, like how you do with the Open Cloud. Even in Open Cloud, you don't have MCP support out of the box. You need to use MCP order to make the MCP support for that. Uh but, even in the Pi coding agent, you don't have the support, as well, which is all pretty amazing. So, these are the things that Pi coding agent is really really interesting. And there's also a new release of the Pi coding agent, which the author was quite excited about. I think the release was in 0.71.1, where they have added the WebSocket caching to uh to the transport setting option to the OpenAI Codex provider used in with ChatGPT subscription auth. This keeps the same WebSocket open for the session, and after the first request sends only
18:28 the new conversation item, instead of resending the full chat history when possible. So, this is quite an uh performant improvement, especially for the OpenAI Codex providers, because it's not in my local machine. I'm really not really going to be showing you this one. But, this is a new feature. There's also a new feature again in point 72.2, released like 6 hours before. So, I'm not trying these out these features, but Pi coding agent, to be honest, it's mind-blowing. So, that is guys. That's all about how you can use Pi coding agent, and run them within my local machine, and how you can compare uh it with the cloud code, and how amazingly faster Pi coding Pi coding agent is all about. So, that's it, guys. Once again, thank you so much for watching this video. Catch you in the next one.