Inhalt 📚 In diesem Video zeige ich dir, wie du KI-Modelle kostenlos lokal nutzen und verwalten kannst. Dazu werden wir uns LM Studio unter Windows installieren. Zudem zeige ich dir, wie du ganz einfach verschiedene Sprachmodelle herunterladen und als lokalen Server starten kannst. #LMStudio#ChatGPT#KI
00:00 | Einführung 00:18 | LM Studio installieren 01:02 | Llama herunterladen 02:00 | Llama Server starten 03:12 | Testen des Servers
(*) Bei den Amazon-Links (https.//amzn.to/???????) handelt es sich um Affiliate-Links. Wenn du etwas über diesen Link kaufst, bekomme ich eine kleine Provision. Der Preis ändert sich nicht, wenn du über diesen Link einkaufst. Vielen Dank für deine Unterstützung.
In this video, I'll show you how you can use and manage AI models locally for free.
To do this, we will install LMStudio under Windows.
I will also show you how you can easily download different language models and start as a local server.
LMStudio is a simple-to-use desktop application for experimenting with local and open-source large language models.
We download LMStudio from the official website lmstudio.ai.
I put the link to the website in the video description below.
We want to install LMStudio under Windows, so we click here in the middle on the button Download LMStudio for Windows.
Then a installation file is downloaded, which we start after the successful download.
Then this overview opens up after a short wait.
If necessary, you still have to fight your way through a classic installation dialog, but I don't think that's a problem for you.
In the overview, there is a search field where you can search for different open-source language models, such as Lama,
which I have already introduced to you in another video that you can find in the video description below.
In addition to Lama, there are other language models such as Mistral, Falcon, and so on.
We just search for Lama again and find it right away.
There are a variety of releases or versions that we can choose from.
Up here you can see whether these models work or not.
The more memory space these models need, the better they usually work.
Since I only want to show you how to download and start language models in LMStudio, we choose this Lama version with only about 2.8 GB size.
Click on Download to start the download.
Down here you can read the current download progress.
As soon as the download has been successfully completed, click on this arrow next to it.
Then this window opens, where you can select a language model and start a server in the background.
You can imagine this from the functionality as follows.
You select one of the language models that you have downloaded and load it into LMStudio.
Then you start a server that runs locally, i.e. only on your computer or in your network,
and this then makes the language model available as a service.
In LMStudio, you can access the language model as with the API from OpenAI.
Then let's just do it.
Click on the drop-down above and select a language model.
For example, I choose this one.
Then click on the green Start Server button.
This will ask Windows whether you want to allow public and private networks access to LMStudio.
We sign up for it and click on Allow.
Excellent. Now the large language model is running in the background.
Down here in the window you can see the logs that are created during the server's runtime.
But how can we access the server or the large language model running on it?
Very simple.
Click on the tab Python in the window Example Client Request and copy the code from it.
If this hasn't happened yet, load the OpenAI library for Python.
Start the CMD for this and enter the command pip install openai.
Wait a minute, now OpenAI?
I said at the beginning of the video that we won't use your API.
That's also true. We only use the OpenAI Client.
We don't need an API key nor do we need an OpenAI account.
This process has the advantage that we can develop apps with the API from OpenAI
and only have to exchange the model through our local model later.
As you probably know, the freely available large language models are not as good as those from OpenAI.
As a user, you can decide for yourself whether you want to use GPT or a local language model from LMStudio.
But you don't have to change the code that much.
So we create a new Python file, which we call for example lama-test.py.
There we copy the code from LMStudio and run the program with the command python lama-test.py.
If we now switch back to LMStudio, we see that the request has actually arrived.
In the Python program, we are shown an answer of the language model.
So that has already worked.
If you are wondering why the AI is presented in rhyme form, let's take a closer look at the code.
Here is a system instruction that requires exactly that and a prompt that requires the AI to introduce itself.
If you want to know how you can program a local AI assistant with it,
then take a look at my video about it.
Of course, I have linked it to you in the video description below.
Thanks for watching and see you in the next video.