labnotes

Open-WebUI to use ollama

have a nice little command center

tags
ollama
open-webui
docker

From the website:

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, making it a powerful AI deployment solution.

Lets get going!

Startup script

Make sure that you have ollama and docker installed.

This will start up a transient container than goes away once you stop it. Useful for testing and not leaving a whole bunch of junk laying around your computer.

1
2
3
docker run -it --rm -p 3000:8080 \
         -v open-webui:/app/backend/data \
         ghcr.io/open-webui/open-webui:main

I like to put it into a script, so you can fire it up on the command line. When you kill that process, the container will remove itself.

If you want to have the latest version

1
docker pull ghcr.io/open-webui/open-webui:main

And restart.

Open the UI

First thing you need to do is to create an admin account. This is for local stuff.

Once this is done, you can see an interface similar to the gpt interfaces we all know and love.

Chatting with multiple models

One fun trick while evaulating models and prompts is to run completion over multiple models. Create a new chat, then select a model at the top. Use the plus sign to add additional models.

The models will be run in turn and you'll be able to compare all the results next to each other.

OpenWebUI community

It's worth creating a OpenWebUI account to be able to build off of other's work.

Custom model with tools

Lets go through the process of adding a tool. Go to keyless weather, and press Get. For the url, put in http://localhost:3000 and import it.

Then go to workspace -> models -> create. I'm calling it weather, based on llama3.2:latest, and then select enable the tool you jsut selected. Save it.

Head over to a new chat, select the model, and then ask it what the weather is in a specific location. For example

whats the weater in nyc next wek

And you should see a response, with the tool called out at the bottom.

… To summarize, the week ahead in NYC will see mostly clear skies with some cloudiness, ranging from temperatures of 21.7 °F to 31.5 °F.

TOOL:weather/get_future_weather_week

There's a lot more to explore, but this is a nice little start.

Previously

fragments

Unnecessary Knowledge

keep it lean

tags

Next

fragments

Tools I like as an amateur

tags