> 技术文档 > 使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练


本地搭建AI模型

  • 说明:
  • 1、下载Ollama
  • 2、下载模型
  • 3、pip安装open-webui(不推荐)
    • 1、Python版本不对应
    • 2、下载wheels失败
  • 4、docker安装open-webui

说明:

在windows上搭建本地AI,使用Ollama+open-webui的方式,可以直接在网页上访问
参考连接:
Ollama的github地址: https://github.com/ollama/ollama
Ollama官网地址: https://ollama.com/
open-webui地址: https://github.com/open-webui/open-webui
AI模型: https://ollama.com/library/
python仓库 https://pypi.org/
docker官网下载:https://www.docker.com/

1、下载Ollama

github地址: https://github.com/ollama/ollama
官网地址: https://ollama.com/
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
双击运行安装
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
打开http://localhost:11434/查看运行状态
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

2、下载模型

查看可下载的模型: https://ollama.com/library/
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
点击进入后,复制命令行
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
打开电脑的命令行工具,输入命令下载模型

win+rcmd输入命令行:例ollama run deepseek-r1

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

3、pip安装open-webui(不推荐)

地址: https://github.com/open-webui/open-webui
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练可以直接使用电脑上的pip安装

pip install open-webui

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

1、Python版本不对应

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
需要3.11以上版本的python
进入官网下载:https://www.python.org/ftp/python/3.12.0/
选择对应版本下载并双击安装
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
设置环境变量
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
验证配置成功,再次下载–》成功
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

2、下载wheels失败

可以通过手动下载的方式,再用pip install安装。找到下载的wheels,点击下载
链接: https://www.cgohlke.com/
或者在 https://pypi.org/里搜索后下载
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

执行安装

pip install 下载的地址\\pandas-2.2.3-cp312-cp312-win_amd64.whl

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

4、docker安装open-webui

官网下载docker:https://www.docker.com/
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
安装运行后,直接搜索open-webui,pull拉取镜像
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

#在命令行工具中输入命令,查看镜像docker images

使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练

#运行镜像docker run -d -p 8088:8080 --name webui --restart always dyrnq/open-webui:git-9e726a3

访问http://127.0.0.1:8088/
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练
点击Sign up注册账号,登录后就可以使用啦
使用Ollama+open-webui搭建本地AI模型_ollama+openwebui ai训练