Hi everyone, today let me show you how you can use your Kimik K2's model directly inside code. Well, code is great but it is expensive too. On the other hand, we have Kim K2 which is 85% less expensive and offers similar kind of performance.
So without wasting any further time, let me show you how you can integrate your Kim K2's API directly inside code and write some code. Well, this is code load and if you haven't installed it in your system, make sure that you install using this command right here. So, you need NodeJS 18 or for this work and let me show you what Kim K2 is.
So, this is the Kim K2 where you can chat and do whatever you want. It is claimed to be as good as OpenAI and anthropic. This is one of the project that I'm working on.
So I initially started this as a review for Ko the ID that recently got released from Amazon but it was not that great for me. I don't believe or I don't think that Ko give me a good experience. So far I've been in pain using that because it it is not giving the right kind of things that I want.
Let's see if the APIs from Kiny can understand what exactly this is. That's what they try to do. So just open the terminal, type the command cloud.
Now we have the code load on our terminal. Currently I don't have any balance in my code account. So I won't be able to trigger any commands or anything right now in this uh session.
So let me give a high and let's see if it is working. See it is not working. It is asking me to add some funds.
So what we are going to do is I'm going to use moonshots Kim K2's API and I'm going to chat with this tool. So the first thing that you should do is go to the console. This is platform.
shot moonshot. ai console API keys. So once you have recharged your your account then the first thing that you have to do is create an API.
So give some name called clo default. Okay. So make sure you copy this before closing it or else you you you will have to create it again because you you can't edit or take this back once you do it.
So just copy it. Now the next thing that you should do is come out of this code. So Ctrl C.
Now I'm out of code. So we have to run few commands and we have to add our nonshots API key into. So right here we have to edit the base URL.
So currently in the system it will have anthropics base URL. So what we are going to do is we are going to edit it. We are giving moonshots base URL.
So API. shot. com/anthropic.
This is the API. Then we also have to give the API key that just we created. So these are the two things that you have to do.
Now copy this and paste this in your now it can start. Now all you have to do is run the float command both concrete both anthropic. Okay, for this what you have to do was come out of this and you have to use onset.
Now let me run the code again. Okay, now this is working. So now it is deing me.
So so we have added the base URL and we have given our o token API. Now let's ask what is this codebase all about. So let's see.
So like I said this was a code base that I created for Kirao try to create a Mario game using Typescript. So this has well told us the same a typescript based web game that recreates classic Mario game play. It includes or game engine with physics uh levels games states Mario character with movements audio system.
These are all the thing that I was trying to create with KO. So which means currently it is not hitting on anthropics base URL. It is directly hitting Kim K2 and we are making use of Kimik K2 trick.
Now let's try to create something else. Okay. So, so now let let me try to create a landing page or something using kin k2 in a different box.
For let me open a new folder. Let's create a new new folder for test and create test lab. So each time you take an instance you have to run this command.
So we have an we have a shortcut which can you can do it all. Okay. Okay.
Now let's try to create a landing page for my personal portfolio. So okay we'll just give the prompt create a language external CSS I'm a software engineer creator make it our vibrant and bottom page so that it's all All right. Now the coding part is done and the agent has created index.
html script. js style CSS3 file. So let's see how this looks.
All right. So this is the landing page that KK2 API just created for me. So it looks great.
So software engineer and a cond creator. So what do you think about this UI that just Kimik to give me? How much would you rate for this one?
I can replace the name here soft edge here on creator and we have side animations behind. Well, all these are great. So I'm quite impressed with the UI and this landing page that Kimmy and Clo just gave me.
Now let's get back to this. Well, all these are great. There is a small problem that we'll encounter if we close this terminal.
Suppose if we close this terminal. Now let's close this door down. This terminal is closed.
Now if we open a new terminal and trying to run this code command on new session the problem is the base URL and the O talker would get reset or get default to the anthropics. So it is kind of hard for you to run this command over and over again. Right?
To come out of this inconvenience, we can create a bash rc file and we can write a function where we give these commands. Then you just have to call that function each time instead of running all these command again. So let me show you how we can do it.
So let me go to the pies. Now if you look at here you can see there is a bash rc file that I've created. In that I created a function named kim and in that function I've given these three commands export anthropic base URL where we give the URL then we have anthropic API key or you can use for token that was what I use and then you have the third command.
So you give this one and see. So instead of running this export command again and again, the best thing that you can do is create a bash rc file or zshrc file and add this into your home directory and call this command. This is all you have to do.
So first create this bash rc file then write all those commands that we have. Now we have created this. Now I have to copy this.
So we have this here. Now I'll copy this and I'll go to my hall. So this is my home and paste it right here.
Now what you have to do is open terminal. Now run this command source bar rc. Now that is that is about source.
Now the name of the function that we have given in the bash rc file is kim. So just call that. Now in the background what it did is it run all these command at once.
Now you can just ask hi. So it is giving us the reply. So which means it is working.
So I'll ask again what what this cordbase is all about. What is this? We have the details right here about this this cordbase which means all these things are working fine.
You would just have to create this bash rc file and keep it in your hornbear tree then all across your repositories you just have to source it from there and it would work. So you don't have to run this export command with token and base URL over and over again. Well, that's how you add your Kimik K2 API directly inside code and just use it as usual.
Well, the experience is really great and it just involves few steps to follow while you get something that's really affordable. I hope you guys enjoy this video. Let me know in the comment section what do you feel?
Will you choose Kim K2 or just go with Clo. Till then, this is Casi Joseph signing off. Bye.