logo elektroda
logo elektroda
X
logo elektroda

ChatGPT locally? AI/LLM assistants to run on your computer - download and installation

p.kaczmarek2 7218 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Screenshot of Open WebUI interface with options for questions.
    It would seem that today`s great AI models are inextricably linked to the cloud, and therefore also to the lack of privacy - nothing could be further from the truth! I will show here how you can easily download and run a 100% locally interesting alternative to ChatGPT along with a confusingly similar form of website offering the choice of the LLM model, chat history and even the possibility of e.g. interpreting the provided images and files.
    All this is offered by a project called Open-WebUI, link to homepage/repository below:
    https://github.com/open-webui/open-webui

    Open-WebUI installation
    There is a "Quick Start With Docker" section in the Readme, but as usual, the installation is actually more difficult than the project authors declare.
    Docker is an environment for running various projects that is characterized by containerization and software isolation, as well as its portability.
    Initially I tried to install Docker 4.27.1 on my Windows 10:
    Screenshot of Docker Desktop 4.27.1 installation showing file unpacking process.
    Unfortunately, it didn`t work - the spoiler explains why:

    Spoiler:

    It would seem that the installation was successful: Installation screen of Docker Desktop 4.27.1 showing installation success.
    We launch...
    Modified Windows Start menu with Docker Desktop application.
    We configure:
    Screen of Docker Desktop 4.27.1 setup completion with the option to use recommended settings selected.
    Login is optional:
    Docker Desktop welcome screen with sign-up and login options.
    And there is a problem, something is wrong with WSL, i.e. the "Linux" overlay on Windows:
    Docker Desktop error message with a Quit button.
    There are several topics on the docker forum about this:
    https://forums.docker.com/t/updating-wsl-upda...-update-n-web-download-not-supported/138452/9
    Below are screenshots of my attempts to fix the problem - without positive results, so no comment:
    PowerShell window with WSL feature enabled on Windows 10.
    Screenshot of a Windows PowerShell window with DISM commands.
    Download progress bar for WSL Update file in the browser.
    Screenshot of Windows PowerShell console with a command to set the default WSL version to 2.
    Screenshot of Windows PowerShell window during installation process.

    To sum up, Open-WebUI did not work for me on the latest Docker, so I started checking previous versions of Docker and it turned out that in 4.24.1 the problem does not occur:
    Screenshot showing a successful installation message for Docker Desktop version 4.24.1.
    Success - we immediately have a docker panel:
    Docker Desktop main panel with the containers section visible.
    Docker is ready. Now you need to download the repository, you can even do it through a browser, GIT is not necessary. We simply find the zip download:
    https://github.com/open-webui/open-webui
    Screenshot of a GitHub page with download options for the Open-WebUI repository.
    Then we install everything via docker, I chose the version without GPU support (everything will be counted on the CPU, RAM will also be required):
    Installation instructions for Open WebUI with Docker Compose.
    Finally a flawless installation:
    Screenshot of a terminal showing the progress of installing Open-WebUI using Docker.
    From this point on they should be open webui in Docker:
    Screenshot of Docker Desktop panel with running container open-webui-main.

    First run
    We run Open WebUI in Docker. Go to create a web service (our local IP + selected port) to see the web interface of the language models:
    Open WebUI login page with fields for email and password.
    The first login to WebUI will require creating an account, but we create this account on our server, everything is local:
    Open WebUI registration screen with fields for name, email, and password.
    Then we are greeted by a web panel like the one known from ChatGPT:
    Screenshot of the Open WebUI interface asking: How can I help you today?
    Nothing can be run at this point - we are missing language models:
    Open WebUI user interface with a model selection option.
    You have to click on the cog and download a model.
    To download a model, search for its name here:
    https://ollama.com/library
    And then paste it into the download as follows:
    Screenshot of the Open-WebUI settings panel with the mistral:7b model being downloaded.
    After downloading, the model will appear in the list to select:
    Open WebUI interface with a dropdown menu for model selection.
    You can ask him questions just like in the case of ChatGPT, the capabilities themselves depend on the model, just as the RAM requirement and the token generation speed also depend on what we have chosen, there are "lighter" and "heavier" models.
    Open WebUI user interface with a query about CSS and JavaScript code.

    Text and code
    Locally running models are able to generate code and complete text similarly to ChatGPT, although the final results depend on the model chosen. Here are some examples:
    Screenshot showing sample Arduino code for reading ADC value and blinking an LED.
    C++ code for controlling an LED using ADC readings.
    The above example with mapping the value read from the ADC to the LED blinking frequency is very similar to ChatGPT.
    Similarly with other codes:
    Browser window with Open-WebUI interface showing a step-by-step guide for creating a WWW page for ESP8266.
    Code sets up the ESP8266 as a simple web server returning HTML content on request.
    He`s done some thinking here - e.g. this link does not lead to an existing page and the code itself is at least incomplete.
    Of course, models are also susceptible to hallucinations - here, for example, a code is created for a non-existent system MCP237017 which was created as a result of a typo I made:
    Window showing Arduino code for non-existent MCP237017 chip in Open WebUI.

    Image analysis
    Some models can also describe images. An example is llava, which can, for example, describe an apple:
    Red apple with a green leaf covered in water droplets on a white background.
    She is not afraid of more difficult tasks - here she describes the LED "bulb":
    Image of an LED light bulb lying on a wooden surface.
    Unfortunately, when it comes to slightly less popular issues, the model gets lost and creates hallucinations:
    The image shows a tool with a metallic head and handle, lying on a wooden workbench.
    If you want me to add an image to this model, please post the image in the topic, if I have a moment I will check the results.

    Advanced settings
    The Open WebUI offers much more than the OpenAI website - here we can change advanced language model settings, such as: Temperature, Mirostat, Top K, Stop Sequence, Max Tokens, Context Length and much more - for explanations, please refer to materials from the Internet.
    Screenshot showing advanced settings of Open WebUI


    Hardware requirements?
    It all depends on whether we use the GPU or CPU version and what model we want to run, but in general it is not very fast, it also takes up a lot of RAM, here`s a screenshot from me after an hour of play:
    Screenshot of Windows Task Manager with 96% memory usage.
    As for the reaction time... we will measure it, for example on Mistral:7b:
    Screenshot of Open WebUI interface showing a conversation about the Roman Empire
    The above response took 45 seconds to generate:
    Screenshot from HWiNFO64 showing details of the Intel Core i7-6700HQ processor.

    Summary
    These free, local equivalents will not beat commercial language models, but they actually provide more than a substitute for the popular ChatGPT locally. Additionally, there are plenty of these models and they offer a lot of parameterization and tuning options, which allows us to adapt them to our needs. In the future, I intend to try to compare them better and explore their possibilities, but I don`t know how to go about it yet and the huge selection of LLMs to download doesn`t make it easier.
    Installing the whole thing is quite simple as long as we don`t fall into the "trap" of the new Docker, but I wrote about it at the beginning, following my instructions we will install the whole thing without any problems.
    However, I don`t know what it`s like to run it on weaker hardware - if anyone wants to have fun, I invite you to test it and share your results!
    Have you tried running LLM language models locally, and if so, what were the results? I invite you to discuss.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 12319 posts with rating 10203, helped 583 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21031745
    dktr
    Level 25  
    I ran Easy Diffusion locally on the GPU - RTX4070 and Core i9 10th. I`m surprised how well it already works and what quality graphics can be generated. A 720x720 image takes approximately 15 seconds to generate.
  • #3 21036351
    Mateusz_konstruktor
    Level 36  
    p.kaczmarek2 wrote:
    If you want me to add an image to this model, please post the image in the topic, if I have a moment I will check the results.

    Something more difficult.
    Close-up of electronic components on a green circuit board, including an AO201F transistor and a resistor.

    Something easier.
    White toaster with two slots and a dial for toast browning control.
  • ADVERTISEMENT
  • #4 21036590
    p.kaczmarek2
    Moderator Smart Home
    Before checking, I will write down my prediction: it will cope with the toaster, not so much with the chip, in the case of the chip it will read the marking incorrectly and write something about the IC.

    Checking:
    White toaster on a surface with two slots and a dial for adjustment.
    As I thought, the second one:
    Close-up of a printed circuit board (PCB) with several electronic components and descriptions.
    Also as expected, but even read well, AD0201F.

    Any other pictures I can check?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21036696
    Mateusz_konstruktor
    Level 36  
    p.kaczmarek2 wrote:
    Any other pictures I can check?

    Especially for my friend, at the same time deliberately not very sophisticated except for the last one.
    Panasonic battery on a beige background with the text Made in Poland. AA Ni-MH 400mAh 1.2V battery on a fabric background. Molex power connector with four cables against a fabric background. Close-up of a 24-pin ATX connector on a fabric background. Two-prong electrical plug on textile material.
  • ADVERTISEMENT
  • #6 21036871
    p.kaczmarek2
    Moderator Smart Home
    Battery, a bit weak, read "Panasonic" but made heresy powerbank:
    Close-up of a Panasonic battery on a neutral surface.

    Here again sense and nonsense are mixed (he read 1539 as 1569 but converted it into a capacity), but he also read NiMH and SANIK...
    SANIK NiMH rechargeable battery with 400 mAh capacity and 1.2 V voltage

    Next are the connectors, but I know they weren`t in the training data, so we won`t discover anything new:
    The image shows a white plastic component with several wires, likely a Molex connector used in electronics.
    Image of a set of electronic connectors in a multi-pin plug.
    Black plug with a white adapter, plugged into a socket.
    Helpful post? Buy me a coffee.
  • #7 21037069
    Mateusz_konstruktor
    Level 36  
    p.kaczmarek2 wrote:
    Next are the connectors, but I know they were not in the training data...

    Do we have these connectors added at this point?
    How is this "training" and adding further data performed?
  • #8 21037092
    p.kaczmarek2
    Moderator Smart Home
    I see that a topic about the basics of LLM in general will be useful...

    A typical user is not able to train LLM, it requires enormous computing power and a huge number of teaching examples. You can read about teaching LLaVa here:
    ChatGPT locally? AI/LLM assistants to run on your computer - download and installation
    https://github.com/haotian-liu/LLaVA
    Quote:

    🔥[NEW!] LLaVA-1.5 achieves SoTA on 11 benchmarks, with just simple modifications to the original LLaVA, utilizes all public data, completes training in ~1 day on a single 8-A100 node, and surpasses methods that use billion-scale date.

    https://llava-vl.github.io/
    Additionally, training requires a huge amount of well-described training data, for example:
    https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/viewer?row=0
    Rather, typical users are forced to download already trained models if they are made available.


    LLM also no longer studies while talking to him. LLM is a mechanism like a "mathematical function", you simply provide an image and text as input, and the output is an answer, LLM does not "remember" other conversations you have had with it. What I have is a model trained by others and made available for free, which I only run locally with different inputs. The only thing LLM "remembers" is the course of the current conversation as long as it fits in the context window.
    Helpful post? Buy me a coffee.
  • #9 21037557
    Mateusz_konstruktor
    Level 36  
    AND.
    p.kaczmarek2 wrote:
    A typical user is not able to train LLM, it requires enormous computing power and a huge number of teaching examples.

    Isn`t it the case that properly selected training examples require a small amount of computing power that is within the capabilities of even a relatively weak home computer? I am thinking of cases such as a transistor in a popular housing photographed in an appropriate way. Generally, the matter comes down to analyzing the shape of a geometric figure?
    I am attaching an example image.

    Transistor in a TO-220 package with three legs, on a fabric background.

    B
    Isn`t there, therefore, a function of sending ready-made results of studies made by individual users to the "cloud", so to speak?
  • #10 21037579
    p.kaczmarek2
    Moderator Smart Home
    It doesn`t work like that at all, the process you are asking about is called fine-tuning and it involves providing additional teaching examples in the format of a photo and text description.
    Snippet of documentation on dataset format for fine-tuning the LLaVA model
    You would have to have, for example, a dataset of transistors.
    Source:
    https://github.com/haotian-liu/LLaVA/blob/main/docs/Finetune_Custom_Data.md
    Video related to the topic:




    The model discussed here can be run fully locally, which means it works without the Internet. I simply downloaded the previously trained model (weights) and the environment to run it and I can run it on my computer.
    Helpful post? Buy me a coffee.
  • #11 21037915
    Mateusz_konstruktor
    Level 36  
    However, I expected some solution analogous to sending information about incorrect operation through the web browser.
    This would be an invaluable source of data, instead of some tedious training on machines that actually require huge computing power.
    In the form presented by my colleague, it is completely resource-intensive and ill-considered, when the mechanism supporting design and corrections described above has already been functioning for many years.
📢 Listen (AI):

Topic summary

The discussion revolves around the feasibility of running AI models, specifically LLMs (Large Language Models), locally on personal computers, emphasizing privacy concerns associated with cloud-based solutions. The Open-WebUI project is highlighted as a viable alternative to ChatGPT, allowing users to download and operate LLMs locally. Installation challenges, particularly with Docker, are noted, alongside user experiences with local AI implementations, such as Easy Diffusion on an RTX 4070 GPU. The conversation also touches on the limitations of typical users in training LLMs due to the high computational requirements and the nature of fine-tuning models with additional data. The potential for user-generated data to improve model performance is discussed, although it is clarified that LLMs do not learn from individual interactions in real-time.
Summary generated by the language model.
ADVERTISEMENT