Transcription
Hello everyone, this is Professor Patterns. And in this video, I'm going to be showing you how you can integrate Kokoro Text-to-Speech to Open Web UI.
Now, this is an incredible model because you're running this completely locally. It runs super fast. So let me give you a quick demo of what it sounds like.
"Waddle the penguin flapped his wings so hard to fly that he slipped on the ice."
And you can see that it's incredibly fast. It's completely free because it's running on a Docker container on my computer. And we're not also sending our voice to something like 11 Labs, right, where, where, um, we're paying for some sort of API usage. And I think that's the best part. It's a completely free local model.
So let me show you how you can set it up. Let's go ahead and get started.
So to get started, I'm first going to go to the Open Web UI homepage here. I'm going to click on Kokoro Fast API using Docker. Now, here I'm going to open this in a new window. And we can see Kokoro Fast API. Scroll down. And once you get to this point here, it says, "All run running the API alone using Docker." This is the one that I want.
Now, there are two versions. I can run this, which is the CPU version, and this is the GPU version. So if you have a computer with a GPU, for example, like a gaming laptop, then this is the one that you'd want to run. And if you just have a regular standard laptop, maybe no GPU, then this is what you'd want to run. The only difference is that obviously the GPU is going to be a little bit faster than a CPU.
Now, I have a GPU, so I'm simply going to copy this command. And then I'm going to open up my command prompt window here. I'm going to paste that command and then run this.
Now, if you haven't logged into Docker yet, then what you would need to run the first time that you're running is typing in `docker login`. Once you do that, it will take you to a Docker login page. You can sign up, log in, and then after you're done with that, you can simply go back in here, type in `docker login`, and you'll be authenticated. Then you'll be able to pull any image from Docker.
So here, let's just wait until this gets done. So that Docker seems to have pulled the image. So now what I can do is go to my localhost:8880/docs. So let's go to that URL, localhost:8880/docs. And then it takes us to this Fast API page. Now, you don't need to worry about this if you're only going to integrate it with, uh, Open Web UI. But for some developers, if you want to maybe go to this endpoint, maybe to test it out, you can run a health check, execute. And you can see that it returns a status code 200. That means that it was successful.
Now, how do we integrate this with Open Web UI? Well, first thing that you're going to want to do is go to Open Web UI and then click on Admin Panel. Next, click on Settings, and then select Audio.
Now, here I have selected or configured the settings already for you. So the first thing that you need to do is change the Text-to-Speech engine to OpenAI. Next, because the Kokoro is running in a different Docker container than your Open Web UI Docker container, the URL that you'll need to go to is `host.docker.internal:88801`. And I'm going to paste the link in the description. And the API key, it's a string. And the string says "not-needed". I'm also going to paste this in the description.
Now, here I've selected a Text-to-Speech voice that's "af-sky". And then the Text-to-Speech model is Kokoro. So once you write all of these settings, you can hit save.
Once that's done, let's go here and then see if it actually works.
"Waddle the penguin flapped his wings so hard to fly that he slipped on the ice."
And we can see that extremely fast at actually running this inference.
Now, what if we want to maybe change some of the voice? Well, let's try going over to Open Web UI. And we can see here that there are a couple of different voices available. I'm going to try "af-sarah". Let's see what that sounds like.
So again, go to Admin Panel, click on Settings, and then Audio. Change this to "af-sarah". And then hit save. Once that's done, I can go back here and then run this.
"Waddle the penguin flapped his wings so hard to fly that he slipped on the ice."
And we can see that we can keep trying this with all of these different voices, um, to see which one we really would want for our purpose and application. It is extremely fast at running this inference. And the best part is that it's completely free. So you're not paying for something like 11 Labs. This is a completely free tool that we are using.
So that's pretty much it for this video. Thank you all for tuning in. Let me know if you want me to cover anything else. And, uh, I'll see you in the next one. Goodbye.