DEV Community

Tanguy Chénier
Tanguy Chénier

Posted on • Updated on

Get the ChatGPT equivalent in less than 5 minutes with Ollama and Open WebUI

Introduction

In this tutorial, I will show you how to install a graphical interface equivalent to ChatGPT on your PC, using Ollama, without requiring an internet connection after installation, while maintaining complete control over your data. This guide is compatible with all operating systems (Windows, macOS, Linux). I'm going to assume you are familiar with using a terminal and docker.

Open WebUI ?

  • Open WebUI is an extensible, feature-rich, and user-friendly self-hosted WebUI designed to operate entirely offline. It supports various LLM runners, including Ollama and OpenAI-compatible APIs.

Ollama ?

  • Ollama is an open-source project that serves as a powerful and user-friendly platform for running LLMs on your local machine.

Let's start

Step 1: Docker

  • Download Docker and install it. Then, launch the application.
  • docker

Step 2: Ollama

  • Same process as Docker, this time with Ollama.
  • Ollama

At this stage, you can already use Ollama in your terminal.

*For Windows Users:
2.1 : WSL

  • Install Windows Subsystem for Linux
  • WSL

2.2 CUDA

  • To use the GPU, install CUDA
  • Cuda GPU WSL
  • if you need more information about cuda in wsl, you can check this link

Step 3: Install a Graphical Interface with WebUI

To have a user interface, run the following Docker command:



docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always https://github.com/open-webui/open-webui/pkgs/container/open-webui


Enter fullscreen mode Exit fullscreen mode
  • It will run as a docker image, open webui.
  • If you want to learn more about Open WebUI, especially if you want your model to use your GPU, change port, etc., you can check this link on the GPU section support.

Additional Notes:

  • Change the port if 3000 is already in use on your machine.

What's next?

  • run in you web browser : http://localhost:3300 (or your replacement port)
  • Now, you can go to Settings > Models > Pull a model from Ollama.com. Set it as default, configure it, provide instructions before starting the conversation, etc.

Open WebUI parameters

  • Example, you can put llama3 as model tag, then download it, to use it.

Conclusion

You now have everything you need to start using your own instance of ChatGPT like with Llama3, Mistral, and others. You can continue to download and configure other models as needed, such as multimodal models capable of reading PDFs, performing image recognition, etc.

Top comments (0)