分析不同网站的优缺点,网站开发授权书,第一素材网,长沙 外贸网站建设公司价格概述#xff1a;
本文介绍用Open webui ollama搭建一套Deepseek推理服务#xff0c;可以在web页面上直接进行对话。作为体验搭建的是Deepseek 7b参数版本
首先选择一个云厂商创建一台ubuntu系统的虚拟机#xff0c;带公网IP#xff0c;通过shell登录虚拟机完成以下操作
本文介绍用Open webui ollama搭建一套Deepseek推理服务可以在web页面上直接进行对话。作为体验搭建的是Deepseek 7b参数版本
首先选择一个云厂商创建一台ubuntu系统的虚拟机带公网IP通过shell登录虚拟机完成以下操作如果选择下通过docker安装建议选择海外网络。 搭建方式一docker搭建
安装docker:
sudo apt updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common lrzsz -ysudo curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository deb [archamd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stablesudo apt updatesudo apt-get install docker-ce -y 安装open webui
启动open webui
docker run --network host -d -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
如果虚机是带GPU的可以通过下面命令启动
docker run --network host -d --gpusall -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
启动后可以通过docker ps 命令查看容器正常运行 通过netstate -natp查看监听端口 设置云平台安全组放通8080端口 启动过程会自动下载一些文件通过命令docker logs open-webui -f 查看启动日志等文件下载完即可通过http://虚机ip:8080访问webui 第一次登录根据自己情况输入名称邮箱密码完成本地注册 从选择模型下拉框中输入“deepseek-r1:7b” 进行下载或者登录Ollama.com查找自己想要的模型
等模型下载完就可以进行对话由于最近deepseek火热模型下载速度很慢需要1-4个小时 搭建方式二安装命令安装 sudo -i#安装conda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shbash Miniconda3-latest-Linux-x86_64.sh#创建python 3.11环境
export PATH/root/miniconda3/bin:$PATHconda create -n py311 python3.11 -ysource activate py311#安装ollama
curl -fsSL https://ollama.com/install.sh | sh#安装open webui
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install open-webui#启动ollama
nohup ollama serve |tee ./ollama.log #启动open webui
nohup open-webui serve --port 8080|tee ./webui.log 21 可以通过tail -f webui.log 查看open webui启动日志启动过程会自动下载一些文件通过看日志确认文件下载完便可以通过8080端口访问后续步骤如方式一