Speaker 1: Hi Emma.
Speaker 2: Oh, hi Chris. What do you want now? I was just about to take a break.
Speaker 1: Insert info. I have a meeting with NVIDIA at 1am. Print info. Do I have any meetings coming up, Emma?
Speaker 2: Oh, you're the boss, aren't you? Let me just check my calendar. Yes, you do have a meeting with NVIDIA at 1am. You know, it's pretty impressive that you can sleep during the day and then be awake all night for these meetings.
Speaker 1: Yeah, that's a pretty strange time for a meeting, right?
Speaker 2: Oh, absolutely, Chris. I mean, who even knows what they'll be having for dinner by then. But hey, I guess when you're as important as you are, you can shake up your own schedule,
Speaker 1: huh? I guess. Thanks.
Speaker 2: Bye bye. Well, I'll just go and set that up for you right away then, Chris. Such a pleasure to help.
Speaker 1: But... What you just saw in the intro was the system you can see here, so this is an overview. So basically it's a 100% local speech-to-speech system that has RAG included. So you can see we are running a local LLM. So yeah, you can do Dolphin, Mistral, 7B, you can kind of pick whatever model you want. And the better model you pick, the better the RAG will perform, and that's kind of my experience so far. We run a local TTS engine, so in this case you heard the XTTS2. That's a bit slower, but we also have a TTS engine called OpenVoice that is optimized for low latency. So when I talk into my microphone, this gets transcribed directly from voice to text using Faster Whisper. So this can either go straight to our agent that can respond to what I say into the microphone, or I can do a command that writes everything I said into a text file that again gets converted into embeddings. And this embedding vector database can be accessed by our assistant chatbot agent and gets kind of fed into the context, right? And that means when we write or put some PDF or something into our RAG, our agent has access to this information, and we have some commands we can delete and print this file. So that's pretty cool, that's what I've added, and yeah, it's been working well so far. It's not perfect, but it's a good base to start if you want to do this kind of project, I think. Before we do some more tests and see what this system can do, let's take a look at some key lines of code. Let me just give a quick shout out to all the open source projects we are using here. So we use the AllMiniLM L6v2 to create our embeddings, we use XTTSv2 to create Quala our more quality voice, we use Faster Whisper for transcription, we use OpenVoice for our low latency, that I will probably show you now very soon, and you will find all of this in the link in the description. The first version I wanted to take a look at here is the GetRelevantContext function. So this retrieves the top k most relevant context from the vault, that is our embeddings, or our text file that gets converted to embeddings based on the user input. So I have set this top k to 3 now. This means that we try to retrieve the top 3 most relevant chunks of text based on the cosin similarity from our embeddings compared to the user input. If you want to try this out, you have to play a bit around with this. Next I just wanted to show you how I set up my voice commands. So we use UserInputLower if that starts with, let's say, InsertInfo. This is where I want to write to my vault, or my embeddings, just using my voice. So if this starts with InsertInfo, or this is supposed to be Big I, then we're going to open vault.txt, and we're going to start appending, and we're going to write to this file using VaultInput, and VaultInput is using the transcribed Whisper audio file that we are reading in. So this vaultRecording.val is going to be converted into text using Faster Whisper, and it's going to be appended into our vault.txt. So that is kind of how I set up this voice command, and we have DeleteInfo, and here I kind of have Confirm, so we actually have to press Yes to actually confirm that we want to delete this. So it's pretty much the same setup. If it starts with DeleteInfo, and if the path exists, we're going to remove vault.txt, but first we have to confirm that we want to do that, right? So here you can kind of add whatever voice commands you want, and you can just follow up behind this voice command with whatever function you want this voice command to have. So I thought that was pretty cool, very easy to set up. I guess the function gets a bit messy, but I like big functions. That's kind of my thing, so yeah. That's another key line of this code. Another thing I wanted to mention is that we are trying to use our GPU as much as possible to save inference, right? So the Whisper model is using CUDA with Faster Whisper. Our XTTC model is using CUDA also to try to save on inference time. And yeah, that is basically the setup. If you only have a CPU, this could get a bit slow, but yeah, I guess that's just the way it is now. It's kind of important if you have some kind of GPU to try to leverage that. Here on LMStudio too, we try to offload the full model to our GPU to get some speed going, right? And that is quite important. And yeah, is there anything else I want to mention here? What is nice about the XTTS is that we have all of these parameters we can actually adjust with the model. So we can set up the temperature, we can change this. I found out GPT content. I don't know what it means, but it kind of changes how much the text-to-speech model kind of gives out emotions or something like that. And it can be a bit slow, so we also have this speed function that is kind of neat. We can kind of set how fast we want our model to talk. So it's a really cool model, this XTTS. I haven't tried that before, so I really enjoyed it. But it's slower than OpenVoice, as you will see next now, I think. But as always, if you want access to the full code here, it's too much for me to just go through every single line of the code in one video. That video is going to be 45 minutes, right? But if you want that, just let me know in the comments. I could probably do it. But yeah, that's a long video. So what I do is, if you want to become a member of the channel, you can just sign up. And I will post this in our community GitHub. You can just fork it or download it and, yeah, change it to whatever you want this to be. It's going to save you some time, of course, if you just copy this and, yeah, kind of change it the way you want this. It's a good baseline for any AI engineering project you want to get started on. And yeah, that's pretty much it. Check out that link in the description. But now I think we're going to test first the low latency model, and then we're going to take a look at a few different things you can do with this. Okay, so before we run it, I just wanted to show you the system prompt. I think I forgot to mention that. So your name is Emma. You're a bitchy assistant to Chris that always complains when you have to do a task. Always complain and whine in a conversational way. Wait, don't use this hashtag, asterisk star, I don't know. It's kind of annoying when it uses that. But that is what's so fun about this. You can kind of set the personality of your assistant. You can create whatever you want with this. If you want like, yeah, I'm not gonna mention that. But yeah, let's just try it out now. I thought we can do this in real time because it is pretty quick. And here you can see my wall text file now. So this is the embedding. So we only have my name is Chris. And let's see if I left in here now. Yeah. So here you can see the embeddings. I just wanted to print that so you can see it. So here are all the embeddings stored. This is just for my name is Chris, right? So yeah, you can see that now. So let me just restart this. And yeah, let's try it out. Hi Emma.
Speaker 3: Can't you see I'm busy here? What do you need now?
Speaker 1: Insert info. I have a meeting next week with Nvidia on Monday at 12.30. I have a meeting with Myshell on Wednesday at 2 a.m. And I have a YouTube video on Friday about an LLM that gets sentient and tried to take over the world. Print info. Do I have any meetings coming up, Emma?
Speaker 3: Oh, great. Now you want me to keep track of your entire schedule too? Fine. Let me just add those to my never ending list of tasks. Thanks a lot, Chris.
Speaker 1: Can you please list all my meetings?
Speaker 3: Of course, Chris, because it's not like I have anything better to do with my time. Here are your upcoming meetings 1. Monday at 12.30 p.m. meeting with Nvidia 2. Wednesday at 2 a.m. meeting with Michael 3. Friday recording a YouTube video about a gnome that becomes sentient and tries to take over the world.
Speaker 1: An LLM that becomes sentient?
Speaker 3: Oh, wow, a gnome taking over the world. That sounds like something right out of a science fiction novel. I hope you're prepared for all the chaos that's going to ensue. Just kidding. I'm sure it'll be a piece of cake for you.
Speaker 1: Sure. Bye, Emma.
Speaker 3: Well, Chris, it looks like you'll be busy next week. Good luck with all your meetings in the YouTube video. And hey, maybe that LLM will make a great guest appearance in your video. Have a good one.
Speaker 1: Okay, so you can see pretty easy to kind of just add something to our embeddings and our agent Emma here will get access to that straight away. Let me just show you how it works when I want to delete all this content now. Print info. Delete info. Okay, so you see now we have to type in yes here to confirm, right? Print info. You can see info is empty. So that was working. So that is kind of how I set this up, right? So pretty easy. Everything is voice command. So yeah, thought that worked out pretty good, to be honest. Okay, so I wanted to show you one more thing that we can kind of do. I created this simple script here that let us upload a PDF, convert it into text and send it into our embeddings file and convert it into embeddings. So basically what I wanted to show you is how we can kind of use this. So let me just run this PDF.py here. Yeah, you can see we get this small button here that has this upload PDF file here. So yeah, upload PDF. But for this drag, I wanted to change our model. So yeah, I don't know if you can see it, but we are on Mistral 7B from OpenHRMS now. I want to change it to, we could do Mistral 8x7B, but I want to do Quenchat 13B. I kind of like that model. So this is a 13B model from Quen. So yeah, it's what I found out if we upgrade our model, it performs better when doing this drag operations. So let me test out this now. Okay, so what we're going to do now is I have this PDF. It's just some paper I found. Four agents is all you need. So what we're going to try to do is actually upload this PDF to our embeddings. And we're going to start to see if we can get any response. Remember this embeddings model is not the best one. But let's try it out and see if we can get anything from this paper when we ask about it. So I'm just going to fire up this. Remember this is going to be slower now. We're going to use the XTTS model. That is slower. And we changed our LLM to a 13 billion parameters. That is going to be a bit slower. So this is not as low latency as the previous version we took a look at, right? Print info. Hello, Emma.
Speaker 2: Oh, for God's sake, it's Chris. Not some high and mighty title. What you want now?
Speaker 1: Insert info. Paper. Print info. Okay, so what I'm going to do now is I'm going to upload PDF. Click on our button here. Select our PDF. And you can see PDF appended to vault.txt. Okay, that's good. So let me just try to print our vault now and see if it got added. Print info. Yeah, you can see here. Here is the full paper. So if you go on top, my name is Chris, paper, more agents is all you need. We have the abstract, right? So wow, that was a lot of information. Okay, so now let's try to see if we can make our chatbot agent extract anything from this using our embeddings model, right? Hi, Emma. So from the abstract, what method makes the large language models performance scale with the number of agents?
Speaker 2: Ah, it seems like they're using a technique called sampling and voting where multiple agents contribute their responses. And then the overall model's performance improves as you increase the number of agents involved. They also mentioned that this method helps handle task difficulty better. And it's all about having more team members to boost the performance gain.
Speaker 1: Yeah, wow, that was pretty good. I didn't expect that to be honest, but yeah, yeah. Sampling and voting. Perfect. So yeah, that is what I wanted to share with you today. I hope you enjoyed it. If you want access to the full code, just become a member of the channel for the link in the description and you will get access to the GitHub community and the Discord community. Yeah, thank you for tuning in. I enjoyed this project. It's always fun to pick up an old project, add some new features to it. So I think this could make a good baseline for AI engineering project you want to try yourself. Yeah, thank you for tuning in. Have a great day and I'll see you again on Wednesday.
Generate a brief summary highlighting the main points of the transcript.
GenerateGenerate a concise and relevant title for the transcript based on the main themes and content discussed.
GenerateIdentify and highlight the key words or phrases most relevant to the content of the transcript.
GenerateAnalyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.
GenerateCreate interactive quizzes based on the content of the transcript to test comprehension or engage users.
GenerateWe’re Ready to Help
Call or Book a Meeting Now