Ollama +Docker+OpenWebUI

Source

1 Ollama

1.1 下载Ollama

https://ollama.com/download

1.2 运行llama3

$ ollama run llama3
pulling manifest
pulling 00e1317cbf74... 100% ▕████████████████████████████████████████████████████████████████████████████████████▏ 4.7 GB
pulling 4fa551d4f938... 100% ▕████████████████████████████████████████████████████████████████████████████████████▏  12 KB
pulling 8ab4849b038c... 100% ▕████████████████████████████████████████████████████████████████████████████████████▏  254 B
pulling 577073ffcc6c... 100% ▕████████████████████████████████████████████████████████████████████████████████████▏  110 B
pulling ad1518640c43... 100% ▕████████████████████████████████████████████████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
removing any unused layers
success

如有需要运行其他大语言模型,访问 https://ollama.com/library
例如要更换为 gemma https://ollama.com/library/gemma ,将运行命令更换为 ollama run gemma
如果要退出,使用以下命令 /bye

2 Docker

https://www.docker.com/products/docker-desktop/
下载安装Docker,注册一个Docker账号。

3 WebUI

https://github.com/open-webui/open-webui

# If Ollama is on your computer, use this 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 ghcr.io/open-webui/open-webui:main

4 查看Containers

在这里插入图片描述

5 本地访问